Overview
ETH Balance
1 wei
Eth Value
Less Than $0.01 (@ $3,498.82/ETH)More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 62 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Distribute | 13672446 | 969 days ago | IN | 0 ETH | 0.01139208 | ||||
Distribute | 13663866 | 970 days ago | IN | 0 ETH | 0.00827268 | ||||
Distribute | 13651432 | 972 days ago | IN | 0 ETH | 0.00498115 | ||||
Distribute | 13634472 | 975 days ago | IN | 0 ETH | 0.00910088 | ||||
Distribute | 13622662 | 977 days ago | IN | 0 ETH | 0.01074147 | ||||
Distribute | 13606964 | 979 days ago | IN | 0 ETH | 0.0057919 | ||||
Distribute | 13581771 | 983 days ago | IN | 0 ETH | 0.0081215 | ||||
Distribute | 13575281 | 984 days ago | IN | 0 ETH | 0.00564092 | ||||
Distribute | 13564820 | 986 days ago | IN | 0 ETH | 0.00942745 | ||||
Distribute | 13558615 | 987 days ago | IN | 0 ETH | 0.01124154 | ||||
Distribute | 13555896 | 987 days ago | IN | 0 ETH | 0.00634357 | ||||
Distribute | 13552471 | 988 days ago | IN | 0 ETH | 0.00960671 | ||||
Distribute | 13545486 | 989 days ago | IN | 0 ETH | 0.00813822 | ||||
Distribute | 13539647 | 990 days ago | IN | 0 ETH | 0.01186945 | ||||
Distribute | 13532567 | 991 days ago | IN | 0 ETH | 0.01214445 | ||||
Distribute | 13530707 | 991 days ago | IN | 0 ETH | 0.00886223 | ||||
Distribute | 13510929 | 994 days ago | IN | 0 ETH | 0.01151999 | ||||
Distribute | 13491311 | 997 days ago | IN | 0 ETH | 0.00627425 | ||||
Distribute | 13489105 | 998 days ago | IN | 0 ETH | 0.00743854 | ||||
Distribute | 13482226 | 999 days ago | IN | 0 ETH | 0.00628838 | ||||
Distribute | 13475806 | 1000 days ago | IN | 0 ETH | 0.00409057 | ||||
Distribute | 13469011 | 1001 days ago | IN | 0 ETH | 0.00659766 | ||||
Distribute | 13456107 | 1003 days ago | IN | 0 ETH | 0.00578943 | ||||
Distribute | 13430961 | 1007 days ago | IN | 0 ETH | 0.00545227 | ||||
Distribute | 13406091 | 1011 days ago | IN | 0 ETH | 0.00600876 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
13672446 | 969 days ago | 0.58177998 ETH | ||||
13672446 | 969 days ago | 0.58177998 ETH | ||||
13672446 | 969 days ago | 0.77570665 ETH | ||||
13670171 | 969 days ago | 0.13067192 ETH | ||||
13669728 | 969 days ago | 0.1537287 ETH | ||||
13669410 | 969 days ago | 0.29032317 ETH | ||||
13668191 | 970 days ago | 0.28781989 ETH | ||||
13667569 | 970 days ago | 0.02271745 ETH | ||||
13667446 | 970 days ago | 0.04200493 ETH | ||||
13667088 | 970 days ago | 0.01994392 ETH | ||||
13667078 | 970 days ago | 0.11332803 ETH | ||||
13666512 | 970 days ago | 0.05292242 ETH | ||||
13666360 | 970 days ago | 0.04657863 ETH | ||||
13666076 | 970 days ago | 0.08013756 ETH | ||||
13664768 | 970 days ago | 0.0194821 ETH | ||||
13664739 | 970 days ago | 0.15047253 ETH | ||||
13664639 | 970 days ago | 0.24034587 ETH | ||||
13664243 | 970 days ago | 0.20613213 ETH | ||||
13664239 | 970 days ago | 0.21211454 ETH | ||||
13664230 | 970 days ago | 0.01793805 ETH | ||||
13664190 | 970 days ago | 0.14042459 ETH | ||||
13663866 | 970 days ago | 1.72681635 ETH | ||||
13663866 | 970 days ago | 1.72681635 ETH | ||||
13663866 | 970 days ago | 2.3024218 ETH | ||||
13663638 | 970 days ago | 0.272607 ETH |
Loading...
Loading
Contract Name:
MyobuDistributor
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./Utils/Ownable.sol"; import "./Interfaces/IMyobuDistributor.sol"; import "./Utils/DistributorLib.sol"; // import "hardhat/console.sol"; contract MyobuDistributor is IMyobuDistributor, Ownable { mapping(uint256 => DistributeTo) private distributeTo_; function distributeTo(uint256 index) external view override returns (DistributeTo memory) { return distributeTo_[index]; } uint256 public override distributeToCount; function addArrayToMapping(DistributeTo[] memory array) private { distributeToCount = array.length; for (uint256 i; i < array.length; i++) { distributeTo_[i] = array[i]; } } function setDistributeTo(DistributeTo[] calldata toDistributeTo) external onlyOwner { if (distributeToCount != 0) distribute(); uint256 totalPercentage; for (uint256 i; i < toDistributeTo.length; i++) { totalPercentage += toDistributeTo[i].percentage; } require(totalPercentage == 100, "Total percentage must equal to 100"); addArrayToMapping(toDistributeTo); emit DistributeToChanged(toDistributeTo); } function distribute() public override { require(distributeToCount != 0, "Must have distribution set"); if (address(this).balance == 0) return; uint256 totalBalance = address(this).balance; for (uint256 i; i < distributeToCount; i++) { DistributorLib.transferOrWrapETH( distributeTo_[i].addr, (totalBalance * distributeTo_[i].percentage) / 100 ); } emit Distributed(totalBalance, _msgSender()); } // solhint-disable-next-line receive() external payable {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../Interfaces/IWETH.sol"; library DistributorLib { IWETH internal constant WETH = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); /** * @dev Attempt to transfer ETH, if failed wrap the ETH and send WETH. So that the * transfer always succeeds * @param to: The address to send ETH to * @param amount: The amount to send */ function transferOrWrapETH(address to, uint256 amount) internal { // solhint-disable-next-line if (!payable(to).send(amount)) { WETH.deposit{value: amount}(); WETH.transfer(to, amount); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IMyobuDistributor { struct DistributeTo { address addr; uint256 percentage; } event DistributeToChanged(DistributeTo[] _distributeTo); function distributeTo(uint256 index) external view returns (DistributeTo memory); function distributeToCount() external view returns (uint256); event Distributed(uint256 amount, address sender); function distribute() external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IWETH { function deposit() external payable; function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"indexed":false,"internalType":"struct IMyobuDistributor.DistributeTo[]","name":"_distributeTo","type":"tuple[]"}],"name":"DistributeToChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"Distributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"distributeTo","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"internalType":"struct IMyobuDistributor.DistributeTo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributeToCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"internalType":"struct IMyobuDistributor.DistributeTo[]","name":"toDistributeTo","type":"tuple[]"}],"name":"setDistributeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6109a78061007e6000396000f3fe6080604052600436106100745760003560e01c8063b4cf04ff1161004e578063b4cf04ff146100e4578063e4fc6b6d14610108578063f2fde38b1461011d578063f8e9273a1461013d57600080fd5b8063715018a6146100805780638277d2ea146100975780638da5cb5b146100b757600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b506100956101c3565b005b3480156100a357600080fd5b506100956100b2366004610753565b610202565b3480156100c357600080fd5b506000546040516001600160a01b0390911681526020015b60405180910390f35b3480156100f057600080fd5b506100fa60025481565b6040519081526020016100db565b34801561011457600080fd5b50610095610386565b34801561012957600080fd5b50610095610138366004610732565b61047a565b34801561014957600080fd5b5061019f610158366004610845565b604080518082019091526000808252602082015250600090815260016020818152604092839020835180850190945280546001600160a01b03168452909101549082015290565b6040805182516001600160a01b0316815260209283015192810192909252016100db565b6000546001600160a01b031633146101f65760405162461bcd60e51b81526004016101ed906108b4565b60405180910390fd5b6102006000610515565b565b6000546001600160a01b0316331461022c5760405162461bcd60e51b81526004016101ed906108b4565b6002541561023c5761023c610386565b6000805b828110156102915783838281811061026857634e487b7160e01b600052603260045260246000fd5b905060400201602001358261027d91906108e9565b91508061028981610940565b915050610240565b50806064146102ed5760405162461bcd60e51b815260206004820152602260248201527f546f74616c2070657263656e74616765206d75737420657175616c20746f2031604482015261030360f41b60648201526084016101ed565b6103488383808060200260200160405190810160405280939291908181526020016000905b8282101561033e5761032f604083028601368190038101906107e3565b81526020019060010190610312565b5050505050610565565b7f4f8a6a7dfa6178a813d32a68a4bd3411ecf0cbeb476030701293a386b9ce6dd1838360405161037992919061085d565b60405180910390a1505050565b6002546103d55760405162461bcd60e51b815260206004820152601a60248201527f4d757374206861766520646973747269627574696f6e2073657400000000000060448201526064016101ed565b476103dc57565b4760005b60025481101561043c576000818152600160208190526040909120805491015461042a916001600160a01b03169060649061041b9086610921565b6104259190610901565b6105eb565b8061043481610940565b9150506103e0565b506040805182815233602082015281517f6f0c43eb568796d764f36f0413e491b0b334101cb8b6288756cd9b76a8c00f8a929181900390910190a150565b6000546001600160a01b031633146104a45760405162461bcd60e51b81526004016101ed906108b4565b6001600160a01b0381166105095760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101ed565b61051281610515565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b805160025560005b81518110156105e75781818151811061059657634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600083815260018084526040909120825181546001600160a01b0319166001600160a01b039091161781559190920151910155806105df81610940565b91505061056d565b5050565b6040516001600160a01b0383169082156108fc029083906000818181858888f193505050506105e75773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561066357600080fd5b505af1158015610677573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b03861660048201526024810185905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063a9059cbb92506044019050602060405180830381600087803b1580156106d957600080fd5b505af11580156106ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071191906107c3565b505050565b80356001600160a01b038116811461072d57600080fd5b919050565b600060208284031215610743578081fd5b61074c82610716565b9392505050565b60008060208385031215610765578081fd5b823567ffffffffffffffff8082111561077c578283fd5b818501915085601f83011261078f578283fd5b81358181111561079d578384fd5b8660208260061b85010111156107b1578384fd5b60209290920196919550909350505050565b6000602082840312156107d4578081fd5b8151801515811461074c578182fd5b6000604082840312156107f4578081fd5b6040516040810181811067ffffffffffffffff8211171561082357634e487b7160e01b83526041600452602483fd5b60405261082f83610716565b8152602083013560208201528091505092915050565b600060208284031215610856578081fd5b5035919050565b6020808252818101839052600090604080840186845b878110156108a7576001600160a01b0361088c83610716565b16835281850135858401529183019190830190600101610873565b5090979650505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156108fc576108fc61095b565b500190565b60008261091c57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561093b5761093b61095b565b500290565b60006000198214156109545761095461095b565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220253c3ca4a509d894166cda2a73cad33b6a63c6d761f81d8dc37e5c364d852ed164736f6c63430008040033
Deployed Bytecode
0x6080604052600436106100745760003560e01c8063b4cf04ff1161004e578063b4cf04ff146100e4578063e4fc6b6d14610108578063f2fde38b1461011d578063f8e9273a1461013d57600080fd5b8063715018a6146100805780638277d2ea146100975780638da5cb5b146100b757600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b506100956101c3565b005b3480156100a357600080fd5b506100956100b2366004610753565b610202565b3480156100c357600080fd5b506000546040516001600160a01b0390911681526020015b60405180910390f35b3480156100f057600080fd5b506100fa60025481565b6040519081526020016100db565b34801561011457600080fd5b50610095610386565b34801561012957600080fd5b50610095610138366004610732565b61047a565b34801561014957600080fd5b5061019f610158366004610845565b604080518082019091526000808252602082015250600090815260016020818152604092839020835180850190945280546001600160a01b03168452909101549082015290565b6040805182516001600160a01b0316815260209283015192810192909252016100db565b6000546001600160a01b031633146101f65760405162461bcd60e51b81526004016101ed906108b4565b60405180910390fd5b6102006000610515565b565b6000546001600160a01b0316331461022c5760405162461bcd60e51b81526004016101ed906108b4565b6002541561023c5761023c610386565b6000805b828110156102915783838281811061026857634e487b7160e01b600052603260045260246000fd5b905060400201602001358261027d91906108e9565b91508061028981610940565b915050610240565b50806064146102ed5760405162461bcd60e51b815260206004820152602260248201527f546f74616c2070657263656e74616765206d75737420657175616c20746f2031604482015261030360f41b60648201526084016101ed565b6103488383808060200260200160405190810160405280939291908181526020016000905b8282101561033e5761032f604083028601368190038101906107e3565b81526020019060010190610312565b5050505050610565565b7f4f8a6a7dfa6178a813d32a68a4bd3411ecf0cbeb476030701293a386b9ce6dd1838360405161037992919061085d565b60405180910390a1505050565b6002546103d55760405162461bcd60e51b815260206004820152601a60248201527f4d757374206861766520646973747269627574696f6e2073657400000000000060448201526064016101ed565b476103dc57565b4760005b60025481101561043c576000818152600160208190526040909120805491015461042a916001600160a01b03169060649061041b9086610921565b6104259190610901565b6105eb565b8061043481610940565b9150506103e0565b506040805182815233602082015281517f6f0c43eb568796d764f36f0413e491b0b334101cb8b6288756cd9b76a8c00f8a929181900390910190a150565b6000546001600160a01b031633146104a45760405162461bcd60e51b81526004016101ed906108b4565b6001600160a01b0381166105095760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101ed565b61051281610515565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b805160025560005b81518110156105e75781818151811061059657634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600083815260018084526040909120825181546001600160a01b0319166001600160a01b039091161781559190920151910155806105df81610940565b91505061056d565b5050565b6040516001600160a01b0383169082156108fc029083906000818181858888f193505050506105e75773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561066357600080fd5b505af1158015610677573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b03861660048201526024810185905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063a9059cbb92506044019050602060405180830381600087803b1580156106d957600080fd5b505af11580156106ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071191906107c3565b505050565b80356001600160a01b038116811461072d57600080fd5b919050565b600060208284031215610743578081fd5b61074c82610716565b9392505050565b60008060208385031215610765578081fd5b823567ffffffffffffffff8082111561077c578283fd5b818501915085601f83011261078f578283fd5b81358181111561079d578384fd5b8660208260061b85010111156107b1578384fd5b60209290920196919550909350505050565b6000602082840312156107d4578081fd5b8151801515811461074c578182fd5b6000604082840312156107f4578081fd5b6040516040810181811067ffffffffffffffff8211171561082357634e487b7160e01b83526041600452602483fd5b60405261082f83610716565b8152602083013560208201528091505092915050565b600060208284031215610856578081fd5b5035919050565b6020808252818101839052600090604080840186845b878110156108a7576001600160a01b0361088c83610716565b16835281850135858401529183019190830190600101610873565b5090979650505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156108fc576108fc61095b565b500190565b60008261091c57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561093b5761093b61095b565b500290565b60006000198214156109545761095461095b565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220253c3ca4a509d894166cda2a73cad33b6a63c6d761f81d8dc37e5c364d852ed164736f6c63430008040033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $3,498.82 | 0.000000000000000001 | <$0.000001 |
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.