Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- BurnedCLO
- Optimization enabled
- false
- Compiler version
- v0.8.16+commit.07a7930e
- EVM Version
- default
- Verified at
- 2024-09-26T15:09:49.087258Z
Contract source code
// SPDX-License-Identifier: GPL pragma solidity ^0.8.16; contract BurnedCLO { address public owner = msg.sender; // Владелец контракта address public caller = msg.sender; // Адрес кому разрешено вносить данные по сожженному CLO uint256 last_block = 13249999; // Последний блок (включительно) до которого рассчитано сжигание uint256 burned_clo = 0; // Общее количество сожженных clo mapping(address => uint256) private commission; // сколько сжег каждый адрес mapping(uint256 => address) private list; // Последовательный список всех активных адресов uint256 index = 1; // последний свободный индекс у list uint256 diff = 50; // при обновлении данных последний расчетный блок не должен превышать correction блоков от текущей высоты блока modifier onlyOwner() { require(msg.sender == owner, "Only owner can call this."); _; } modifier onlyCaller() { require(msg.sender == caller, "Only caller can call this."); _; } /* constructor(address _caller) public { owner = msg.sender; caller = _caller; } */ // Функции function update(uint256 _last_block, address[] memory _holders, uint256[] memory _burns_clo) public onlyCaller{ require(block.number - diff >= _last_block, "err"); // при обновлении данных должна быть задержка не менее 50 блоков от текущей высоты require(_holders.length == _burns_clo.length, "err"); // количество элементов в массивах должно быть одинакого require(_last_block > last_block, "err"); uint256 _index = index; uint256 _summ_clo; for(uint i; i < _holders.length; i++){ if(burnedOf(_holders[i]) == 0){ // первое сжигание адреса commission[_holders[i]] = _burns_clo[i]; list[_index] = _holders[i]; _index++; } else{ commission[_holders[i]] += _burns_clo[i]; } _summ_clo += _burns_clo[i]; } burned_clo += _summ_clo; index = _index; last_block = _last_block; } function burnedOf(address _holder) public view returns (uint256) { return commission[_holder]; } function getAddressByIndex(uint256 _index) public view returns (address) { return list[_index]; } function changeDifference(uint256 _diff) public onlyOwner{ // изменение задержки по блокам diff = _diff; } function changeCaller(address _newCaller) public onlyOwner{ // смена коллера caller = _newCaller; } function getLastBlock() public view returns (uint256) // Последний блок до которого выполнен рассчет { return last_block; } function getCaller() public view returns (address) // Возвращает адрес коллера { return caller; } function getOwner() public view returns (address) // Возвращает адрес владельца { return owner; } function getDifferenceBlock() public view returns (uint256) // задержка по высоте блоков { return diff; } function getLastFeeIndex() public view returns (uint256) // Возвращает последний своботный индекс в list { return index; } function getBurnedCLO() public view returns (uint256) // Возврат сожженного кло { return burned_clo; } }
Contract ABI
[{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"burnedOf","inputs":[{"type":"address","name":"_holder","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"caller","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changeCaller","inputs":[{"type":"address","name":"_newCaller","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changeDifference","inputs":[{"type":"uint256","name":"_diff","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getAddressByIndex","inputs":[{"type":"uint256","name":"_index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getBurnedCLO","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getCaller","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getDifferenceBlock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLastBlock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLastFeeIndex","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getOwner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"update","inputs":[{"type":"uint256","name":"_last_block","internalType":"uint256"},{"type":"address[]","name":"_holders","internalType":"address[]"},{"type":"uint256[]","name":"_burns_clo","internalType":"uint256[]"}]}]
Contract Creation Code
0x6080604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555062ca2dcf6002556000600355600160065560326007553480156100a757600080fd5b50610f55806100b76000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638da5cb5b1161008c578063ce10cf8811610066578063ce10cf88146101ee578063dcfab10f1461021e578063f47f0ea21461023c578063fc9c8d391461025a576100cf565b80638da5cb5b14610196578063ab470f05146101b4578063b29cc22a146101d2576100cf565b80632921d8d4146100d45780632fb73d43146100f0578063412ba55f1461010c5780634773285a1461012a5780637f2c4ca81461015a578063893d20e814610178575b600080fd5b6100ee60048036038101906100e99190610931565b610278565b005b61010a60048036038101906101059190610994565b61034a565b005b6101146103e2565b60405161012191906109d0565b60405180910390f35b610144600480360381019061013f9190610931565b6103ec565b60405161015191906109d0565b60405180910390f35b610162610435565b60405161016f91906109d0565b60405180910390f35b61018061043f565b60405161018d91906109fa565b60405180910390f35b61019e610468565b6040516101ab91906109fa565b60405180910390f35b6101bc61048c565b6040516101c991906109fa565b60405180910390f35b6101ec60048036038101906101e79190610c31565b6104b6565b005b61020860048036038101906102039190610994565b610848565b60405161021591906109fa565b60405180910390f35b610226610885565b60405161023391906109d0565b60405180910390f35b61024461088f565b60405161025191906109d0565b60405180910390f35b610262610899565b60405161026f91906109fa565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610306576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102fd90610d19565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103cf90610d19565b60405180910390fd5b8060078190555050565b6000600654905090565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600254905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053d90610d85565b60405180910390fd5b82600754436105559190610dd4565b1015610596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058d90610e54565b60405180910390fd5b80518251146105da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d190610e54565b60405180910390fd5b600254831161061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590610e54565b60405180910390fd5b600060065490506000805b845181101561081957600061065786838151811061064a57610649610e74565b5b60200260200101516103ec565b036107535783818151811061066f5761066e610e74565b5b60200260200101516004600087848151811061068e5761068d610e74565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508481815181106106e7576106e6610e74565b5b60200260200101516005600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828061074b90610ea3565b9350506107de565b83818151811061076657610765610e74565b5b60200260200101516004600087848151811061078557610784610e74565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546107d69190610eeb565b925050819055505b8381815181106107f1576107f0610e74565b5b6020026020010151826108049190610eeb565b9150808061081190610ea3565b915050610629565b50806003600082825461082c9190610eeb565b9250508190555081600681905550846002819055505050505050565b60006005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600354905090565b6000600754905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108fe826108d3565b9050919050565b61090e816108f3565b811461091957600080fd5b50565b60008135905061092b81610905565b92915050565b600060208284031215610947576109466108c9565b5b60006109558482850161091c565b91505092915050565b6000819050919050565b6109718161095e565b811461097c57600080fd5b50565b60008135905061098e81610968565b92915050565b6000602082840312156109aa576109a96108c9565b5b60006109b88482850161097f565b91505092915050565b6109ca8161095e565b82525050565b60006020820190506109e560008301846109c1565b92915050565b6109f4816108f3565b82525050565b6000602082019050610a0f60008301846109eb565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a6382610a1a565b810181811067ffffffffffffffff82111715610a8257610a81610a2b565b5b80604052505050565b6000610a956108bf565b9050610aa18282610a5a565b919050565b600067ffffffffffffffff821115610ac157610ac0610a2b565b5b602082029050602081019050919050565b600080fd5b6000610aea610ae584610aa6565b610a8b565b90508083825260208201905060208402830185811115610b0d57610b0c610ad2565b5b835b81811015610b365780610b22888261091c565b845260208401935050602081019050610b0f565b5050509392505050565b600082601f830112610b5557610b54610a15565b5b8135610b65848260208601610ad7565b91505092915050565b600067ffffffffffffffff821115610b8957610b88610a2b565b5b602082029050602081019050919050565b6000610bad610ba884610b6e565b610a8b565b90508083825260208201905060208402830185811115610bd057610bcf610ad2565b5b835b81811015610bf95780610be5888261097f565b845260208401935050602081019050610bd2565b5050509392505050565b600082601f830112610c1857610c17610a15565b5b8135610c28848260208601610b9a565b91505092915050565b600080600060608486031215610c4a57610c496108c9565b5b6000610c588682870161097f565b935050602084013567ffffffffffffffff811115610c7957610c786108ce565b5b610c8586828701610b40565b925050604084013567ffffffffffffffff811115610ca657610ca56108ce565b5b610cb286828701610c03565b9150509250925092565b600082825260208201905092915050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869732e00000000000000600082015250565b6000610d03601983610cbc565b9150610d0e82610ccd565b602082019050919050565b60006020820190508181036000830152610d3281610cf6565b9050919050565b7f4f6e6c792063616c6c65722063616e2063616c6c20746869732e000000000000600082015250565b6000610d6f601a83610cbc565b9150610d7a82610d39565b602082019050919050565b60006020820190508181036000830152610d9e81610d62565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610ddf8261095e565b9150610dea8361095e565b9250828203905081811115610e0257610e01610da5565b5b92915050565b7f6572720000000000000000000000000000000000000000000000000000000000600082015250565b6000610e3e600383610cbc565b9150610e4982610e08565b602082019050919050565b60006020820190508181036000830152610e6d81610e31565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000610eae8261095e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610ee057610edf610da5565b5b600182019050919050565b6000610ef68261095e565b9150610f018361095e565b9250828201905080821115610f1957610f18610da5565b5b9291505056fea26469706673582212205ae84a3c5ad624a67f73ef15a1bce96c031a7f99267c188a38fe9e34a7ed9ef664736f6c63430008100033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638da5cb5b1161008c578063ce10cf8811610066578063ce10cf88146101ee578063dcfab10f1461021e578063f47f0ea21461023c578063fc9c8d391461025a576100cf565b80638da5cb5b14610196578063ab470f05146101b4578063b29cc22a146101d2576100cf565b80632921d8d4146100d45780632fb73d43146100f0578063412ba55f1461010c5780634773285a1461012a5780637f2c4ca81461015a578063893d20e814610178575b600080fd5b6100ee60048036038101906100e99190610931565b610278565b005b61010a60048036038101906101059190610994565b61034a565b005b6101146103e2565b60405161012191906109d0565b60405180910390f35b610144600480360381019061013f9190610931565b6103ec565b60405161015191906109d0565b60405180910390f35b610162610435565b60405161016f91906109d0565b60405180910390f35b61018061043f565b60405161018d91906109fa565b60405180910390f35b61019e610468565b6040516101ab91906109fa565b60405180910390f35b6101bc61048c565b6040516101c991906109fa565b60405180910390f35b6101ec60048036038101906101e79190610c31565b6104b6565b005b61020860048036038101906102039190610994565b610848565b60405161021591906109fa565b60405180910390f35b610226610885565b60405161023391906109d0565b60405180910390f35b61024461088f565b60405161025191906109d0565b60405180910390f35b610262610899565b60405161026f91906109fa565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610306576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102fd90610d19565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103cf90610d19565b60405180910390fd5b8060078190555050565b6000600654905090565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600254905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053d90610d85565b60405180910390fd5b82600754436105559190610dd4565b1015610596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058d90610e54565b60405180910390fd5b80518251146105da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d190610e54565b60405180910390fd5b600254831161061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590610e54565b60405180910390fd5b600060065490506000805b845181101561081957600061065786838151811061064a57610649610e74565b5b60200260200101516103ec565b036107535783818151811061066f5761066e610e74565b5b60200260200101516004600087848151811061068e5761068d610e74565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508481815181106106e7576106e6610e74565b5b60200260200101516005600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828061074b90610ea3565b9350506107de565b83818151811061076657610765610e74565b5b60200260200101516004600087848151811061078557610784610e74565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546107d69190610eeb565b925050819055505b8381815181106107f1576107f0610e74565b5b6020026020010151826108049190610eeb565b9150808061081190610ea3565b915050610629565b50806003600082825461082c9190610eeb565b9250508190555081600681905550846002819055505050505050565b60006005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600354905090565b6000600754905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108fe826108d3565b9050919050565b61090e816108f3565b811461091957600080fd5b50565b60008135905061092b81610905565b92915050565b600060208284031215610947576109466108c9565b5b60006109558482850161091c565b91505092915050565b6000819050919050565b6109718161095e565b811461097c57600080fd5b50565b60008135905061098e81610968565b92915050565b6000602082840312156109aa576109a96108c9565b5b60006109b88482850161097f565b91505092915050565b6109ca8161095e565b82525050565b60006020820190506109e560008301846109c1565b92915050565b6109f4816108f3565b82525050565b6000602082019050610a0f60008301846109eb565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a6382610a1a565b810181811067ffffffffffffffff82111715610a8257610a81610a2b565b5b80604052505050565b6000610a956108bf565b9050610aa18282610a5a565b919050565b600067ffffffffffffffff821115610ac157610ac0610a2b565b5b602082029050602081019050919050565b600080fd5b6000610aea610ae584610aa6565b610a8b565b90508083825260208201905060208402830185811115610b0d57610b0c610ad2565b5b835b81811015610b365780610b22888261091c565b845260208401935050602081019050610b0f565b5050509392505050565b600082601f830112610b5557610b54610a15565b5b8135610b65848260208601610ad7565b91505092915050565b600067ffffffffffffffff821115610b8957610b88610a2b565b5b602082029050602081019050919050565b6000610bad610ba884610b6e565b610a8b565b90508083825260208201905060208402830185811115610bd057610bcf610ad2565b5b835b81811015610bf95780610be5888261097f565b845260208401935050602081019050610bd2565b5050509392505050565b600082601f830112610c1857610c17610a15565b5b8135610c28848260208601610b9a565b91505092915050565b600080600060608486031215610c4a57610c496108c9565b5b6000610c588682870161097f565b935050602084013567ffffffffffffffff811115610c7957610c786108ce565b5b610c8586828701610b40565b925050604084013567ffffffffffffffff811115610ca657610ca56108ce565b5b610cb286828701610c03565b9150509250925092565b600082825260208201905092915050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869732e00000000000000600082015250565b6000610d03601983610cbc565b9150610d0e82610ccd565b602082019050919050565b60006020820190508181036000830152610d3281610cf6565b9050919050565b7f4f6e6c792063616c6c65722063616e2063616c6c20746869732e000000000000600082015250565b6000610d6f601a83610cbc565b9150610d7a82610d39565b602082019050919050565b60006020820190508181036000830152610d9e81610d62565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610ddf8261095e565b9150610dea8361095e565b9250828203905081811115610e0257610e01610da5565b5b92915050565b7f6572720000000000000000000000000000000000000000000000000000000000600082015250565b6000610e3e600383610cbc565b9150610e4982610e08565b602082019050919050565b60006020820190508181036000830152610e6d81610e31565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000610eae8261095e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610ee057610edf610da5565b5b600182019050919050565b6000610ef68261095e565b9150610f018361095e565b9250828201905080821115610f1957610f18610da5565b5b9291505056fea26469706673582212205ae84a3c5ad624a67f73ef15a1bce96c031a7f99267c188a38fe9e34a7ed9ef664736f6c63430008100033