My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Latest 1 internal transaction
Parent Txn Hash | Block | From | To | Value | |||
---|---|---|---|---|---|---|---|
0x4eafe4b84060b4bd5015d976ffc58bc5b43c475b5050f2bf8ceee8159fe9e50f | 14672866 | 530 days 16 hrs ago | Tarot: Deployer | Contract Creation | 0 FTM |
[ Download CSV Export ]
Contract Name:
OwnedDistributor
Compiler Version
v0.6.6+commit.6c089d02
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity =0.6.6; import "./Distributor.sol"; contract OwnedDistributor is Distributor { address public admin; event SetAdmin(address newAdmin); constructor( address tarot_, address claimable_, address admin_ ) public Distributor(tarot_, claimable_) { admin = admin_; } function editRecipient(address account, uint shares) public virtual { require(msg.sender == admin, "OwnedDistributor: UNAUTHORIZED"); editRecipientInternal(account, shares); } function setAdmin(address admin_) public virtual { require(msg.sender == admin, "OwnedDistributor: UNAUTHORIZED"); admin = admin_; emit SetAdmin(admin_); } }
pragma solidity =0.6.6; import "./libraries/SafeMath.sol"; import "./interfaces/ITarot.sol"; import "./interfaces/IClaimable.sol"; abstract contract Distributor is IClaimable { using SafeMath for uint; address public immutable tarot; address public immutable claimable; struct Recipient { uint shares; uint lastShareIndex; uint credit; } mapping(address => Recipient) public recipients; uint public totalShares; uint public shareIndex; event UpdateShareIndex(uint shareIndex); event UpdateCredit(address indexed account, uint lastShareIndex, uint credit); event Claim(address indexed account, uint amount); event EditRecipient(address indexed account, uint shares, uint totalShares); constructor(address tarot_, address claimable_) public { tarot = tarot_; claimable = claimable_; } function updateShareIndex() public virtual nonReentrant returns (uint _shareIndex) { if (totalShares == 0) return shareIndex; uint amount = IClaimable(claimable).claim(); if (amount == 0) return shareIndex; _shareIndex = amount.mul(2**160).div(totalShares).add(shareIndex); shareIndex = _shareIndex; emit UpdateShareIndex(_shareIndex); } function updateCredit(address account) public returns (uint credit) { uint _shareIndex = updateShareIndex(); if (_shareIndex == 0) return 0; Recipient storage recipient = recipients[account]; credit = recipient.credit + _shareIndex.sub(recipient.lastShareIndex).mul(recipient.shares) / 2**160; recipient.lastShareIndex = _shareIndex; recipient.credit = credit; emit UpdateCredit(account, _shareIndex, credit); } function claimInternal(address account) internal virtual returns (uint amount) { amount = updateCredit(account); if (amount > 0) { recipients[account].credit = 0; ITarot(tarot).transfer(account, amount); emit Claim(account, amount); } } function claim() external virtual override returns (uint amount) { return claimInternal(msg.sender); } function editRecipientInternal(address account, uint shares) internal { updateCredit(account); Recipient storage recipient = recipients[account]; uint prevShares = recipient.shares; uint _totalShares = shares > prevShares ? totalShares.add(shares - prevShares) : totalShares.sub(prevShares - shares); totalShares = _totalShares; recipient.shares = shares; emit EditRecipient(account, shares, _totalShares); } // Prevents a contract from calling itself, directly or indirectly. bool internal _notEntered = true; modifier nonReentrant() { require(_notEntered, "Distributor: REENTERED"); _notEntered = false; _; _notEntered = true; } }
pragma solidity =0.6.6; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
pragma solidity =0.6.6; //IERC20 interface ITarot { function balanceOf(address account) external view returns (uint); function transfer(address dst, uint rawAmount) external returns (bool); }
pragma solidity =0.6.6; interface IClaimable { function claim() external returns (uint amount); event Claim(address indexed account, uint amount); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"tarot_","type":"address"},{"internalType":"address","name":"claimable_","type":"address"},{"internalType":"address","name":"admin_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalShares","type":"uint256"}],"name":"EditRecipient","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"SetAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"lastShareIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"credit","type":"uint256"}],"name":"UpdateCredit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"shareIndex","type":"uint256"}],"name":"UpdateShareIndex","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimable","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"editRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"recipients","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"lastShareIndex","type":"uint256"},{"internalType":"uint256","name":"credit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin_","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shareIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tarot","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"updateCredit","outputs":[{"internalType":"uint256","name":"credit","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateShareIndex","outputs":[{"internalType":"uint256","name":"_shareIndex","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040526003805460ff1916600117905534801561001d57600080fd5b50604051610b07380380610b078339818101604052606081101561004057600080fd5b5080516020820151604090920151606082811b6001600160601b03199081166080529084901b1660a05260038054610100600160a81b0319166101006001600160a01b03938416021790559081169116610a506100b76000398061041552806104a852508061033152806107ab5250610a506000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063704b6c0211610071578063704b6c0214610148578063af38d7571461016e578063b260187d14610176578063c56ad1ad1461017e578063eb82031214610186578063f851a440146101ca576100a9565b80633a98ef39146100ae57806345c08718146100c85780634674a930146100ee5780634e71d92d1461011c5780636d5360c114610124575b600080fd5b6100b66101d2565b60408051918252519081900360200190f35b6100b6600480360360208110156100de57600080fd5b50356001600160a01b03166101d8565b61011a6004803603604081101561010457600080fd5b506001600160a01b0381351690602001356102ad565b005b6100b661031f565b61012c61032f565b604080516001600160a01b039092168252519081900360200190f35b61011a6004803603602081101561015e57600080fd5b50356001600160a01b0316610353565b61012c610413565b6100b6610437565b6100b66105c7565b6101ac6004803603602081101561019c57600080fd5b50356001600160a01b03166105cd565b60408051938452602084019290925282820152519081900360600190f35b61012c6105ee565b60015481565b6000806101e3610437565b9050806101f45760009150506102a8565b6001600160a01b038316600090815260208190526040902080546001820154600160a01b9161023a9161022e90869063ffffffff61060216565b9063ffffffff61064d16565b8161024157fe5b048160020154019250818160010181905550828160020181905550836001600160a01b03167ff7240857a4f83123f14a7bc3f77cd32d0ae71ede635c92ebdcc14d5ea8ed018a8385604051808381526020018281526020019250505060405180910390a250505b919050565b60035461010090046001600160a01b03163314610311576040805162461bcd60e51b815260206004820152601e60248201527f4f776e65644469737472696275746f723a20554e415554484f52495a45440000604482015290519081900360640190fd5b61031b82826106a6565b5050565b600061032a3361075a565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b60035461010090046001600160a01b031633146103b7576040805162461bcd60e51b815260206004820152601e60248201527f4f776e65644469737472696275746f723a20554e415554484f52495a45440000604482015290519081900360640190fd5b600380546001600160a01b0383166101008102610100600160a81b03199092169190911790915560408051918252517f5a272403b402d892977df56625f4164ccaf70ca3863991c43ecfe76a6905b0a19181900360200190a150565b7f000000000000000000000000000000000000000000000000000000000000000081565b60035460009060ff1661048a576040805162461bcd60e51b8152602060048201526016602482015275111a5cdd1c9a589d5d1bdc8e8814915153951154915160521b604482015290519081900360640190fd5b6003805460ff191690556001546104a457506002546105b7565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634e71d92d6040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561050157600080fd5b505af1158015610515573d6000803e3d6000fd5b505050506040513d602081101561052b57600080fd5b505190508061053e5750506002546105b7565b61057960025461056d600154610561600160a01b8661064d90919063ffffffff16565b9063ffffffff61086116565b9063ffffffff6108a316565b60028190556040805182815290519193507f8cae7c5b456d193882de6985578f406aefb641501192211706c5aa0a32612fec919081900360200190a1505b6003805460ff1916600117905590565b60025481565b60006020819052908152604090208054600182015460029092015490919083565b60035461010090046001600160a01b031681565b600061064483836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f77008152506108fd565b90505b92915050565b60008261065c57506000610647565b8282028284828161066957fe5b04146106445760405162461bcd60e51b81526004018080602001828103825260218152602001806109fa6021913960400191505060405180910390fd5b6106af826101d8565b506001600160a01b0382166000908152602081905260408120805490918184116106ed576001546106e89085840363ffffffff61060216565b610702565b6001546107029083860363ffffffff6108a316565b6001819055848455604080518681526020810183905281519293506001600160a01b038816927fff3664f5f2f8f85ecd8d30ef2aa6773d8a8448219c7421dcbb67957fb3fafba1929181900390910190a25050505050565b6000610765826101d8565b905080156102a8576001600160a01b03808316600081815260208181526040808320600201839055805163a9059cbb60e01b8152600481019490945260248401869052517f00000000000000000000000000000000000000000000000000000000000000009094169363a9059cbb93604480820194918390030190829087803b1580156107f157600080fd5b505af1158015610805573d6000803e3d6000fd5b505050506040513d602081101561081b57600080fd5b50506040805182815290516001600160a01b038416917f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4919081900360200190a2919050565b600061064483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610994565b600082820183811015610644576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000818484111561098c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610951578181015183820152602001610939565b50505050905090810190601f16801561097e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836109e35760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610951578181015183820152602001610939565b5060008385816109ef57fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220068a46d9a7d7a89ca6d98d267d3827e93fb126c5e031a8967b7d9adbe06d408864736f6c63430006060033000000000000000000000000c5e2b037d30a390e62180970b3aa4e91868764cd000000000000000000000000da6489f35d58ecf4e152701c3e72f42e24466e0c0000000000000000000000005b0390bccca1f040d8993eb6e4ce8ded93721765
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c5e2b037d30a390e62180970b3aa4e91868764cd000000000000000000000000da6489f35d58ecf4e152701c3e72f42e24466e0c0000000000000000000000005b0390bccca1f040d8993eb6e4ce8ded93721765
-----Decoded View---------------
Arg [0] : tarot_ (address): 0xc5e2b037d30a390e62180970b3aa4e91868764cd
Arg [1] : claimable_ (address): 0xda6489f35d58ecf4e152701c3e72f42e24466e0c
Arg [2] : admin_ (address): 0x5b0390bccca1f040d8993eb6e4ce8ded93721765
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000c5e2b037d30a390e62180970b3aa4e91868764cd
Arg [1] : 000000000000000000000000da6489f35d58ecf4e152701c3e72f42e24466e0c
Arg [2] : 0000000000000000000000005b0390bccca1f040d8993eb6e4ce8ded93721765
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Validator ID :
0 FTM
Amount Staked
0
Amount Delegated
0
Staking Total
0
Staking Start Epoch
0
Staking Start Time
0
Proof of Importance
0
Origination Score
0
Validation Score
0
Active
0
Online
0
Downtime
0 s
Address | Amount | claimed Rewards | Created On Epoch | Created On |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.