Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Transfer Ownersh... | 24415108 | 13 days ago | IN | 0 ETH | 0.00000123 |
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| 0x60808060 | 24415100 | 13 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
SimpleDividendDistributor
Compiler Version
v0.8.25+commit.b61c2a91
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
interface IDEXRouter {
function WETH() external pure returns (address);
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
}
contract SimpleDividendDistributor {
IDEXRouter router;
IERC20Metadata public rewardToken;
address _token;
address public owner;
address[] public shareholders;
uint256 public totalShares;
uint256 public totalDividends;
uint256 public totalDistributed;
uint256 public dividendsPerShare;
uint256 public dividendsPerShareAccuracyFactor;
uint256 public minPeriod;
uint256 public minDistribution;
uint256 currentIndex;
mapping (address => uint256) shareholderIndexes;
mapping (address => uint256) shareholderClaims;
mapping (address => Share) public shares;
struct Share {
uint256 amount;
uint256 totalExcluded;
uint256 totalRealised;
}
event RewardDistributed(address receiver, uint256 amount);
constructor (address _owner, address _router, address _rewardToken) {
router = IDEXRouter(_router);
_token = msg.sender;
owner = _owner;
rewardToken = IERC20Metadata(_rewardToken);
minPeriod = 5 minutes;
minDistribution = 1 * (10 ** rewardToken.decimals());
dividendsPerShareAccuracyFactor = 10 ** 36;
}
modifier onlyToken() {
require(msg.sender == _token, "only token can call this"); _;
}
modifier onlyOwner() {
require(msg.sender == owner, "only owner can call this"); _;
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "new owner is zero address");
owner = newOwner;
}
function claimETH(address to, uint amount) external onlyOwner {
(bool success,) = to.call{value: amount}("");
require(success, "ETH transfer failed");
}
function setDistributionCriteria(uint256 newMinPeriod, uint256 newMinDistribution) external onlyOwner {
minPeriod = newMinPeriod;
minDistribution = newMinDistribution;
}
function setRewardToken(address newRewardToken) external onlyOwner {
rewardToken = IERC20Metadata(newRewardToken);
}
function setShare(address shareholder, uint256 amount) external onlyToken {
if(shares[shareholder].amount > 0){
distributeDividend(shareholder);
}
if(amount > 0 && shares[shareholder].amount == 0){
addShareholder(shareholder);
}else if(amount == 0 && shares[shareholder].amount > 0){
removeShareholder(shareholder);
}
totalShares = totalShares - shares[shareholder].amount + amount;
shares[shareholder].amount = amount;
shares[shareholder].totalExcluded = getCumulativeDividends(shares[shareholder].amount);
}
function deposit() external payable onlyToken {
uint256 balanceBefore = rewardToken.balanceOf(address(this));
address[] memory path = new address[](2);
path[0] = router.WETH();
path[1] = address(rewardToken);
router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: msg.value}(
0,
path,
address(this),
block.timestamp
);
uint256 amount = rewardToken.balanceOf(address(this)) - balanceBefore;
totalDividends = totalDividends + amount;
dividendsPerShare = dividendsPerShare + (dividendsPerShareAccuracyFactor * amount / totalShares);
}
function process(uint256 gas) external {
uint256 shareholderCount = shareholders.length;
if(shareholderCount == 0) { return; }
uint256 iterations = 0;
uint256 gasUsed = 0;
uint256 gasLeft = gasleft();
while(gasUsed < gas && iterations < shareholderCount) {
if(currentIndex >= shareholderCount){ currentIndex = 0; }
if(shouldDistribute(shareholders[currentIndex])){
distributeDividend(shareholders[currentIndex]);
}
gasUsed = gasUsed + gasLeft - gasleft();
gasLeft = gasleft();
currentIndex++;
iterations++;
}
}
function shouldDistribute(address shareholder) public view returns (bool) {
return shareholderClaims[shareholder] + minPeriod < block.timestamp
&& getUnpaidEarnings(shareholder) > minDistribution;
}
function distributeDividend(address shareholder) internal {
if(shares[shareholder].amount == 0){ return; }
uint256 amount = getUnpaidEarnings(shareholder);
if(amount > 0){
totalDistributed = totalDistributed + amount;
SafeERC20.safeTransfer(rewardToken, shareholder, amount);
emit RewardDistributed(shareholder, amount);
shareholderClaims[shareholder] = block.timestamp;
shares[shareholder].totalRealised = shares[shareholder].totalRealised + amount;
shares[shareholder].totalExcluded = getCumulativeDividends(shares[shareholder].amount);
}
}
function claimDividend() external {
require(shouldDistribute(msg.sender), "Too soon. Need to wait!");
distributeDividend(msg.sender);
}
function getUnpaidEarnings(address shareholder) public view returns (uint256) {
if(shares[shareholder].amount == 0){ return 0; }
uint256 shareholderTotalDividends = getCumulativeDividends(shares[shareholder].amount);
uint256 shareholderTotalExcluded = shares[shareholder].totalExcluded;
if(shareholderTotalDividends <= shareholderTotalExcluded){ return 0; }
return shareholderTotalDividends - shareholderTotalExcluded;
}
function getCumulativeDividends(uint256 share) internal view returns (uint256) {
return share * dividendsPerShare / dividendsPerShareAccuracyFactor;
}
function addShareholder(address shareholder) internal {
shareholderIndexes[shareholder] = shareholders.length;
shareholders.push(shareholder);
}
function removeShareholder(address shareholder) internal {
shareholders[shareholderIndexes[shareholder]] = shareholders[shareholders.length-1];
shareholderIndexes[shareholders[shareholders.length-1]] = shareholderIndexes[shareholder];
shareholders.pop();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)
pragma solidity >=0.6.2;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)
pragma solidity >=0.4.16;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)
pragma solidity >=0.4.16;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity >=0.6.2;
import {IERC20} from "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"viaIR": true,
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardDistributed","type":"event"},{"inputs":[],"name":"claimDividend","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claimETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"dividendsPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dividendsPerShareAccuracyFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"shareholder","type":"address"}],"name":"getUnpaidEarnings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDistribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"gas","type":"uint256"}],"name":"process","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinPeriod","type":"uint256"},{"internalType":"uint256","name":"newMinDistribution","type":"uint256"}],"name":"setDistributionCriteria","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRewardToken","type":"address"}],"name":"setRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"shareholder","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"shareholders","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"shares","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"totalExcluded","type":"uint256"},{"internalType":"uint256","name":"totalRealised","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"shareholder","type":"address"}],"name":"shouldDistribute","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDividends","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6080806040523461014757606081611131803803809161001f828561014c565b833981010312610147576004602061003683610185565b61004d6040610046848701610185565b9501610185565b60018060a01b03908160018060a01b0319938160009816858954161788553385600254161760025516836003541617600355168091600154161760015561012c600a556040519283809263313ce56760e01b82525afa801561013c5782906100fb575b60ff91501690604d82116100e75750600a0a600b556ec097ce7bc90715b34b9f1000000000600955604051610f97908161019a8239f35b634e487b7160e01b81526011600452602490fd5b506020813d602011610134575b816101156020938361014c565b81010312610130575160ff811681036101305760ff906100b0565b5080fd5b3d9150610108565b6040513d84823e3d90fd5b600080fd5b601f909101601f19168101906001600160401b0382119082101761016f57604052565b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036101475756fe6040608081526004908136101561001557600080fd5b600091823560e01c9081630b94de9c14610a0f57816311ce023d146109f057816314b6ca961461078a57816328fd31981461075d5781632d48e896146107295781633a98ef391461070a5781634fab0ae8146106eb5781638aee81271461069b5781638c21cd521461066c5781638da5cb5b14610643578163997664d714610624578163ab377daa146105e1578163ce7c2ac214610593578163d0e30db0146102b8578163e2d2e21914610299578163efca2eed1461027a578163f0fc6bca1461020c578163f2fde38b14610174578163f7c618c11461014b578163ffb2c4791461012b575063ffd49c841461010a57600080fd5b34610127578160031936011261012757602090600a549051908152f35b5080fd5b839034610127576020366003190112610127576101489035610d1d565b80f35b50503461012757816003193601126101275760015490516001600160a01b039091168152602090f35b9050346102085760203660031901126102085761018f610ada565b60035491906001600160a01b03906101aa3383861614610b3d565b169283156101c55750506001600160a01b0319161760035580f35b906020606492519162461bcd60e51b8352820152601960248201527f6e6577206f776e6572206973207a65726f2061646472657373000000000000006044820152fd5b8280fd5b9190503461020857826003193601126102085761022833610c99565b15610237578261014833610dea565b906020606492519162461bcd60e51b8352820152601760248201527f546f6f20736f6f6e2e204e65656420746f2077616974210000000000000000006044820152fd5b5050346101275781600319360112610127576020906007549051908152f35b5050346101275781600319360112610127576020906008549051908152f35b91905082600319360112610208576002546001600160a01b03906102df9082163314610bc1565b6001928160015416908351946370a0823160e01b93848752308388015260209360249285898581855afa9889156104b4578a99610560575b5087519167ffffffffffffffff91606084018381118582101761054e578a5260028452878401908a368337858d5416928d8c516315ab88c960e31b81528b818c81895afa9182156105435791610509575b508651156104f757871683528551600110156104e5578b860152823b156104e1578a5163b6f9de9560e01b81528881018e90526080888201529451608486018190528d938693909260a4850192865b8d8282106104be575050505050828091306044830152426064830152039134905af180156104b457610490575b505090839291600154169486519586938492835230908301525afa92831561048757508492610452575b8461044c61041c8686610c0d565b61042881600654610c30565b60065561044661043d60085492600954610cdb565b60055490610cee565b90610c30565b60085580f35b90809250813d8311610480575b6104698183610b89565b8101031261047b57518161041c61040e565b600080fd5b503d61045f565b513d86823e3d90fd5b81999299116104a35786529683386103e4565b50634e487b7160e01b815260418352fd5b88513d8c823e3d90fd5b9194839698508497508b839295511681520195019101928f9593928895936103b7565b8c80fd5b634e487b7160e01b8e5260328952878efd5b634e487b7160e01b8f5260328a52888ffd5b90508a81813d831161053c575b6105208183610b89565b81010312610538575187811681036105385738610368565b8e80fd5b503d610516565b8e51903d90823e3d90fd5b634e487b7160e01b8d5260418852868dfd5b9098508581813d831161058c575b6105788183610b89565b8101031261058857519738610317565b8980fd5b503d61056e565b5050346101275760203660031901126101275760609181906001600160a01b036105bb610ada565b168152600f60205220805491600260018301549201549181519384526020840152820152f35b8284346106215760203660031901126106215782359254831015610621575061060b602092610af0565b905491519160018060a01b039160031b1c168152f35b80fd5b5050346101275781600319360112610127576020906006549051908152f35b50503461012757816003193601126101275760035490516001600160a01b039091168152602090f35b5050346101275760203660031901126101275760209061069261068d610ada565b610c99565b90519015158152f35b8334610621576020366003190112610621576106b5610ada565b6003546001600160a01b0391906106cf9083163314610b3d565b166bffffffffffffffffffffffff60a01b600154161760015580f35b505034610127578160031936011261012757602090600b549051908152f35b5050346101275781600319360112610127576020906005549051908152f35b91905034610208573660031901126101275761075060018060a01b03600354163314610b3d565b35600a55602435600b5580f35b5050346101275760203660031901126101275760209061078361077e610ada565b610c3d565b9051908152f35b8383346101275780600319360112610127576107a4610ada565b906024359160018060a01b036107bf81600254163314610bc1565b80821693848652600f92602092848452858820546109e2575b82158015806109d1575b156108a15750508754868852600d845280868920556801000000000000000081101561088e579161084461087a926108268560019a9b9c8b61088398019055610af0565b90919060018060a01b038084549260031b9316831b921b1916179055565b6108638161085e6005548b8d52888852898d205490610c0d565b610c30565b60055587895284845280868a205560085490610cdb565b60095490610cee565b948652528320015580f35b634e487b7160e01b885260418952602488fd5b909150806109bf575b6108c2575b5060019495965061087a61088391610844565b8754600019908181019081116109ac576108de61091891610af0565b9054898b52600d8752846108f48a8d2054610af0565b92909360031b1c169060018060a01b038084549260031b9316831b921b1916179055565b868852600d8452858820548954828101908111610999576109398491610af0565b90549060031b1c168952600d8552868920558854801561098657916001979899610883949261087a94019161096d83610af0565b909182549160031b1b19169055559150879695506108af565b634e487b7160e01b895260318a52602489fd5b634e487b7160e01b8a5260118b5260248afd5b634e487b7160e01b895260118a52602489fd5b508587528383528487205415156108aa565b5087895285855286892054156107e2565b6109eb82610dea565b6107d8565b5050346101275781600319360112610127576020906009549051908152f35b9190503461020857806003193601126102085782808080610a2e610ada565b610a4360018060a01b03600354163314610b3d565b602435905af13d15610ad5573d67ffffffffffffffff8111610ac257825190610a76601f8201601f191660200183610b89565b81528460203d92013e5b15610a89578280f35b906020606492519162461bcd60e51b83528201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152fd5b634e487b7160e01b855260418452602485fd5b610a80565b600435906001600160a01b038216820361047b57565b600454811015610b275760046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0190600090565b634e487b7160e01b600052603260045260246000fd5b15610b4457565b60405162461bcd60e51b815260206004820152601860248201527f6f6e6c79206f776e65722063616e2063616c6c207468697300000000000000006044820152606490fd5b90601f8019910116810190811067ffffffffffffffff821117610bab57604052565b634e487b7160e01b600052604160045260246000fd5b15610bc857565b60405162461bcd60e51b815260206004820152601860248201527f6f6e6c7920746f6b656e2063616e2063616c6c207468697300000000000000006044820152606490fd5b91908203918211610c1a57565b634e487b7160e01b600052601160045260246000fd5b91908201809211610c1a57565b6001600160a01b03166000818152600f60205260408120549091908015610c945761087a610c6e9160085490610cdb565b908252600f60205260016040832001549081811115610c9457610c919250610c0d565b90565b505090565b6001600160a01b0381166000908152600e6020526040902054600a54610cbe91610c30565b42119081610cca575090565b610cd49150610c3d565b600b541090565b81810292918115918404141715610c1a57565b8115610cf8570490565b634e487b7160e01b600052601260045260246000fd5b6000198114610c1a5760010190565b906004548015610de55760009291839081905a5b85871080610ddc575b15610dd357610d91610d8a610da592600c99888b541015610dcb575b8a54610d6181610af0565b90546001600160a01b0391600391610d7d91831b1c8316610c99565b610dac575b505050610c30565b5a90610c0d565b935a97610d9e8154610d0e565b9055610d0e565b9295610d31565b610db8610dc393610af0565b9054911b1c16610dea565b388080610d82565b868b55610d56565b50945050505050565b50848410610d3a565b509050565b60018060a01b039081811691600090838252602090600f82526040938484205415610f5957610e1881610c3d565b9182610e28575b50505050505050565b610e3483600754610c30565b600755600154865163a9059cbb60e01b8682019081526001600160a01b03851660248301526044808301879052825292909116918591879190610e78606482610b89565b519082855af115610f4f5784513d610f465750803b155b610f2f575084516001600160a01b03919091168152602081018290526001949392600f929091610f1c9161087a91610f0391907fe34918ff1c7084970068b53fd71ad6d8b04e9f15d3886cbf006443e6cdc52ea690604090a1898752600e8552428888205585855260028888200154610c30565b8886528484528686209060028201555460085490610cdb565b9583525220015538808080808080610e1f565b602490865190635274afe760e01b82526004820152fd5b60011415610e8f565b85513d86823e3d90fd5b50505050505056fea26469706673582212201197fb472a9e04b4dcfd9f7134cf5f0b9f8688e871d3231409754778f37209bf64736f6c634300081900330000000000000000000000004b676606ab9ce8cf5bba8da31a55b653cfebeac30000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000b369daca21ee035312176eb8cf9d88ce97e0aa95
Deployed Bytecode
0x6040608081526004908136101561001557600080fd5b600091823560e01c9081630b94de9c14610a0f57816311ce023d146109f057816314b6ca961461078a57816328fd31981461075d5781632d48e896146107295781633a98ef391461070a5781634fab0ae8146106eb5781638aee81271461069b5781638c21cd521461066c5781638da5cb5b14610643578163997664d714610624578163ab377daa146105e1578163ce7c2ac214610593578163d0e30db0146102b8578163e2d2e21914610299578163efca2eed1461027a578163f0fc6bca1461020c578163f2fde38b14610174578163f7c618c11461014b578163ffb2c4791461012b575063ffd49c841461010a57600080fd5b34610127578160031936011261012757602090600a549051908152f35b5080fd5b839034610127576020366003190112610127576101489035610d1d565b80f35b50503461012757816003193601126101275760015490516001600160a01b039091168152602090f35b9050346102085760203660031901126102085761018f610ada565b60035491906001600160a01b03906101aa3383861614610b3d565b169283156101c55750506001600160a01b0319161760035580f35b906020606492519162461bcd60e51b8352820152601960248201527f6e6577206f776e6572206973207a65726f2061646472657373000000000000006044820152fd5b8280fd5b9190503461020857826003193601126102085761022833610c99565b15610237578261014833610dea565b906020606492519162461bcd60e51b8352820152601760248201527f546f6f20736f6f6e2e204e65656420746f2077616974210000000000000000006044820152fd5b5050346101275781600319360112610127576020906007549051908152f35b5050346101275781600319360112610127576020906008549051908152f35b91905082600319360112610208576002546001600160a01b03906102df9082163314610bc1565b6001928160015416908351946370a0823160e01b93848752308388015260209360249285898581855afa9889156104b4578a99610560575b5087519167ffffffffffffffff91606084018381118582101761054e578a5260028452878401908a368337858d5416928d8c516315ab88c960e31b81528b818c81895afa9182156105435791610509575b508651156104f757871683528551600110156104e5578b860152823b156104e1578a5163b6f9de9560e01b81528881018e90526080888201529451608486018190528d938693909260a4850192865b8d8282106104be575050505050828091306044830152426064830152039134905af180156104b457610490575b505090839291600154169486519586938492835230908301525afa92831561048757508492610452575b8461044c61041c8686610c0d565b61042881600654610c30565b60065561044661043d60085492600954610cdb565b60055490610cee565b90610c30565b60085580f35b90809250813d8311610480575b6104698183610b89565b8101031261047b57518161041c61040e565b600080fd5b503d61045f565b513d86823e3d90fd5b81999299116104a35786529683386103e4565b50634e487b7160e01b815260418352fd5b88513d8c823e3d90fd5b9194839698508497508b839295511681520195019101928f9593928895936103b7565b8c80fd5b634e487b7160e01b8e5260328952878efd5b634e487b7160e01b8f5260328a52888ffd5b90508a81813d831161053c575b6105208183610b89565b81010312610538575187811681036105385738610368565b8e80fd5b503d610516565b8e51903d90823e3d90fd5b634e487b7160e01b8d5260418852868dfd5b9098508581813d831161058c575b6105788183610b89565b8101031261058857519738610317565b8980fd5b503d61056e565b5050346101275760203660031901126101275760609181906001600160a01b036105bb610ada565b168152600f60205220805491600260018301549201549181519384526020840152820152f35b8284346106215760203660031901126106215782359254831015610621575061060b602092610af0565b905491519160018060a01b039160031b1c168152f35b80fd5b5050346101275781600319360112610127576020906006549051908152f35b50503461012757816003193601126101275760035490516001600160a01b039091168152602090f35b5050346101275760203660031901126101275760209061069261068d610ada565b610c99565b90519015158152f35b8334610621576020366003190112610621576106b5610ada565b6003546001600160a01b0391906106cf9083163314610b3d565b166bffffffffffffffffffffffff60a01b600154161760015580f35b505034610127578160031936011261012757602090600b549051908152f35b5050346101275781600319360112610127576020906005549051908152f35b91905034610208573660031901126101275761075060018060a01b03600354163314610b3d565b35600a55602435600b5580f35b5050346101275760203660031901126101275760209061078361077e610ada565b610c3d565b9051908152f35b8383346101275780600319360112610127576107a4610ada565b906024359160018060a01b036107bf81600254163314610bc1565b80821693848652600f92602092848452858820546109e2575b82158015806109d1575b156108a15750508754868852600d845280868920556801000000000000000081101561088e579161084461087a926108268560019a9b9c8b61088398019055610af0565b90919060018060a01b038084549260031b9316831b921b1916179055565b6108638161085e6005548b8d52888852898d205490610c0d565b610c30565b60055587895284845280868a205560085490610cdb565b60095490610cee565b948652528320015580f35b634e487b7160e01b885260418952602488fd5b909150806109bf575b6108c2575b5060019495965061087a61088391610844565b8754600019908181019081116109ac576108de61091891610af0565b9054898b52600d8752846108f48a8d2054610af0565b92909360031b1c169060018060a01b038084549260031b9316831b921b1916179055565b868852600d8452858820548954828101908111610999576109398491610af0565b90549060031b1c168952600d8552868920558854801561098657916001979899610883949261087a94019161096d83610af0565b909182549160031b1b19169055559150879695506108af565b634e487b7160e01b895260318a52602489fd5b634e487b7160e01b8a5260118b5260248afd5b634e487b7160e01b895260118a52602489fd5b508587528383528487205415156108aa565b5087895285855286892054156107e2565b6109eb82610dea565b6107d8565b5050346101275781600319360112610127576020906009549051908152f35b9190503461020857806003193601126102085782808080610a2e610ada565b610a4360018060a01b03600354163314610b3d565b602435905af13d15610ad5573d67ffffffffffffffff8111610ac257825190610a76601f8201601f191660200183610b89565b81528460203d92013e5b15610a89578280f35b906020606492519162461bcd60e51b83528201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152fd5b634e487b7160e01b855260418452602485fd5b610a80565b600435906001600160a01b038216820361047b57565b600454811015610b275760046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0190600090565b634e487b7160e01b600052603260045260246000fd5b15610b4457565b60405162461bcd60e51b815260206004820152601860248201527f6f6e6c79206f776e65722063616e2063616c6c207468697300000000000000006044820152606490fd5b90601f8019910116810190811067ffffffffffffffff821117610bab57604052565b634e487b7160e01b600052604160045260246000fd5b15610bc857565b60405162461bcd60e51b815260206004820152601860248201527f6f6e6c7920746f6b656e2063616e2063616c6c207468697300000000000000006044820152606490fd5b91908203918211610c1a57565b634e487b7160e01b600052601160045260246000fd5b91908201809211610c1a57565b6001600160a01b03166000818152600f60205260408120549091908015610c945761087a610c6e9160085490610cdb565b908252600f60205260016040832001549081811115610c9457610c919250610c0d565b90565b505090565b6001600160a01b0381166000908152600e6020526040902054600a54610cbe91610c30565b42119081610cca575090565b610cd49150610c3d565b600b541090565b81810292918115918404141715610c1a57565b8115610cf8570490565b634e487b7160e01b600052601260045260246000fd5b6000198114610c1a5760010190565b906004548015610de55760009291839081905a5b85871080610ddc575b15610dd357610d91610d8a610da592600c99888b541015610dcb575b8a54610d6181610af0565b90546001600160a01b0391600391610d7d91831b1c8316610c99565b610dac575b505050610c30565b5a90610c0d565b935a97610d9e8154610d0e565b9055610d0e565b9295610d31565b610db8610dc393610af0565b9054911b1c16610dea565b388080610d82565b868b55610d56565b50945050505050565b50848410610d3a565b509050565b60018060a01b039081811691600090838252602090600f82526040938484205415610f5957610e1881610c3d565b9182610e28575b50505050505050565b610e3483600754610c30565b600755600154865163a9059cbb60e01b8682019081526001600160a01b03851660248301526044808301879052825292909116918591879190610e78606482610b89565b519082855af115610f4f5784513d610f465750803b155b610f2f575084516001600160a01b03919091168152602081018290526001949392600f929091610f1c9161087a91610f0391907fe34918ff1c7084970068b53fd71ad6d8b04e9f15d3886cbf006443e6cdc52ea690604090a1898752600e8552428888205585855260028888200154610c30565b8886528484528686209060028201555460085490610cdb565b9583525220015538808080808080610e1f565b602490865190635274afe760e01b82526004820152fd5b60011415610e8f565b85513d86823e3d90fd5b50505050505056fea26469706673582212201197fb472a9e04b4dcfd9f7134cf5f0b9f8688e871d3231409754778f37209bf64736f6c63430008190033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004b676606ab9ce8cf5bba8da31a55b653cfebeac30000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000b369daca21ee035312176eb8cf9d88ce97e0aa95
-----Decoded View---------------
Arg [0] : _owner (address): 0x4b676606AB9Ce8cf5bbA8Da31A55B653CfEbEAC3
Arg [1] : _router (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Arg [2] : _rewardToken (address): 0xB369dACa21eE035312176Eb8Cf9d88ce97E0aA95
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000004b676606ab9ce8cf5bba8da31a55b653cfebeac3
Arg [1] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Arg [2] : 000000000000000000000000b369daca21ee035312176eb8cf9d88ce97e0aa95
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.