Overview
POL Balance
0 POL
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 5 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
52747335 | 314 days ago | Contract Creation | 0 POL | |||
52100973 | 331 days ago | Contract Creation | 0 POL | |||
52100945 | 331 days ago | Contract Creation | 0 POL | |||
52100618 | 331 days ago | Contract Creation | 0 POL | |||
44670492 | 520 days ago | Contract Creation | 0 POL |
Loading...
Loading
Contract Name:
ERC20LinearRewardModuleFactory
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/* ERC20LinearRewardModuleFactory https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.18; import "./interfaces/IModuleFactory.sol"; import "./ERC20LinearRewardModule.sol"; /** * @title ERC20 linear reward module factory * * @notice this factory contract handles deployment for the * ERC20LinearRewardModule contract * * @dev it is called by the parent PoolFactory and is responsible * for parsing constructor arguments before creating a new contract */ contract ERC20LinearRewardModuleFactory is IModuleFactory { /** * @inheritdoc IModuleFactory */ function createModule( address config, bytes calldata data ) external override returns (address) { // validate require(data.length == 96, "lrmf1"); // parse constructor arguments address token; uint256 period; uint256 rate; assembly { token := calldataload(100) period := calldataload(132) rate := calldataload(164) } // create module ERC20LinearRewardModule module = new ERC20LinearRewardModule( token, period, rate, config, address(this) ); module.transferOwnership(msg.sender); // output emit ModuleCreated(msg.sender, address(module)); return address(module); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// 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.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 (last updated v4.8.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.8.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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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); } } }
/* ERC20LinearRewardModule https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.18; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./interfaces/IRewardModule.sol"; import "./interfaces/IConfiguration.sol"; import "./OwnerController.sol"; import "./TokenUtils.sol"; /** * @title ERC20 linear reward module * * @notice this reward module distributes a single ERC20 token at a continuous fixed rate. * * @dev the linear reward module provides a guarantee that a constant reward rate * will be earned over a specified time period. This can be used to create * incentive mechanisms such as streaming payroll, equity vesting, fixed rate * yield farms, and more. */ contract ERC20LinearRewardModule is IRewardModule, ReentrancyGuard, OwnerController { using SafeERC20 for IERC20; using TokenUtils for IERC20; // user position struct Position { uint256 shares; uint256 timestamp; uint256 earned; } // configuration fields uint256 public immutable period; uint256 public immutable rate; IERC20 private immutable _token; address private immutable _factory; IConfiguration private immutable _config; // state fields mapping(bytes32 => Position) public positions; uint256 public stakingShares; uint256 public rewardShares; uint256 public elapsed; // seconds uint256 public earned; // shares uint256 public lastUpdated; /** * @param token_ the token that will be rewarded * @param period_ time period (seconds) * @param rate_ constant reward rate (shares / share second) * @param config_ address for configuration contract * @param factory_ address of module factory */ constructor( address token_, uint256 period_, uint256 rate_, address config_, address factory_ ) { require(token_ != address(0)); require(period_ > 0, "lrm1"); require(rate_ > 0, "lrm2"); _token = IERC20(token_); _config = IConfiguration(config_); _factory = factory_; period = period_; rate = rate_; lastUpdated = block.timestamp; } // -- IRewardModule ------------------------------------------------------- /** * @inheritdoc IRewardModule */ function tokens() external view override returns (address[] memory tokens_) { tokens_ = new address[](1); tokens_[0] = address(_token); } /** * @inheritdoc IRewardModule */ function balances() external view override returns (uint256[] memory balances_) { balances_ = new uint256[](1); if (rewardShares > 0) { balances_[0] = _token.getAmount( rewardShares, rewardShares - earned ); } } /** * @inheritdoc IRewardModule */ function usage() external pure override returns (uint256) { return 0; } /** * @inheritdoc IRewardModule */ function factory() external view override returns (address) { return _factory; } /** * @inheritdoc IRewardModule */ function stake( bytes32 account, address, uint256 shares, bytes calldata ) external override onlyOwner returns (uint256, uint256) { _update(); uint256 ss = stakingShares + shares; require((ss * rate * period) / 1e18 < rewardShares - earned, "lrm3"); Position storage pos = positions[account]; uint256 s = pos.shares; if (s > 0) { pos.earned += (s * rate * (elapsed - pos.timestamp)) / 1e18; } pos.shares = s + shares; pos.timestamp = elapsed; stakingShares = ss; return (0, 0); } /** * @inheritdoc IRewardModule */ function unstake( bytes32 account, address, address receiver, uint256 shares, bytes calldata ) external override onlyOwner returns (uint256, uint256) { _update(); Position storage pos = positions[account]; uint256 s = pos.shares; assert(shares <= s); // note: we assume shares has been validated upstream // get all pending rewards uint256 r = pos.earned + (s * rate * (elapsed - pos.timestamp)) / 1e18; // update user position if (shares < s) { pos.shares -= shares; pos.timestamp = elapsed; pos.earned = 0; } else { delete positions[account]; } stakingShares -= shares; // distribute rewards if (r > 0) { _distribute(receiver, r); } return (0, 0); } /** * @inheritdoc IRewardModule */ function claim( bytes32 account, address, address receiver, uint256, bytes calldata ) external override onlyOwner returns (uint256, uint256) { _update(); Position storage pos = positions[account]; // get all pending rewards uint256 r = pos.earned + (pos.shares * rate * (elapsed - pos.timestamp)) / 1e18; // reset user position pos.earned = 0; pos.timestamp = elapsed; // distribute rewards if (r > 0) { _distribute(receiver, r); } return (0, 0); } /** * @inheritdoc IRewardModule */ function update(bytes32, address, bytes calldata) external override { requireOwner(); _update(); } /** * @inheritdoc IRewardModule */ function clean(bytes calldata) external override { requireOwner(); _update(); } // -- ERC20LinearRewardModule ---------------------------------------- /** * @notice fund module by depositing reward tokens * @dev this is a public method callable by any account or contract * @param amount number of reward tokens to deposit */ function fund(uint256 amount) external nonReentrant { require(amount > 0, "lrm4"); _update(); // get fees (address receiver, uint256 feeRate) = _config.getAddressUint96( keccak256("gysr.core.linear.fund.fee") ); // do funding transfer, fee processing, and reward shares accounting uint256 minted = _token.receiveWithFee( rewardShares, msg.sender, amount, receiver, feeRate ); rewardShares += minted; emit RewardsFunded(address(_token), amount, minted, block.timestamp); } /** * @notice withdraw uncommited reward tokens from module * @param amount number of reward tokens to withdraw */ function withdraw(uint256 amount) external { requireController(); _update(); // validate excess budget require(amount > 0, "lrm5"); require(amount <= _token.balanceOf(address(this)), "lrm6"); uint256 shares = _token.getShares(rewardShares, amount); require(shares > 0); require( (stakingShares * rate * period) / 1e18 + shares < rewardShares - earned, "lrm7" ); // withdraw rewardShares -= shares; _token.safeTransfer(msg.sender, amount); emit RewardsWithdrawn(address(_token), amount, shares, block.timestamp); } // -- ERC20LinearRewardModule internal ------------------------------- /** * @dev internal method to distribute rewards * @param user address of user * @param shares number of shares burned */ function _distribute(address user, uint256 shares) private { // compute reward amount in tokens uint256 amount = _token.getAmount(rewardShares, shares); // update overall reward shares rewardShares -= shares; earned -= shares; // do reward _token.safeTransfer(user, amount); emit RewardsDistributed(user, address(_token), amount, shares); } /** * @dev internal implementation of common update method */ function _update() private { uint256 budget = rewardShares - earned; uint256 e = block.timestamp - lastUpdated; lastUpdated = block.timestamp; if (budget == 0) return; // totally out uint256 totalRate = (stakingShares * rate) / 1e18; uint256 r = totalRate * e; if (budget < r) { // over budget, clip elapsed e = budget / totalRate; r = totalRate * e; } // update accumulators elapsed += e; earned += r; } }
/* IConfiguration https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.18; /** * @title Configuration interface * * @notice this defines the protocol configuration interface */ interface IConfiguration { // events event ParameterUpdated(bytes32 indexed key, address value); event ParameterUpdated(bytes32 indexed key, uint256 value); event ParameterUpdated(bytes32 indexed key, address value0, uint96 value1); event ParameterOverridden( address indexed caller, bytes32 indexed key, address value ); event ParameterOverridden( address indexed caller, bytes32 indexed key, uint256 value ); event ParameterOverridden( address indexed caller, bytes32 indexed key, address value0, uint96 value1 ); /** * @notice set or update uint256 parameter * @param key keccak256 hash of parameter key * @param value uint256 parameter value */ function setUint256(bytes32 key, uint256 value) external; /** * @notice set or update address parameter * @param key keccak256 hash of parameter key * @param value address parameter value */ function setAddress(bytes32 key, address value) external; /** * @notice set or update packed address + uint96 pair * @param key keccak256 hash of parameter key * @param value0 address parameter value * @param value1 uint96 parameter value */ function setAddressUint96( bytes32 key, address value0, uint96 value1 ) external; /** * @notice get uint256 parameter * @param key keccak256 hash of parameter key * @return uint256 parameter value */ function getUint256(bytes32 key) external view returns (uint256); /** * @notice get address parameter * @param key keccak256 hash of parameter key * @return uint256 parameter value */ function getAddress(bytes32 key) external view returns (address); /** * @notice get packed address + uint96 pair * @param key keccak256 hash of parameter key * @return address parameter value * @return uint96 parameter value */ function getAddressUint96( bytes32 key ) external view returns (address, uint96); /** * @notice override uint256 parameter for specific caller * @param caller address of caller * @param key keccak256 hash of parameter key * @param value uint256 parameter value */ function overrideUint256( address caller, bytes32 key, uint256 value ) external; /** * @notice override address parameter for specific caller * @param caller address of caller * @param key keccak256 hash of parameter key * @param value address parameter value */ function overrideAddress( address caller, bytes32 key, address value ) external; /** * @notice override address parameter for specific caller * @param caller address of caller * @param key keccak256 hash of parameter key * @param value0 address parameter value * @param value1 uint96 parameter value */ function overrideAddressUint96( address caller, bytes32 key, address value0, uint96 value1 ) external; }
/* IEvents https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.18; /** * @title GYSR event system * * @notice common interface to define GYSR event system */ interface IEvents { // staking event Staked( bytes32 indexed account, address indexed user, address indexed token, uint256 amount, uint256 shares ); event Unstaked( bytes32 indexed account, address indexed user, address indexed token, uint256 amount, uint256 shares ); event Claimed( bytes32 indexed account, address indexed user, address indexed token, uint256 amount, uint256 shares ); event Updated(bytes32 indexed account, address indexed user); // rewards event RewardsDistributed( address indexed user, address indexed token, uint256 amount, uint256 shares ); event RewardsFunded( address indexed token, uint256 amount, uint256 shares, uint256 timestamp ); event RewardsExpired( address indexed token, uint256 amount, uint256 shares, uint256 timestamp ); event RewardsWithdrawn( address indexed token, uint256 amount, uint256 shares, uint256 timestamp ); event RewardsUpdated(bytes32 indexed account); // gysr event GysrSpent(address indexed user, uint256 amount); event GysrVested(address indexed user, uint256 amount); event GysrWithdrawn(uint256 amount); event Fee(address indexed receiver, address indexed token, uint256 amount); }
/* IModuleFactory https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.18; /** * @title Module factory interface * * @notice this defines the common module factory interface used by the * main factory to create the staking and reward modules for a new Pool. */ interface IModuleFactory { // events event ModuleCreated(address indexed user, address module); /** * @notice create a new Pool module * @param config address for configuration contract * @param data binary encoded construction parameters * @return address of newly created module */ function createModule(address config, bytes calldata data) external returns (address); }
/* IOwnerController https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.18; /** * @title Owner controller interface * * @notice this defines the interface for any contracts that use the * owner controller access pattern */ interface IOwnerController { /** * @dev Returns the address of the current owner. */ function owner() external view returns (address); /** * @dev Returns the address of the current controller. */ function controller() external view returns (address); /** * @dev Transfers ownership of the contract to a new account (`newOwner`). This can * include renouncing ownership by transferring to the zero address. * Can only be called by the current owner. */ function transferOwnership(address newOwner) external; /** * @dev Transfers control of the contract to a new account (`newController`). * Can only be called by the owner. */ function transferControl(address newController) external; }
/* IRewardModule https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.18; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./IEvents.sol"; import "./IOwnerController.sol"; /** * @title Reward module interface * * @notice this contract defines the common interface that any reward module * must implement to be compatible with the modular Pool architecture. */ interface IRewardModule is IOwnerController, IEvents { /** * @return array of reward tokens */ function tokens() external view returns (address[] memory); /** * @return array of reward token balances */ function balances() external view returns (uint256[] memory); /** * @return GYSR usage ratio for reward module */ function usage() external view returns (uint256); /** * @return address of module factory */ function factory() external view returns (address); /** * @notice perform any necessary accounting for new stake * @param account bytes32 id of staking account * @param sender address of sender * @param shares number of new shares minted * @param data addtional data * @return amount of gysr spent * @return amount of gysr vested */ function stake( bytes32 account, address sender, uint256 shares, bytes calldata data ) external returns (uint256, uint256); /** * @notice reward user and perform any necessary accounting for unstake * @param account bytes32 id of staking account * @param sender address of sender * @param receiver address of reward receiver * @param shares number of shares burned * @param data additional data * @return amount of gysr spent * @return amount of gysr vested */ function unstake( bytes32 account, address sender, address receiver, uint256 shares, bytes calldata data ) external returns (uint256, uint256); /** * @notice reward user and perform and necessary accounting for existing stake * @param account bytes32 id of staking account * @param sender address of sender * @param receiver address of reward receiver * @param shares number of shares being claimed against * @param data additional data * @return amount of gysr spent * @return amount of gysr vested */ function claim( bytes32 account, address sender, address receiver, uint256 shares, bytes calldata data ) external returns (uint256, uint256); /** * @notice method called by anyone to update accounting * @dev will only be called ad hoc and should not contain essential logic * @param account bytes32 id of staking account for update * @param sender address of sender * @param data additional data */ function update( bytes32 account, address sender, bytes calldata data ) external; /** * @notice method called by owner to clean up and perform additional accounting * @dev will only be called ad hoc and should not contain any essential logic * @param data additional data */ function clean(bytes calldata data) external; }
/* OwnerController https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.18; import "./interfaces/IOwnerController.sol"; /** * @title Owner controller * * @notice this base contract implements an owner-controller access model. * * @dev the contract is an adapted version of the OpenZeppelin Ownable contract. * It allows the owner to designate an additional account as the controller to * perform restricted operations. * * Other changes include supporting role verification with a require method * in addition to the modifier option, and removing some unneeded functionality. * * Original contract here: * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol */ contract OwnerController is IOwnerController { address private _owner; address private _controller; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); event ControlTransferred( address indexed previousController, address indexed newController ); constructor() { _owner = msg.sender; _controller = msg.sender; emit OwnershipTransferred(address(0), _owner); emit ControlTransferred(address(0), _owner); } /** * @dev Returns the address of the current owner. */ function owner() public view override returns (address) { return _owner; } /** * @dev Returns the address of the current controller. */ function controller() public view override returns (address) { return _controller; } /** * @dev Modifier that throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == msg.sender, "oc1"); _; } /** * @dev Modifier that throws if called by any account other than the controller. */ modifier onlyController() { require(_controller == msg.sender, "oc2"); _; } /** * @dev Throws if called by any account other than the owner. */ function requireOwner() internal view { require(_owner == msg.sender, "oc1"); } /** * @dev Throws if called by any account other than the controller. */ function requireController() internal view { require(_controller == msg.sender, "oc2"); } /** * @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 override { requireOwner(); require(newOwner != address(0), "oc3"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } /** * @dev Transfers control of the contract to a new account (`newController`). * Can only be called by the owner. */ function transferControl(address newController) public virtual override { requireOwner(); require(newController != address(0), "oc4"); emit ControlTransferred(_controller, newController); _controller = newController; } }
/* TokenUtils https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.18; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /** * @title Token utilities * * @notice this library implements utility methods for token handling, * dynamic balance accounting, and fee processing */ library TokenUtils { using SafeERC20 for IERC20; event Fee(address indexed receiver, address indexed token, uint256 amount); // redefinition uint256 constant INITIAL_SHARES_PER_TOKEN = 1e6; uint256 constant FLOOR_SHARES_PER_TOKEN = 1e3; /** * @notice get token shares from amount * @param token erc20 token interface * @param total current total shares * @param amount balance of tokens */ function getShares( IERC20 token, uint256 total, uint256 amount ) internal view returns (uint256) { if (total == 0) return 0; uint256 balance = token.balanceOf(address(this)); if (total < balance * FLOOR_SHARES_PER_TOKEN) return amount * FLOOR_SHARES_PER_TOKEN; return (total * amount) / balance; } /** * @notice get token amount from shares * @param token erc20 token interface * @param total current total shares * @param shares balance of shares */ function getAmount( IERC20 token, uint256 total, uint256 shares ) internal view returns (uint256) { if (total == 0) return 0; uint256 balance = token.balanceOf(address(this)); if (total < balance * FLOOR_SHARES_PER_TOKEN) return shares / FLOOR_SHARES_PER_TOKEN; return (balance * shares) / total; } /** * @notice transfer tokens from sender into contract and convert to shares * for internal accounting * @param token erc20 token interface * @param total current total shares * @param sender token sender * @param amount number of tokens to be sent */ function receiveAmount( IERC20 token, uint256 total, address sender, uint256 amount ) internal returns (uint256) { // note: we assume amount > 0 has already been validated // transfer uint256 balance = token.balanceOf(address(this)); token.safeTransferFrom(sender, address(this), amount); uint256 actual = token.balanceOf(address(this)) - balance; require(amount >= actual); // mint shares at current rate uint256 minted; if (total == 0) { minted = actual * INITIAL_SHARES_PER_TOKEN; } else if (total < balance * FLOOR_SHARES_PER_TOKEN) { minted = actual * FLOOR_SHARES_PER_TOKEN; } else { minted = (total * actual) / balance; } require(minted > 0); return minted; } /** * @notice transfer tokens from sender into contract, process protocol fee, * and convert to shares for internal accounting * @param token erc20 token interface * @param total current total shares * @param sender token sender * @param amount number of tokens to be sent * @param feeReceiver address to receive fee * @param feeRate portion of amount to take as fee in 18 decimals */ function receiveWithFee( IERC20 token, uint256 total, address sender, uint256 amount, address feeReceiver, uint256 feeRate ) internal returns (uint256) { // note: we assume amount > 0 has already been validated // check initial token balance uint256 balance = token.balanceOf(address(this)); // process fee uint256 fee; if (feeReceiver != address(0) && feeRate > 0 && feeRate < 1e18) { fee = (amount * feeRate) / 1e18; token.safeTransferFrom(sender, feeReceiver, fee); emit Fee(feeReceiver, address(token), fee); } // do transfer token.safeTransferFrom(sender, address(this), amount - fee); uint256 actual = token.balanceOf(address(this)) - balance; require(amount >= actual); // mint shares at current rate uint256 minted; if (total == 0) { minted = actual * INITIAL_SHARES_PER_TOKEN; } else if (total < balance * FLOOR_SHARES_PER_TOKEN) { minted = actual * FLOOR_SHARES_PER_TOKEN; } else { minted = (total * actual) / balance; } require(minted > 0); return minted; } }
{ "optimizer": { "enabled": true, "runs": 10000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"module","type":"address"}],"name":"ModuleCreated","type":"event"},{"inputs":[{"internalType":"address","name":"config","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"createModule","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061281b806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806320868d1814610030575b600080fd5b61004361003e366004610241565b61006c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000606082146100dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f6c726d6631000000000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b60008060006064359250608435915060a435905060008383838a3060405161010390610234565b73ffffffffffffffffffffffffffffffffffffffff95861681526020810194909452604084019290925283166060830152909116608082015260a001604051809103906000f08015801561015b573d6000803e3d6000fd5b506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815233600482015290915073ffffffffffffffffffffffffffffffffffffffff82169063f2fde38b90602401600060405180830381600087803b1580156101c657600080fd5b505af11580156101da573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff841681523392507ff708942ec477396a151a5285651961dcab8e8a82ea4f5b31a5236f92f6c92710915060200160405180910390a2979650505050505050565b612506806102e083390190565b60008060006040848603121561025657600080fd5b833573ffffffffffffffffffffffffffffffffffffffff8116811461027a57600080fd5b9250602084013567ffffffffffffffff8082111561029757600080fd5b818601915086601f8301126102ab57600080fd5b8135818111156102ba57600080fd5b8760208285010111156102cc57600080fd5b602083019450809350505050925092509256fe6101206040523480156200001257600080fd5b506040516200250638038062002506833981016040819052620000359162000198565b600160008181558154336001600160a01b0319918216811790935560028054909116831790556040517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36001546040516001600160a01b03909116906000907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f2908290a36001600160a01b038516620000d157600080fd5b60008411620001155760405162461bcd60e51b81526004016200010c906020808252600490820152636c726d3160e01b604082015260600190565b60405180910390fd5b60008311620001505760405162461bcd60e51b81526004016200010c906020808252600490820152633639369960e11b604082015260600190565b6001600160a01b0394851660c0529084166101005290921660e05260805260a05242600855620001f6565b80516001600160a01b03811681146200019357600080fd5b919050565b600080600080600060a08688031215620001b157600080fd5b620001bc866200017b565b94506020860151935060408601519250620001da606087016200017b565b9150620001ea608087016200017b565b90509295509295909350565b60805160a05160c05160e0516101005161224d620002b96000396000610f150152600061032d015260008181610601015281816106f3015281816108310152818161086f01528181610a3801528181610dc601528181610fb30152818161100d01528181611279015281816112ed01526113160152600081816101c40152818161049b0152818161076601528181610b4701528181610c0501528181610d2701526111bb01526000818161038d015281816107450152610b23015261224d6000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c806397c83844116100e3578063d6f192621161008c578063ef78d4fd11610066578063ef78d4fd14610388578063f2fde38b146103af578063f77c4791146103c257600080fd5b8063d6f192621461036d578063e2a4b6f414610376578063e52595461461037f57600080fd5b8063c45a0155116100bd578063c45a01551461032b578063ca1d209d14610351578063d0b06f5d1461036457600080fd5b806397c83844146102f05780639d63848a14610303578063b31f41701461031857600080fd5b80636d16fa41116101455780637bb98a681161011f5780637bb98a6814610289578063837115531461029e5780638da5cb5b146102b157600080fd5b80636d16fa411461025c5780636d811e711461026f5780636fd366b81461027657600080fd5b80632e1a7d4d116101765780632e1a7d4d146101f45780632f29d8c514610209578063514ea4bf1461021257600080fd5b8063185bad3f146101925780632c4e722e146101bf575b600080fd5b6101a56101a0366004611da9565b6103e0565b604080519283526020830191909152015b60405180910390f35b6101e67f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016101b6565b610207610202366004611e25565b610571565b005b6101e660065481565b610241610220366004611e25565b60036020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016101b6565b61020761026a366004611e3e565b6108d4565b60006101e6565b610207610284366004611e5b565b6109cd565b6102916109e1565b6040516101b69190611e9d565b6101a56102ac366004611ee1565b610a82565b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b6565b6101a56102fe366004611da9565b610c7f565b61030b610da2565b6040516101b69190611f4b565b610207610326366004611f99565b610e35565b7f00000000000000000000000000000000000000000000000000000000000000006102cb565b61020761035f366004611e25565b610e4b565b6101e660085481565b6101e660075481565b6101e660045481565b6101e660055481565b6101e67f000000000000000000000000000000000000000000000000000000000000000081565b6102076103bd366004611e3e565b61107e565b60025473ffffffffffffffffffffffffffffffffffffffff166102cb565b600154600090819073ffffffffffffffffffffffffffffffffffffffff1633146104515760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b610459611177565b600088815260036020526040902080548087111561047957610479611ff5565b6000670de0b6b3a764000083600101546006546104969190612053565b6104c07f00000000000000000000000000000000000000000000000000000000000000008561206c565b6104ca919061206c565b6104d49190612083565b83600201546104e391906120be565b90508188101561051a57878360000160008282546105019190612053565b9091555050600654600184015560006002840155610537565b60008b815260036020526040812081815560018101829055600201555b87600460008282546105499190612053565b9091555050801561055e5761055e8982611258565b5060009a8b9a5098505050505050505050565b6105796113a9565b610581611177565b600081116105d35760405162461bcd60e51b81526004016104489060208082526004908201527f6c726d3500000000000000000000000000000000000000000000000000000000604082015260600190565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561065d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068191906120d1565b8111156106d25760405162461bcd60e51b81526004016104489060208082526004908201527f6c726d3600000000000000000000000000000000000000000000000000000000604082015260600190565b60055460009061071a9073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169084611412565b90506000811161072957600080fd5b6007546005546107399190612053565b81670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000600454610792919061206c565b61079c919061206c565b6107a69190612083565b6107b091906120be565b106107ff5760405162461bcd60e51b81526004016104489060208082526004908201527f6c726d3700000000000000000000000000000000000000000000000000000000604082015260600190565b80600560008282546108119190612053565b90915550610858905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633846114fe565b6040805183815260208101839052428183015290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16917f4f3d7a53f1fd3ab32e84fafd251bc5c1ec2c516068909f68847ad29c366d134c919081900360600190a25050565b6108dc6115d7565b73ffffffffffffffffffffffffffffffffffffffff811661093f5760405162461bcd60e51b815260206004820152600360248201527f6f633400000000000000000000000000000000000000000000000000000000006044820152606401610448565b60025460405173ffffffffffffffffffffffffffffffffffffffff8084169216907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f290600090a3600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6109d56115d7565b6109dd611177565b5050565b6040805160018082528183019092526060916020808301908036833750506005549192505015610a7f57610a5f600554600754600554610a219190612053565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016919061163e565b81600081518110610a7257610a726120ea565b6020026020010181815250505b90565b600154600090819073ffffffffffffffffffffffffffffffffffffffff163314610aee5760405162461bcd60e51b815260206004820152600360248201527f6f633100000000000000000000000000000000000000000000000000000000006044820152606401610448565b610af6611177565b600085600454610b0691906120be565b9050600754600554610b189190612053565b670de0b6b3a76400007f0000000000000000000000000000000000000000000000000000000000000000610b6c7f00000000000000000000000000000000000000000000000000000000000000008561206c565b610b76919061206c565b610b809190612083565b10610bcf5760405162461bcd60e51b81526004016104489060208082526004908201527f6c726d3300000000000000000000000000000000000000000000000000000000604082015260600190565b600088815260036020526040902080548015610c5757670de0b6b3a76400008260010154600654610c009190612053565b610c2a7f00000000000000000000000000000000000000000000000000000000000000008461206c565b610c34919061206c565b610c3e9190612083565b826002016000828254610c5191906120be565b90915550505b610c6188826120be565b82555060065460019091015560045550600096879650945050505050565b600154600090819073ffffffffffffffffffffffffffffffffffffffff163314610ceb5760405162461bcd60e51b815260206004820152600360248201527f6f633100000000000000000000000000000000000000000000000000000000006044820152606401610448565b610cf3611177565b60008881526003602052604081206001810154600654919291670de0b6b3a764000091610d1f91612053565b8354610d4c907f00000000000000000000000000000000000000000000000000000000000000009061206c565b610d56919061206c565b610d609190612083565b8260020154610d6f91906120be565b60006002840155600654600184015590508015610d9057610d908882611258565b506000998a9950975050505050505050565b604080516001808252818301909252606091602080830190803683370190505090507f000000000000000000000000000000000000000000000000000000000000000081600081518110610df857610df86120ea565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505090565b610e3d6115d7565b610e45611177565b50505050565b610e5361170d565b60008111610ea55760405162461bcd60e51b81526004016104489060208082526004908201527f6c726d3400000000000000000000000000000000000000000000000000000000604082015260600190565b610ead611177565b6040517f575313cd0000000000000000000000000000000000000000000000000000000081527fba883d87c1f27669a52651afd0942565af69d08c14b5aa3e978d9d8bec44aed06004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063575313cd906024016040805180830381865afa158015610f5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7f9190612119565b6005549193506bffffffffffffffffffffffff169150600090610fdd9073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169033878787611766565b90508060056000828254610ff191906120be565b90915550506040805185815260208101839052428183015290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16917f0d2eac201c6bd25b979f0d9ebcf8ff27a476edde7006f42e843dc70727dbf90b919081900360600190a250505061107b6001600055565b50565b6110866115d7565b73ffffffffffffffffffffffffffffffffffffffff81166110e95760405162461bcd60e51b815260206004820152600360248201527f6f633300000000000000000000000000000000000000000000000000000000006044820152606401610448565b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006007546005546111899190612053565b905060006008544261119b9190612053565b42600855905060008290036111ae575050565b6000670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006004546111e7919061206c565b6111f19190612083565b905060006111ff838361206c565b905080841015611222576112138285612083565b925061121f838361206c565b90505b826006600082825461123491906120be565b92505081905550806007600082825461124d91906120be565b909155505050505050565b6005546000906112a09073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016908461163e565b905081600560008282546112b49190612053565b9250508190555081600760008282546112cd9190612053565b90915550611314905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001684836114fe565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f1a4dfb075362880d700ede1cc31d284b1c3b2811e9f0b2ddde7bdb270042c13f838560405161139c929190918252602082015260400190565b60405180910390a3505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146114105760405162461bcd60e51b815260206004820152600360248201527f6f633200000000000000000000000000000000000000000000000000000000006044820152606401610448565b565b600082600003611424575060006114f7565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015611491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b591906120d1565b90506114c36103e88261206c565b8410156114de576114d66103e88461206c565b9150506114f7565b806114e9848661206c565b6114f39190612083565b9150505b9392505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526115d29084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611a2d565b505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146114105760405162461bcd60e51b815260206004820152600360248201527f6f633100000000000000000000000000000000000000000000000000000000006044820152606401610448565b600082600003611650575060006114f7565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa1580156116bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e191906120d1565b90506116ef6103e88261206c565b841015611702576114d66103e884612083565b836114e9848361206c565b60026000540361175f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610448565b6002600055565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090819073ffffffffffffffffffffffffffffffffffffffff8916906370a0823190602401602060405180830381865afa1580156117d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f991906120d1565b9050600073ffffffffffffffffffffffffffffffffffffffff8516158015906118225750600084115b80156118355750670de0b6b3a764000084105b156118e357670de0b6b3a764000061184d858861206c565b6118579190612083565b905061187b73ffffffffffffffffffffffffffffffffffffffff8a16888784611b1f565b8873ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f6ded982279c8387ad8a63e73385031a3807c1862e633f06e09d11bcb6e282f60836040516118da91815260200190565b60405180910390a35b61191187306118f2848a612053565b73ffffffffffffffffffffffffffffffffffffffff8d16929190611b1f565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090839073ffffffffffffffffffffffffffffffffffffffff8c16906370a0823190602401602060405180830381865afa158015611980573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a491906120d1565b6119ae9190612053565b9050808710156119bd57600080fd5b6000896000036119db576119d4620f42408361206c565b9050611a12565b6119e76103e88561206c565b8a10156119fa576119d46103e88361206c565b83611a05838c61206c565b611a0f9190612083565b90505b60008111611a1f57600080fd5b9a9950505050505050505050565b6000611a8f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611b7d9092919063ffffffff16565b8051909150156115d25780806020019051810190611aad9190612164565b6115d25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610448565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052610e459085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611550565b6060611b8c8484600085611b94565b949350505050565b606082471015611c0c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610448565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611c3591906121aa565b60006040518083038185875af1925050503d8060008114611c72576040519150601f19603f3d011682016040523d82523d6000602084013e611c77565b606091505b5091509150611c8887838387611c93565b979650505050505050565b60608315611d0f578251600003611d085773ffffffffffffffffffffffffffffffffffffffff85163b611d085760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610448565b5081611b8c565b611b8c8383815115611d245781518083602001fd5b8060405162461bcd60e51b815260040161044891906121c6565b73ffffffffffffffffffffffffffffffffffffffff8116811461107b57600080fd5b60008083601f840112611d7257600080fd5b50813567ffffffffffffffff811115611d8a57600080fd5b602083019150836020828501011115611da257600080fd5b9250929050565b60008060008060008060a08789031215611dc257600080fd5b863595506020870135611dd481611d3e565b94506040870135611de481611d3e565b935060608701359250608087013567ffffffffffffffff811115611e0757600080fd5b611e1389828a01611d60565b979a9699509497509295939492505050565b600060208284031215611e3757600080fd5b5035919050565b600060208284031215611e5057600080fd5b81356114f781611d3e565b60008060208385031215611e6e57600080fd5b823567ffffffffffffffff811115611e8557600080fd5b611e9185828601611d60565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015611ed557835183529284019291840191600101611eb9565b50909695505050505050565b600080600080600060808688031215611ef957600080fd5b853594506020860135611f0b81611d3e565b935060408601359250606086013567ffffffffffffffff811115611f2e57600080fd5b611f3a88828901611d60565b969995985093965092949392505050565b6020808252825182820181905260009190848201906040850190845b81811015611ed557835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611f67565b60008060008060608587031215611faf57600080fd5b843593506020850135611fc181611d3e565b9250604085013567ffffffffffffffff811115611fdd57600080fd5b611fe987828801611d60565b95989497509550505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561206657612066612024565b92915050565b808202811582820484141761206657612066612024565b6000826120b9577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082018082111561206657612066612024565b6000602082840312156120e357600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000806040838503121561212c57600080fd5b825161213781611d3e565b60208401519092506bffffffffffffffffffffffff8116811461215957600080fd5b809150509250929050565b60006020828403121561217657600080fd5b815180151581146114f757600080fd5b60005b838110156121a1578181015183820152602001612189565b50506000910152565b600082516121bc818460208701612186565b9190910192915050565b60208152600082518060208401526121e5816040850160208701612186565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea26469706673582212203f54a0b43b5d6c6b04a10333c2d466d3650e56d0ec16173a7654d3c3435b9f0e64736f6c63430008120033a2646970667358221220fdf85b882ed1fe09317176bb4e54d572a8c198cfe7d8a0746b675841098d47a764736f6c63430008120033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806320868d1814610030575b600080fd5b61004361003e366004610241565b61006c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000606082146100dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f6c726d6631000000000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b60008060006064359250608435915060a435905060008383838a3060405161010390610234565b73ffffffffffffffffffffffffffffffffffffffff95861681526020810194909452604084019290925283166060830152909116608082015260a001604051809103906000f08015801561015b573d6000803e3d6000fd5b506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815233600482015290915073ffffffffffffffffffffffffffffffffffffffff82169063f2fde38b90602401600060405180830381600087803b1580156101c657600080fd5b505af11580156101da573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff841681523392507ff708942ec477396a151a5285651961dcab8e8a82ea4f5b31a5236f92f6c92710915060200160405180910390a2979650505050505050565b612506806102e083390190565b60008060006040848603121561025657600080fd5b833573ffffffffffffffffffffffffffffffffffffffff8116811461027a57600080fd5b9250602084013567ffffffffffffffff8082111561029757600080fd5b818601915086601f8301126102ab57600080fd5b8135818111156102ba57600080fd5b8760208285010111156102cc57600080fd5b602083019450809350505050925092509256fe6101206040523480156200001257600080fd5b506040516200250638038062002506833981016040819052620000359162000198565b600160008181558154336001600160a01b0319918216811790935560028054909116831790556040517f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36001546040516001600160a01b03909116906000907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f2908290a36001600160a01b038516620000d157600080fd5b60008411620001155760405162461bcd60e51b81526004016200010c906020808252600490820152636c726d3160e01b604082015260600190565b60405180910390fd5b60008311620001505760405162461bcd60e51b81526004016200010c906020808252600490820152633639369960e11b604082015260600190565b6001600160a01b0394851660c0529084166101005290921660e05260805260a05242600855620001f6565b80516001600160a01b03811681146200019357600080fd5b919050565b600080600080600060a08688031215620001b157600080fd5b620001bc866200017b565b94506020860151935060408601519250620001da606087016200017b565b9150620001ea608087016200017b565b90509295509295909350565b60805160a05160c05160e0516101005161224d620002b96000396000610f150152600061032d015260008181610601015281816106f3015281816108310152818161086f01528181610a3801528181610dc601528181610fb30152818161100d01528181611279015281816112ed01526113160152600081816101c40152818161049b0152818161076601528181610b4701528181610c0501528181610d2701526111bb01526000818161038d015281816107450152610b23015261224d6000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c806397c83844116100e3578063d6f192621161008c578063ef78d4fd11610066578063ef78d4fd14610388578063f2fde38b146103af578063f77c4791146103c257600080fd5b8063d6f192621461036d578063e2a4b6f414610376578063e52595461461037f57600080fd5b8063c45a0155116100bd578063c45a01551461032b578063ca1d209d14610351578063d0b06f5d1461036457600080fd5b806397c83844146102f05780639d63848a14610303578063b31f41701461031857600080fd5b80636d16fa41116101455780637bb98a681161011f5780637bb98a6814610289578063837115531461029e5780638da5cb5b146102b157600080fd5b80636d16fa411461025c5780636d811e711461026f5780636fd366b81461027657600080fd5b80632e1a7d4d116101765780632e1a7d4d146101f45780632f29d8c514610209578063514ea4bf1461021257600080fd5b8063185bad3f146101925780632c4e722e146101bf575b600080fd5b6101a56101a0366004611da9565b6103e0565b604080519283526020830191909152015b60405180910390f35b6101e67f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016101b6565b610207610202366004611e25565b610571565b005b6101e660065481565b610241610220366004611e25565b60036020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016101b6565b61020761026a366004611e3e565b6108d4565b60006101e6565b610207610284366004611e5b565b6109cd565b6102916109e1565b6040516101b69190611e9d565b6101a56102ac366004611ee1565b610a82565b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b6565b6101a56102fe366004611da9565b610c7f565b61030b610da2565b6040516101b69190611f4b565b610207610326366004611f99565b610e35565b7f00000000000000000000000000000000000000000000000000000000000000006102cb565b61020761035f366004611e25565b610e4b565b6101e660085481565b6101e660075481565b6101e660045481565b6101e660055481565b6101e67f000000000000000000000000000000000000000000000000000000000000000081565b6102076103bd366004611e3e565b61107e565b60025473ffffffffffffffffffffffffffffffffffffffff166102cb565b600154600090819073ffffffffffffffffffffffffffffffffffffffff1633146104515760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b610459611177565b600088815260036020526040902080548087111561047957610479611ff5565b6000670de0b6b3a764000083600101546006546104969190612053565b6104c07f00000000000000000000000000000000000000000000000000000000000000008561206c565b6104ca919061206c565b6104d49190612083565b83600201546104e391906120be565b90508188101561051a57878360000160008282546105019190612053565b9091555050600654600184015560006002840155610537565b60008b815260036020526040812081815560018101829055600201555b87600460008282546105499190612053565b9091555050801561055e5761055e8982611258565b5060009a8b9a5098505050505050505050565b6105796113a9565b610581611177565b600081116105d35760405162461bcd60e51b81526004016104489060208082526004908201527f6c726d3500000000000000000000000000000000000000000000000000000000604082015260600190565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561065d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068191906120d1565b8111156106d25760405162461bcd60e51b81526004016104489060208082526004908201527f6c726d3600000000000000000000000000000000000000000000000000000000604082015260600190565b60055460009061071a9073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169084611412565b90506000811161072957600080fd5b6007546005546107399190612053565b81670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000600454610792919061206c565b61079c919061206c565b6107a69190612083565b6107b091906120be565b106107ff5760405162461bcd60e51b81526004016104489060208082526004908201527f6c726d3700000000000000000000000000000000000000000000000000000000604082015260600190565b80600560008282546108119190612053565b90915550610858905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633846114fe565b6040805183815260208101839052428183015290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16917f4f3d7a53f1fd3ab32e84fafd251bc5c1ec2c516068909f68847ad29c366d134c919081900360600190a25050565b6108dc6115d7565b73ffffffffffffffffffffffffffffffffffffffff811661093f5760405162461bcd60e51b815260206004820152600360248201527f6f633400000000000000000000000000000000000000000000000000000000006044820152606401610448565b60025460405173ffffffffffffffffffffffffffffffffffffffff8084169216907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f290600090a3600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6109d56115d7565b6109dd611177565b5050565b6040805160018082528183019092526060916020808301908036833750506005549192505015610a7f57610a5f600554600754600554610a219190612053565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016919061163e565b81600081518110610a7257610a726120ea565b6020026020010181815250505b90565b600154600090819073ffffffffffffffffffffffffffffffffffffffff163314610aee5760405162461bcd60e51b815260206004820152600360248201527f6f633100000000000000000000000000000000000000000000000000000000006044820152606401610448565b610af6611177565b600085600454610b0691906120be565b9050600754600554610b189190612053565b670de0b6b3a76400007f0000000000000000000000000000000000000000000000000000000000000000610b6c7f00000000000000000000000000000000000000000000000000000000000000008561206c565b610b76919061206c565b610b809190612083565b10610bcf5760405162461bcd60e51b81526004016104489060208082526004908201527f6c726d3300000000000000000000000000000000000000000000000000000000604082015260600190565b600088815260036020526040902080548015610c5757670de0b6b3a76400008260010154600654610c009190612053565b610c2a7f00000000000000000000000000000000000000000000000000000000000000008461206c565b610c34919061206c565b610c3e9190612083565b826002016000828254610c5191906120be565b90915550505b610c6188826120be565b82555060065460019091015560045550600096879650945050505050565b600154600090819073ffffffffffffffffffffffffffffffffffffffff163314610ceb5760405162461bcd60e51b815260206004820152600360248201527f6f633100000000000000000000000000000000000000000000000000000000006044820152606401610448565b610cf3611177565b60008881526003602052604081206001810154600654919291670de0b6b3a764000091610d1f91612053565b8354610d4c907f00000000000000000000000000000000000000000000000000000000000000009061206c565b610d56919061206c565b610d609190612083565b8260020154610d6f91906120be565b60006002840155600654600184015590508015610d9057610d908882611258565b506000998a9950975050505050505050565b604080516001808252818301909252606091602080830190803683370190505090507f000000000000000000000000000000000000000000000000000000000000000081600081518110610df857610df86120ea565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505090565b610e3d6115d7565b610e45611177565b50505050565b610e5361170d565b60008111610ea55760405162461bcd60e51b81526004016104489060208082526004908201527f6c726d3400000000000000000000000000000000000000000000000000000000604082015260600190565b610ead611177565b6040517f575313cd0000000000000000000000000000000000000000000000000000000081527fba883d87c1f27669a52651afd0942565af69d08c14b5aa3e978d9d8bec44aed06004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063575313cd906024016040805180830381865afa158015610f5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7f9190612119565b6005549193506bffffffffffffffffffffffff169150600090610fdd9073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169033878787611766565b90508060056000828254610ff191906120be565b90915550506040805185815260208101839052428183015290517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16917f0d2eac201c6bd25b979f0d9ebcf8ff27a476edde7006f42e843dc70727dbf90b919081900360600190a250505061107b6001600055565b50565b6110866115d7565b73ffffffffffffffffffffffffffffffffffffffff81166110e95760405162461bcd60e51b815260206004820152600360248201527f6f633300000000000000000000000000000000000000000000000000000000006044820152606401610448565b60015460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60006007546005546111899190612053565b905060006008544261119b9190612053565b42600855905060008290036111ae575050565b6000670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006004546111e7919061206c565b6111f19190612083565b905060006111ff838361206c565b905080841015611222576112138285612083565b925061121f838361206c565b90505b826006600082825461123491906120be565b92505081905550806007600082825461124d91906120be565b909155505050505050565b6005546000906112a09073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016908461163e565b905081600560008282546112b49190612053565b9250508190555081600760008282546112cd9190612053565b90915550611314905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001684836114fe565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f1a4dfb075362880d700ede1cc31d284b1c3b2811e9f0b2ddde7bdb270042c13f838560405161139c929190918252602082015260400190565b60405180910390a3505050565b60025473ffffffffffffffffffffffffffffffffffffffff1633146114105760405162461bcd60e51b815260206004820152600360248201527f6f633200000000000000000000000000000000000000000000000000000000006044820152606401610448565b565b600082600003611424575060006114f7565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015611491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b591906120d1565b90506114c36103e88261206c565b8410156114de576114d66103e88461206c565b9150506114f7565b806114e9848661206c565b6114f39190612083565b9150505b9392505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526115d29084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611a2d565b505050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146114105760405162461bcd60e51b815260206004820152600360248201527f6f633100000000000000000000000000000000000000000000000000000000006044820152606401610448565b600082600003611650575060006114f7565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa1580156116bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e191906120d1565b90506116ef6103e88261206c565b841015611702576114d66103e884612083565b836114e9848361206c565b60026000540361175f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610448565b6002600055565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090819073ffffffffffffffffffffffffffffffffffffffff8916906370a0823190602401602060405180830381865afa1580156117d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f991906120d1565b9050600073ffffffffffffffffffffffffffffffffffffffff8516158015906118225750600084115b80156118355750670de0b6b3a764000084105b156118e357670de0b6b3a764000061184d858861206c565b6118579190612083565b905061187b73ffffffffffffffffffffffffffffffffffffffff8a16888784611b1f565b8873ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f6ded982279c8387ad8a63e73385031a3807c1862e633f06e09d11bcb6e282f60836040516118da91815260200190565b60405180910390a35b61191187306118f2848a612053565b73ffffffffffffffffffffffffffffffffffffffff8d16929190611b1f565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090839073ffffffffffffffffffffffffffffffffffffffff8c16906370a0823190602401602060405180830381865afa158015611980573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a491906120d1565b6119ae9190612053565b9050808710156119bd57600080fd5b6000896000036119db576119d4620f42408361206c565b9050611a12565b6119e76103e88561206c565b8a10156119fa576119d46103e88361206c565b83611a05838c61206c565b611a0f9190612083565b90505b60008111611a1f57600080fd5b9a9950505050505050505050565b6000611a8f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611b7d9092919063ffffffff16565b8051909150156115d25780806020019051810190611aad9190612164565b6115d25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610448565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052610e459085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611550565b6060611b8c8484600085611b94565b949350505050565b606082471015611c0c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610448565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611c3591906121aa565b60006040518083038185875af1925050503d8060008114611c72576040519150601f19603f3d011682016040523d82523d6000602084013e611c77565b606091505b5091509150611c8887838387611c93565b979650505050505050565b60608315611d0f578251600003611d085773ffffffffffffffffffffffffffffffffffffffff85163b611d085760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610448565b5081611b8c565b611b8c8383815115611d245781518083602001fd5b8060405162461bcd60e51b815260040161044891906121c6565b73ffffffffffffffffffffffffffffffffffffffff8116811461107b57600080fd5b60008083601f840112611d7257600080fd5b50813567ffffffffffffffff811115611d8a57600080fd5b602083019150836020828501011115611da257600080fd5b9250929050565b60008060008060008060a08789031215611dc257600080fd5b863595506020870135611dd481611d3e565b94506040870135611de481611d3e565b935060608701359250608087013567ffffffffffffffff811115611e0757600080fd5b611e1389828a01611d60565b979a9699509497509295939492505050565b600060208284031215611e3757600080fd5b5035919050565b600060208284031215611e5057600080fd5b81356114f781611d3e565b60008060208385031215611e6e57600080fd5b823567ffffffffffffffff811115611e8557600080fd5b611e9185828601611d60565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b81811015611ed557835183529284019291840191600101611eb9565b50909695505050505050565b600080600080600060808688031215611ef957600080fd5b853594506020860135611f0b81611d3e565b935060408601359250606086013567ffffffffffffffff811115611f2e57600080fd5b611f3a88828901611d60565b969995985093965092949392505050565b6020808252825182820181905260009190848201906040850190845b81811015611ed557835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611f67565b60008060008060608587031215611faf57600080fd5b843593506020850135611fc181611d3e565b9250604085013567ffffffffffffffff811115611fdd57600080fd5b611fe987828801611d60565b95989497509550505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561206657612066612024565b92915050565b808202811582820484141761206657612066612024565b6000826120b9577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082018082111561206657612066612024565b6000602082840312156120e357600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000806040838503121561212c57600080fd5b825161213781611d3e565b60208401519092506bffffffffffffffffffffffff8116811461215957600080fd5b809150509250929050565b60006020828403121561217657600080fd5b815180151581146114f757600080fd5b60005b838110156121a1578181015183820152602001612189565b50506000910152565b600082516121bc818460208701612186565b9190910192915050565b60208152600082518060208401526121e5816040850160208701612186565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea26469706673582212203f54a0b43b5d6c6b04a10333c2d466d3650e56d0ec16173a7654d3c3435b9f0e64736f6c63430008120033a2646970667358221220fdf85b882ed1fe09317176bb4e54d572a8c198cfe7d8a0746b675841098d47a764736f6c63430008120033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.