More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
MAHASplitKeeper
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 100 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {FeesSplitter} from "./FeesSplitter.sol"; import {KeeperCompatibleInterface} from "../interfaces/KeeperCompatibleInterface.sol"; import {Epoch} from "../utils/Epoch.sol"; interface ICommunityFund { function release(IERC20 token) external; function releasableAmount(IERC20 token) external view returns (uint256); } /** * This is a keeper contract that splits the maha from the ecosystem fund into the various treasuries on a * monthly basis via a keeper. */ contract MAHASplitKeeper is Epoch, FeesSplitter, KeeperCompatibleInterface { IERC20 public maha; ICommunityFund public communityFund; constructor( address[] memory _accounts, uint32[] memory _percentAllocations, IERC20 _maha, ICommunityFund _fund ) FeesSplitter(_accounts, _percentAllocations) Epoch(86400 * 30, block.timestamp, 0) { maha = _maha; communityFund = _fund; } function releaseAndDistributeMAHA() public { communityFund.release(maha); distributeERC20(maha); } function releasable() public view returns (uint256) { return communityFund.releasableAmount(maha); } function distributeMAHA() public { distributeERC20(maha); } function checkUpkeep(bytes calldata) external view override returns (bool upkeepNeeded, bytes memory performData) { return (_callable(), ""); } function performUpkeep(bytes calldata) external override checkEpoch { releaseAndDistributeMAHA(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface KeeperCompatibleInterface { /** * @notice method that is simulated by the keepers to see if any work actually * needs to be performed. This method does does not actually need to be * executable, and since it is only ever simulated it can consume lots of gas. * @dev To ensure that it is never called, you may want to add the * cannotExecute modifier from KeeperBase to your implementation of this * method. * @param checkData specified in the upkeep registration so it is always the * same for a registered upkeep. This can easily be broken down into specific * arguments using `abi.decode`, so multiple upkeeps can be registered on the * same contract and easily differentiated by the contract. * @return upkeepNeeded boolean to indicate whether the keeper should call * performUpkeep or not. * @return performData bytes that the keeper should call performUpkeep with, if * upkeep is needed. If you would like to encode data to decode later, try * `abi.encode`. */ function checkUpkeep(bytes calldata checkData) external returns (bool upkeepNeeded, bytes memory performData); /** * @notice method that is actually executed by the keepers, via the registry. * The data returned by the checkUpkeep simulation will be passed into * this method to actually be executed. * @dev The input to this method should not be trusted, and the caller of the * method should not even be restricted to any single registry. Anyone should * be able call it, and the input should be validated, there is no guarantee * that the data passed in is the performData returned from checkUpkeep. This * could happen due to malicious keepers, racing keepers, or simply a state * change while the performUpkeep transaction is waiting for confirmation. * Always validate the data passed in. * @param performData is the data which was passed back from the checkData * simulation. If it is encoded, it can easily be decoded into other types by * calling `abi.decode`. This data should not be trusted, and should be * validated against the contract's current state. */ function performUpkeep(bytes calldata performData) external; }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; contract FeesSplitter is Ownable { using SafeERC20 for IERC20; uint256 public constant PERCENTAGE_SCALE = 1e6; address[] public accounts; uint32[] public percentAllocations; constructor(address[] memory _accounts, uint32[] memory _percentAllocations) { accounts = _accounts; percentAllocations = _percentAllocations; checkPercentages(_percentAllocations); } fallback() external { distributeETH(); } receive() external payable { distributeETH(); } function distributeETH() public payable { uint256 amountToSplit = address(this).balance; // distribute remaining balance // overflow should be impossible in for-loop index // cache accounts length to save gas uint256 accountsLength = accounts.length; for (uint256 i = 0; i < accountsLength; ++i) { // overflow should be impossible with validated allocations uint256 amt = _scaleAmountByPercentage( amountToSplit, percentAllocations[i] ); payable(accounts[i]).transfer(amt); } } function distributeERC20(IERC20 token) public { uint256 amountToSplit = token.balanceOf(address(this)); uint256 accountsLength = accounts.length; for (uint256 i = 0; i < accountsLength; ++i) { // overflow should be impossible with validated allocations uint256 amt = _scaleAmountByPercentage( amountToSplit, percentAllocations[i] ); token.transfer(accounts[i], amt); } } function updateSplit( address[] memory _accounts, uint32[] memory _percentAllocations ) external onlyOwner { accounts = _accounts; percentAllocations = _percentAllocations; checkPercentages(_percentAllocations); } function checkPercentages(uint32[] memory _percentAllocations) public view onlyOwner { uint32 sum = 0; for (uint256 i = 0; i < _percentAllocations.length; i++) { sum += _percentAllocations[i]; } require(sum == PERCENTAGE_SCALE, "invalid percentages"); } function withdrawETH() external onlyOwner { payable(owner()).transfer(address(this).balance); } function withdrawERC20(IERC20 token) external onlyOwner { token.transfer(owner(), token.balanceOf(address(this))); } function _scaleAmountByPercentage(uint256 amount, uint256 scaledPercent) internal pure returns (uint256 scaledAmount) { // use assembly to bypass checking for overflow & division by 0 // scaledPercent has been validated to be < PERCENTAGE_SCALE) // & PERCENTAGE_SCALE will never be 0 // pernicious ERC20s may cause overflow, but results do not affect ETH & other ERC20 balances assembly { /* eg (100 * 2*1e4) / (1e6) */ scaledAmount := div(mul(amount, scaledPercent), PERCENTAGE_SCALE) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IEpoch} from "../interfaces/IEpoch.sol"; contract Epoch is IEpoch, Ownable { using SafeMath for uint256; uint256 private period; uint256 private startTime; uint256 private lastExecutedAt; /* ========== CONSTRUCTOR ========== */ constructor( uint256 _period, uint256 _startTime, uint256 _startEpoch ) { period = _period; startTime = _startTime; lastExecutedAt = startTime.add(_startEpoch.mul(period)); } /* ========== Modifier ========== */ modifier checkStartTime() { require(block.timestamp >= startTime, "Epoch: not started yet"); _; } modifier checkEpoch() { require(block.timestamp > startTime, "Epoch: not started yet"); require(_callable(), "Epoch: not allowed"); _; lastExecutedAt = block.timestamp; } function _getLastEpoch() internal view returns (uint256) { return lastExecutedAt.sub(startTime).div(period); } function _getCurrentEpoch() internal view returns (uint256) { return Math.max(startTime, block.timestamp).sub(startTime).div(period); } function callable() external view override returns (bool) { return _callable(); } function _callable() internal view returns (bool) { return _getCurrentEpoch() >= _getNextEpoch(); } function _getNextEpoch() internal view returns (uint256) { if (startTime == lastExecutedAt) { return _getLastEpoch(); } return _getLastEpoch().add(1); } // epoch function getLastEpoch() external view override returns (uint256) { return _getLastEpoch(); } function getCurrentEpoch() external view override returns (uint256) { return Math.max(startTime, block.timestamp).sub(startTime).div(period); } function getNextEpoch() external view override returns (uint256) { return _getNextEpoch(); } function nextEpochPoint() external view override returns (uint256) { return startTime.add(_getNextEpoch().mul(period)); } // params function getPeriod() external view override returns (uint256) { return period; } function getStartTime() external view override returns (uint256) { return startTime; } /* ========== GOVERNANCE ========== */ function setPeriod(uint256 _period) external onlyOwner { period = _period; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 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 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/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() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { 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 { _transferOwnership(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"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) 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 // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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 amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` 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 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IEpoch { function callable() external view returns (bool); function getLastEpoch() external view returns (uint256); function getCurrentEpoch() external view returns (uint256); function getNextEpoch() external view returns (uint256); function nextEpochPoint() external view returns (uint256); function getPeriod() external view returns (uint256); function getStartTime() external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. It the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. // We also know that `k`, the position of the most significant bit, is such that `msb(a) = 2**k`. // This gives `2**k < a <= 2**(k+1)` → `2**(k/2) <= sqrt(a) < 2 ** (k/2+1)`. // Using an algorithm similar to the msb conmputation, we are able to compute `result = 2**(k/2)` which is a // good first aproximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1; uint256 x = a; if (x >> 128 > 0) { x >>= 128; result <<= 64; } if (x >> 64 > 0) { x >>= 64; result <<= 32; } if (x >> 32 > 0) { x >>= 32; result <<= 16; } if (x >> 16 > 0) { x >>= 16; result <<= 8; } if (x >> 8 > 0) { x >>= 8; result <<= 4; } if (x >> 4 > 0) { x >>= 4; result <<= 2; } if (x >> 2 > 0) { result <<= 1; } // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { uint256 result = sqrt(a); if (rounding == Rounding.Up && result * result < a) { result += 1; } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // 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 (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @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) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @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) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting 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 a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting 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) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * 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) { unchecked { require(b > 0, errorMessage); return a % b; } } }
{ "optimizer": { "enabled": true, "runs": 100 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"uint32[]","name":"_percentAllocations","type":"uint32[]"},{"internalType":"contract IERC20","name":"_maha","type":"address"},{"internalType":"contract ICommunityFund","name":"_fund","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[],"name":"PERCENTAGE_SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"accounts","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"callable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_percentAllocations","type":"uint32[]"}],"name":"checkPercentages","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"checkUpkeep","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"performData","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"communityFund","outputs":[{"internalType":"contract ICommunityFund","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"distributeERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributeETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"distributeMAHA","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCurrentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maha","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextEpochPoint","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":"","type":"uint256"}],"name":"percentAllocations","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"performUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"releaseAndDistributeMAHA","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"setPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"uint32[]","name":"_percentAllocations","type":"uint32[]"}],"name":"updateSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620019ec380380620019ec83398101604081905262000034916200045a565b838362278d004260006200004833620000f9565b60018390556002829055620000856200006e828562000149602090811b62000ca817901c565b6002546200015e60201b62000cbb1790919060201c565b60035550508251620000a09150600490602085019062000292565b508051620000b6906005906020840190620002fc565b50620000c2816200016c565b5050600680546001600160a01b039384166001600160a01b0319918216179091556007805492909316911617905550620006769050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000620001578284620005f1565b9392505050565b6000620001578284620005ab565b6200017662000234565b6000805b8251811015620001d157828181518110620001a557634e487b7160e01b600052603260045260246000fd5b602002602001015182620001ba9190620005c6565b915080620001c88162000613565b9150506200017a565b50620f42408163ffffffff1614620002305760405162461bcd60e51b815260206004820152601360248201527f696e76616c69642070657263656e74616765730000000000000000000000000060448201526064015b60405180910390fd5b5050565b6000546001600160a01b03163314620002905760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000227565b565b828054828255906000526020600020908101928215620002ea579160200282015b82811115620002ea57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620002b3565b50620002f8929150620003a8565b5090565b82805482825590600052602060002090600701600890048101928215620002ea5791602002820160005b838211156200036c57835183826101000a81548163ffffffff021916908363ffffffff160217905550926020019260040160208160030104928301926001030262000326565b80156200039e5782816101000a81549063ffffffff02191690556004016020816003010492830192600103026200036c565b5050620002f89291505b5b80821115620002f85760008155600101620003a9565b600082601f830112620003d0578081fd5b81516020620003e9620003e38362000585565b62000552565b80838252828201915082860187848660051b890101111562000409578586fd5b855b858110156200043b57815163ffffffff8116811462000428578788fd5b845292840192908401906001016200040b565b5090979650505050505050565b805162000455816200065d565b919050565b6000806000806080858703121562000470578384fd5b84516001600160401b038082111562000487578586fd5b818701915087601f8301126200049b578586fd5b81516020620004ae620003e38362000585565b8083825282820191508286018c848660051b8901011115620004ce578a8bfd5b8a96505b84871015620004fd578051620004e8816200065d565b835260019690960195918301918301620004d2565b50918a015191985090935050508082111562000517578485fd5b506200052687828801620003bf565b935050620005376040860162000448565b9150620005476060860162000448565b905092959194509250565b604051601f8201601f191681016001600160401b03811182821017156200057d576200057d62000647565b604052919050565b60006001600160401b03821115620005a157620005a162000647565b5060051b60200190565b60008219821115620005c157620005c162000631565b500190565b600063ffffffff808316818516808303821115620005e857620005e862000631565b01949350505050565b60008160001904831182151516156200060e576200060e62000631565b500290565b60006000198214156200062a576200062a62000631565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146200067357600080fd5b50565b61136680620006866000396000f3fe60806040526004361061016e5760003560e01c80638da5cb5b116100cc578063e086e5ec1161007a578063e086e5ec146103e6578063efe97d05146103fb578063f2a40db814610410578063f2fde38b14610430578063f46b65ac14610450578063f4f3b20014610465578063fbccedae146104855761017d565b80638da5cb5b14610341578063b8b9b5491461035f578063b97dd9e214610367578063bce582691461037c578063c45ff5441461039c578063c5967c26146103bc578063c828371e146103d15761017d565b80633f26479e116101295780633f26479e1461026d57806344def48f146102845780634585e33b146102a45780635c45f349146102c45780636a2ab602146102d95780636e04ff0d146102fe578063715018a61461032c5761017d565b80623f619d14610192578062f380f4146101cc5780630f3a9f65146101f95780631ed2419514610219578063398bac63146102385780633de00c361461024d5761017d565b3661017d5761017b61049a565b005b34801561018957600080fd5b5061017b61049a565b34801561019e57600080fd5b506101b26101ad366004611148565b61057c565b60405163ffffffff90911681526020015b60405180910390f35b3480156101d857600080fd5b506007546101ec906001600160a01b031681565b6040516101c39190611178565b34801561020557600080fd5b5061017b610214366004611148565b6105b6565b34801561022557600080fd5b506001545b6040519081526020016101c3565b34801561024457600080fd5b5061022a6105c3565b34801561025957600080fd5b506006546101ec906001600160a01b031681565b34801561027957600080fd5b5061022a620f424081565b34801561029057600080fd5b5061017b61029f366004610fbd565b6105d2565b3480156102b057600080fd5b5061017b6102bf3660046110db565b61060f565b3480156102d057600080fd5b5061017b6106b7565b3480156102e557600080fd5b506102ee6106ce565b60405190151581526020016101c3565b34801561030a57600080fd5b5061031e6103193660046110db565b6106d8565b6040516101c392919061118c565b34801561033857600080fd5b5061017b6106ff565b34801561034d57600080fd5b506000546001600160a01b03166101ec565b61017b61049a565b34801561037357600080fd5b5061022a610711565b34801561038857600080fd5b5061017b610397366004610fa1565b610737565b3480156103a857600080fd5b5061017b6103b7366004611080565b6108c5565b3480156103c857600080fd5b5061022a610970565b3480156103dd57600080fd5b5060025461022a565b3480156103f257600080fd5b5061017b610992565b34801561040757600080fd5b5061022a6109d7565b34801561041c57600080fd5b506101ec61042b366004611148565b6109e1565b34801561043c57600080fd5b5061017b61044b366004610fa1565b610a0b565b34801561045c57600080fd5b5061017b610a81565b34801561047157600080fd5b5061017b610480366004610fa1565b610afd565b34801561049157600080fd5b5061022a610c20565b600454479060005b8181101561057757600061050184600584815481106104d157634e487b7160e01b600052603260045260246000fd5b60009182526020909120600882040154620f424060079092166004026101000a900463ffffffff16919091020490565b90506004828154811061052457634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516001600160a01b039091169183156108fc02918491818181858888f19350505050158015610564573d6000803e3d6000fd5b505080610570906112d4565b90506104a2565b505050565b6005818154811061058c57600080fd5b9060005260206000209060089182820401919006600402915054906101000a900463ffffffff1681565b6105be610cc7565b600155565b60006105cd610d21565b905090565b6105da610cc7565b81516105ed906004906020850190610e01565b508051610601906005906020840190610e66565b5061060b816108c5565b5050565b600254421161065e5760405162461bcd60e51b8152602060048201526016602482015275115c1bd8da0e881b9bdd081cdd185c9d1959081e595d60521b60448201526064015b60405180910390fd5b610666610d40565b6106a75760405162461bcd60e51b8152602060048201526012602482015271115c1bd8da0e881b9bdd08185b1b1bddd95960721b6044820152606401610655565b6106af610a81565b505042600355565b6006546106cc906001600160a01b0316610737565b565b60006105cd610d40565b600060606106e4610d40565b60405180602001604052806000815250915091509250929050565b610707610cc7565b6106cc6000610d59565b60006105cd60015461073160025461072b60025442610da9565b90610dc0565b90610dcc565b6040516370a0823160e01b81526000906001600160a01b038316906370a0823190610766903090600401611178565b60206040518083038186803b15801561077e57600080fd5b505afa158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190611160565b60045490915060005b818110156108bf5760006107ee84600584815481106104d157634e487b7160e01b600052603260045260246000fd5b9050846001600160a01b031663a9059cbb6004848154811061082057634e487b7160e01b600052603260045260246000fd5b60009182526020909120015460405160e083901b6001600160e01b03191681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b15801561087457600080fd5b505af1158015610888573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ac91906110bb565b5050806108b8906112d4565b90506107bf565b50505050565b6108cd610cc7565b6000805b8251811015610921578281815181106108fa57634e487b7160e01b600052603260045260246000fd5b60200260200101518261090d9190611256565b915080610919816112d4565b9150506108d1565b50620f42408163ffffffff161461060b5760405162461bcd60e51b8152602060048201526013602482015272696e76616c69642070657263656e746167657360681b6044820152606401610655565b60006105cd610989600154610983610dd8565b90610ca8565b60025490610cbb565b61099a610cc7565b600080546040516001600160a01b03909116914780156108fc02929091818181858888f193505050501580156109d4573d6000803e3d6000fd5b50565b60006105cd610dd8565b600481815481106109f157600080fd5b6000918252602090912001546001600160a01b0316905081565b610a13610cc7565b6001600160a01b038116610a785760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610655565b6109d481610d59565b600754600654604051631916558760e01b81526001600160a01b0392831692631916558792610ab592911690600401611178565b600060405180830381600087803b158015610acf57600080fd5b505af1158015610ae3573d6000803e3d6000fd5b50506006546106cc92506001600160a01b03169050610737565b610b05610cc7565b806001600160a01b031663a9059cbb610b266000546001600160a01b031690565b6040516370a0823160e01b81526001600160a01b038516906370a0823190610b52903090600401611178565b60206040518083038186803b158015610b6a57600080fd5b505afa158015610b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba29190611160565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610be857600080fd5b505af1158015610bfc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060b91906110bb565b6007546006546040516302e4d97960e31b81526000926001600160a01b0390811692631726cbc892610c589290911690600401611178565b60206040518083038186803b158015610c7057600080fd5b505afa158015610c84573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cd9190611160565b6000610cb4828461129e565b9392505050565b6000610cb4828461123e565b6000546001600160a01b031633146106cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610655565b60006105cd600154610731600254600354610dc090919063ffffffff16565b6000610d4a610dd8565b610d52610711565b1015905090565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081831015610db95781610cb4565b5090919050565b6000610cb482846112bd565b6000610cb4828461127e565b60006003546002541415610dee576105cd610d21565b6105cd6001610dfb610d21565b90610cbb565b828054828255906000526020600020908101928215610e56579160200282015b82811115610e5657825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190610e21565b50610e62929150610f0c565b5090565b82805482825590600052602060002090600701600890048101928215610e565791602002820160005b83821115610ed357835183826101000a81548163ffffffff021916908363ffffffff1602179055509260200192600401602081600301049283019260010302610e8f565b8015610f035782816101000a81549063ffffffff0219169055600401602081600301049283019260010302610ed3565b5050610e629291505b5b80821115610e625760008155600101610f0d565b600082601f830112610f31578081fd5b81356020610f46610f418361121a565b6111e9565b80838252828201915082860187848660051b8901011115610f65578586fd5b855b85811015610f9457813563ffffffff81168114610f82578788fd5b84529284019290840190600101610f67565b5090979650505050505050565b600060208284031215610fb2578081fd5b8135610cb48161131b565b60008060408385031215610fcf578081fd5b823567ffffffffffffffff80821115610fe6578283fd5b818501915085601f830112610ff9578283fd5b81356020611009610f418361121a565b8083825282820191508286018a848660051b8901011115611028578788fd5b8796505b8487101561105357803561103f8161131b565b83526001969096019591830191830161102c565b5096505086013592505080821115611069578283fd5b5061107685828601610f21565b9150509250929050565b600060208284031215611091578081fd5b813567ffffffffffffffff8111156110a7578182fd5b6110b384828501610f21565b949350505050565b6000602082840312156110cc578081fd5b81518015158114610cb4578182fd5b600080602083850312156110ed578182fd5b823567ffffffffffffffff80821115611104578384fd5b818501915085601f830112611117578384fd5b813581811115611125578485fd5b866020828501011115611136578485fd5b60209290920196919550909350505050565b600060208284031215611159578081fd5b5035919050565b600060208284031215611171578081fd5b5051919050565b6001600160a01b0391909116815260200190565b8215158152600060206040818401528351806040850152825b818110156111c1578581018301518582016060015282016111a5565b818111156111d25783606083870101525b50601f01601f191692909201606001949350505050565b604051601f8201601f1916810167ffffffffffffffff8111828210171561121257611212611305565b604052919050565b600067ffffffffffffffff82111561123457611234611305565b5060051b60200190565b60008219821115611251576112516112ef565b500190565b600063ffffffff808316818516808303821115611275576112756112ef565b01949350505050565b60008261129957634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156112b8576112b86112ef565b500290565b6000828210156112cf576112cf6112ef565b500390565b60006000198214156112e8576112e86112ef565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146109d457600080fdfea2646970667358221220b2a77702d22fc6fa02adab4365397a90b9da61ebe8adcdde7bde2d151c533e0e64736f6c63430008040033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000b4d930279552397bba2ee473229f89ec245bc365000000000000000000000000ff3731bd6f44e49831eacc30388506e6bce4f49e00000000000000000000000000000000000000000000000000000000000000020000000000000000000000006357edbfe5ada570005ceb8fad3139ef5a8863cc0000000000000000000000004723babf3e761f41e298cb034fd387d2e27ac9d7000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000c35000000000000000000000000000000000000000000000000000000000000030d40
Deployed Bytecode
0x60806040526004361061016e5760003560e01c80638da5cb5b116100cc578063e086e5ec1161007a578063e086e5ec146103e6578063efe97d05146103fb578063f2a40db814610410578063f2fde38b14610430578063f46b65ac14610450578063f4f3b20014610465578063fbccedae146104855761017d565b80638da5cb5b14610341578063b8b9b5491461035f578063b97dd9e214610367578063bce582691461037c578063c45ff5441461039c578063c5967c26146103bc578063c828371e146103d15761017d565b80633f26479e116101295780633f26479e1461026d57806344def48f146102845780634585e33b146102a45780635c45f349146102c45780636a2ab602146102d95780636e04ff0d146102fe578063715018a61461032c5761017d565b80623f619d14610192578062f380f4146101cc5780630f3a9f65146101f95780631ed2419514610219578063398bac63146102385780633de00c361461024d5761017d565b3661017d5761017b61049a565b005b34801561018957600080fd5b5061017b61049a565b34801561019e57600080fd5b506101b26101ad366004611148565b61057c565b60405163ffffffff90911681526020015b60405180910390f35b3480156101d857600080fd5b506007546101ec906001600160a01b031681565b6040516101c39190611178565b34801561020557600080fd5b5061017b610214366004611148565b6105b6565b34801561022557600080fd5b506001545b6040519081526020016101c3565b34801561024457600080fd5b5061022a6105c3565b34801561025957600080fd5b506006546101ec906001600160a01b031681565b34801561027957600080fd5b5061022a620f424081565b34801561029057600080fd5b5061017b61029f366004610fbd565b6105d2565b3480156102b057600080fd5b5061017b6102bf3660046110db565b61060f565b3480156102d057600080fd5b5061017b6106b7565b3480156102e557600080fd5b506102ee6106ce565b60405190151581526020016101c3565b34801561030a57600080fd5b5061031e6103193660046110db565b6106d8565b6040516101c392919061118c565b34801561033857600080fd5b5061017b6106ff565b34801561034d57600080fd5b506000546001600160a01b03166101ec565b61017b61049a565b34801561037357600080fd5b5061022a610711565b34801561038857600080fd5b5061017b610397366004610fa1565b610737565b3480156103a857600080fd5b5061017b6103b7366004611080565b6108c5565b3480156103c857600080fd5b5061022a610970565b3480156103dd57600080fd5b5060025461022a565b3480156103f257600080fd5b5061017b610992565b34801561040757600080fd5b5061022a6109d7565b34801561041c57600080fd5b506101ec61042b366004611148565b6109e1565b34801561043c57600080fd5b5061017b61044b366004610fa1565b610a0b565b34801561045c57600080fd5b5061017b610a81565b34801561047157600080fd5b5061017b610480366004610fa1565b610afd565b34801561049157600080fd5b5061022a610c20565b600454479060005b8181101561057757600061050184600584815481106104d157634e487b7160e01b600052603260045260246000fd5b60009182526020909120600882040154620f424060079092166004026101000a900463ffffffff16919091020490565b90506004828154811061052457634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516001600160a01b039091169183156108fc02918491818181858888f19350505050158015610564573d6000803e3d6000fd5b505080610570906112d4565b90506104a2565b505050565b6005818154811061058c57600080fd5b9060005260206000209060089182820401919006600402915054906101000a900463ffffffff1681565b6105be610cc7565b600155565b60006105cd610d21565b905090565b6105da610cc7565b81516105ed906004906020850190610e01565b508051610601906005906020840190610e66565b5061060b816108c5565b5050565b600254421161065e5760405162461bcd60e51b8152602060048201526016602482015275115c1bd8da0e881b9bdd081cdd185c9d1959081e595d60521b60448201526064015b60405180910390fd5b610666610d40565b6106a75760405162461bcd60e51b8152602060048201526012602482015271115c1bd8da0e881b9bdd08185b1b1bddd95960721b6044820152606401610655565b6106af610a81565b505042600355565b6006546106cc906001600160a01b0316610737565b565b60006105cd610d40565b600060606106e4610d40565b60405180602001604052806000815250915091509250929050565b610707610cc7565b6106cc6000610d59565b60006105cd60015461073160025461072b60025442610da9565b90610dc0565b90610dcc565b6040516370a0823160e01b81526000906001600160a01b038316906370a0823190610766903090600401611178565b60206040518083038186803b15801561077e57600080fd5b505afa158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190611160565b60045490915060005b818110156108bf5760006107ee84600584815481106104d157634e487b7160e01b600052603260045260246000fd5b9050846001600160a01b031663a9059cbb6004848154811061082057634e487b7160e01b600052603260045260246000fd5b60009182526020909120015460405160e083901b6001600160e01b03191681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b15801561087457600080fd5b505af1158015610888573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ac91906110bb565b5050806108b8906112d4565b90506107bf565b50505050565b6108cd610cc7565b6000805b8251811015610921578281815181106108fa57634e487b7160e01b600052603260045260246000fd5b60200260200101518261090d9190611256565b915080610919816112d4565b9150506108d1565b50620f42408163ffffffff161461060b5760405162461bcd60e51b8152602060048201526013602482015272696e76616c69642070657263656e746167657360681b6044820152606401610655565b60006105cd610989600154610983610dd8565b90610ca8565b60025490610cbb565b61099a610cc7565b600080546040516001600160a01b03909116914780156108fc02929091818181858888f193505050501580156109d4573d6000803e3d6000fd5b50565b60006105cd610dd8565b600481815481106109f157600080fd5b6000918252602090912001546001600160a01b0316905081565b610a13610cc7565b6001600160a01b038116610a785760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610655565b6109d481610d59565b600754600654604051631916558760e01b81526001600160a01b0392831692631916558792610ab592911690600401611178565b600060405180830381600087803b158015610acf57600080fd5b505af1158015610ae3573d6000803e3d6000fd5b50506006546106cc92506001600160a01b03169050610737565b610b05610cc7565b806001600160a01b031663a9059cbb610b266000546001600160a01b031690565b6040516370a0823160e01b81526001600160a01b038516906370a0823190610b52903090600401611178565b60206040518083038186803b158015610b6a57600080fd5b505afa158015610b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba29190611160565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610be857600080fd5b505af1158015610bfc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060b91906110bb565b6007546006546040516302e4d97960e31b81526000926001600160a01b0390811692631726cbc892610c589290911690600401611178565b60206040518083038186803b158015610c7057600080fd5b505afa158015610c84573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cd9190611160565b6000610cb4828461129e565b9392505050565b6000610cb4828461123e565b6000546001600160a01b031633146106cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610655565b60006105cd600154610731600254600354610dc090919063ffffffff16565b6000610d4a610dd8565b610d52610711565b1015905090565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081831015610db95781610cb4565b5090919050565b6000610cb482846112bd565b6000610cb4828461127e565b60006003546002541415610dee576105cd610d21565b6105cd6001610dfb610d21565b90610cbb565b828054828255906000526020600020908101928215610e56579160200282015b82811115610e5657825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190610e21565b50610e62929150610f0c565b5090565b82805482825590600052602060002090600701600890048101928215610e565791602002820160005b83821115610ed357835183826101000a81548163ffffffff021916908363ffffffff1602179055509260200192600401602081600301049283019260010302610e8f565b8015610f035782816101000a81549063ffffffff0219169055600401602081600301049283019260010302610ed3565b5050610e629291505b5b80821115610e625760008155600101610f0d565b600082601f830112610f31578081fd5b81356020610f46610f418361121a565b6111e9565b80838252828201915082860187848660051b8901011115610f65578586fd5b855b85811015610f9457813563ffffffff81168114610f82578788fd5b84529284019290840190600101610f67565b5090979650505050505050565b600060208284031215610fb2578081fd5b8135610cb48161131b565b60008060408385031215610fcf578081fd5b823567ffffffffffffffff80821115610fe6578283fd5b818501915085601f830112610ff9578283fd5b81356020611009610f418361121a565b8083825282820191508286018a848660051b8901011115611028578788fd5b8796505b8487101561105357803561103f8161131b565b83526001969096019591830191830161102c565b5096505086013592505080821115611069578283fd5b5061107685828601610f21565b9150509250929050565b600060208284031215611091578081fd5b813567ffffffffffffffff8111156110a7578182fd5b6110b384828501610f21565b949350505050565b6000602082840312156110cc578081fd5b81518015158114610cb4578182fd5b600080602083850312156110ed578182fd5b823567ffffffffffffffff80821115611104578384fd5b818501915085601f830112611117578384fd5b813581811115611125578485fd5b866020828501011115611136578485fd5b60209290920196919550909350505050565b600060208284031215611159578081fd5b5035919050565b600060208284031215611171578081fd5b5051919050565b6001600160a01b0391909116815260200190565b8215158152600060206040818401528351806040850152825b818110156111c1578581018301518582016060015282016111a5565b818111156111d25783606083870101525b50601f01601f191692909201606001949350505050565b604051601f8201601f1916810167ffffffffffffffff8111828210171561121257611212611305565b604052919050565b600067ffffffffffffffff82111561123457611234611305565b5060051b60200190565b60008219821115611251576112516112ef565b500190565b600063ffffffff808316818516808303821115611275576112756112ef565b01949350505050565b60008261129957634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156112b8576112b86112ef565b500290565b6000828210156112cf576112cf6112ef565b500390565b60006000198214156112e8576112e86112ef565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146109d457600080fdfea2646970667358221220b2a77702d22fc6fa02adab4365397a90b9da61ebe8adcdde7bde2d151c533e0e64736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000b4d930279552397bba2ee473229f89ec245bc365000000000000000000000000ff3731bd6f44e49831eacc30388506e6bce4f49e00000000000000000000000000000000000000000000000000000000000000020000000000000000000000006357edbfe5ada570005ceb8fad3139ef5a8863cc0000000000000000000000004723babf3e761f41e298cb034fd387d2e27ac9d7000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000c35000000000000000000000000000000000000000000000000000000000000030d40
-----Decoded View---------------
Arg [0] : _accounts (address[]): 0x6357EDbfE5aDA570005ceB8FAd3139eF5A8863CC,0x4723babf3E761f41E298cB034FD387D2e27ac9d7
Arg [1] : _percentAllocations (uint32[]): 800000,200000
Arg [2] : _maha (address): 0xB4d930279552397bbA2ee473229f89Ec245bc365
Arg [3] : _fund (address): 0xFF3731BD6F44E49831eaCc30388506e6bcE4F49e
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 000000000000000000000000b4d930279552397bba2ee473229f89ec245bc365
Arg [3] : 000000000000000000000000ff3731bd6f44e49831eacc30388506e6bce4f49e
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [5] : 0000000000000000000000006357edbfe5ada570005ceb8fad3139ef5a8863cc
Arg [6] : 0000000000000000000000004723babf3e761f41e298cb034fd387d2e27ac9d7
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [8] : 00000000000000000000000000000000000000000000000000000000000c3500
Arg [9] : 0000000000000000000000000000000000000000000000000000000000030d40
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.