Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 389 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Distribute | 20950105 | 41 days ago | IN | 0 ETH | 0.0038986 | ||||
Distribute | 20950010 | 41 days ago | IN | 0 ETH | 0.00201194 | ||||
Distribute | 20878240 | 51 days ago | IN | 0 ETH | 0.00166013 | ||||
Distribute | 20878167 | 51 days ago | IN | 0 ETH | 0.00121666 | ||||
Distribute | 20862546 | 54 days ago | IN | 0 ETH | 0.00112086 | ||||
Distribute | 20850119 | 55 days ago | IN | 0 ETH | 0.00085907 | ||||
Distribute | 20850052 | 55 days ago | IN | 0 ETH | 0.00097013 | ||||
Distribute | 20849971 | 55 days ago | IN | 0 ETH | 0.0006934 | ||||
Distribute | 20844792 | 56 days ago | IN | 0 ETH | 0.00083025 | ||||
Distribute | 20844601 | 56 days ago | IN | 0 ETH | 0.00104532 | ||||
Distribute | 20841748 | 57 days ago | IN | 0 ETH | 0.00119463 | ||||
Distribute | 20834912 | 57 days ago | IN | 0 ETH | 0.00181822 | ||||
Distribute | 20810145 | 61 days ago | IN | 0 ETH | 0.00088805 | ||||
Distribute | 20806206 | 61 days ago | IN | 0 ETH | 0.00143454 | ||||
Distribute | 20798397 | 63 days ago | IN | 0 ETH | 0.00079522 | ||||
Distribute | 20795216 | 63 days ago | IN | 0 ETH | 0.00147054 | ||||
Distribute | 20794633 | 63 days ago | IN | 0 ETH | 0.00089931 | ||||
Distribute | 20788415 | 64 days ago | IN | 0 ETH | 0.00084935 | ||||
Distribute | 20779325 | 65 days ago | IN | 0 ETH | 0.00174517 | ||||
Distribute | 20772424 | 66 days ago | IN | 0 ETH | 0.00234019 | ||||
Distribute | 20771478 | 66 days ago | IN | 0 ETH | 0.0029072 | ||||
Distribute | 20763042 | 68 days ago | IN | 0 ETH | 0.00069163 | ||||
Distribute | 20763035 | 68 days ago | IN | 0 ETH | 0.00064245 | ||||
Distribute | 20763015 | 68 days ago | IN | 0 ETH | 0.00070027 | ||||
Distribute | 20755435 | 69 days ago | IN | 0 ETH | 0.00018918 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
EarningsEscrow
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import { Address } from "@openzeppelin/contracts/utils/Address.sol"; import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Owned } from "./Owned.sol"; import { UUID } from "./libraries/UUID.sol"; /** * @notice Argument type for `distribute` */ struct AssetDistribution { uint128 nonce; uint128 parentNonce; address walletAddress; address assetAddress; uint256 quantity; bytes exchangeSignature; } /** * @notice The EarningsEscrow contract. Holds custody of assets deposited into escrow * and distributes current earnings. */ contract EarningsEscrow is Owned { /** * @notice Emitted when an earnings distribution is paid by calling `distribute` */ event AssetsDistributed(address indexed wallet, uint256 quantity, uint256 totalQuantity, uint128 nonce); /** * @notice Emitted when an admin withdraws assets from escrow with `withdrawEscrow` */ event EscrowWithdrawn(uint256 quantity, uint256 newEscrowBalance); /** * @notice Emitted when an admin changes the Exchange wallet tunable parameter with `setExchange` */ event ExchangeChanged(address previousValue, address newValue); /** * @notice Emitted when this contract receives native asset for escrow */ event NativeAssetEscrowed(address indexed from, uint256 quantity); // The wallet currently whitelisted to sign earnings distributions address public exchangeWallet; // Mapping of wallet => nonce of last distribution mapping(address => uint128) public lastNonce; mapping(address => uint256) public totalDistributed; // Immutable constants // address public immutable assetAddress; /** * @notice Instantiate a new EarningsEscrow * * @dev Sets `owner` and `admin` to `msg.sender` as well as the escrow asset address, * after which they cannot be changed * * @param distributionAssetAddress Address of the escrow asset */ constructor(address distributionAssetAddress, address initialExchangeWallet) Owned() { require( Address.isContract(address(distributionAssetAddress)) || address(distributionAssetAddress) == address(0x0), "Invalid asset address" ); assetAddress = distributionAssetAddress; exchangeWallet = initialExchangeWallet; } receive() external payable { emit NativeAssetEscrowed(msg.sender, msg.value); } /** * @notice Distribute earnings as authorized by the Exchange wallet * * @param distribution The distribution request data */ function distribute(AssetDistribution memory distribution) public { require(distribution.walletAddress == msg.sender, "Invalid caller"); require(distribution.parentNonce != distribution.nonce, "Nonce must be different from parent"); require(distribution.parentNonce == lastNonce[msg.sender], "Invalidated nonce"); require( distribution.parentNonce == 0 || UUID.getTimestampInMsFromUuidV1(distribution.parentNonce) < UUID.getTimestampInMsFromUuidV1(distribution.nonce), "Nonce timestamp must be later than parent" ); require(distribution.assetAddress == assetAddress, "Invalid asset address"); bytes32 hash = _getDistributionHash(distribution); require(_isSignatureValid(hash, distribution.exchangeSignature, exchangeWallet), "Invalid exchange signature"); lastNonce[msg.sender] = distribution.nonce; _transferTo(payable(msg.sender), assetAddress, distribution.quantity); totalDistributed[msg.sender] = totalDistributed[msg.sender] + distribution.quantity; emit AssetsDistributed(msg.sender, distribution.quantity, totalDistributed[msg.sender], distribution.nonce); } /** * @notice Load a wallet's last used distribution nonce * * @param wallet The wallet address to load the nonce for. Can be different from `msg.sender` * * @return The nonce of the last succesful distribution request for this wallet; 0 if no distributions have been made */ function loadLastNonce(address wallet) external view returns (uint128) { require(wallet != address(0x0), "Invalid wallet address"); return lastNonce[wallet]; } /** * @notice Load a wallet's total cumulative distributions * * @param wallet The wallet address to load the total for. Can be different from `msg.sender` * * @return The total amount of distributions made to this wallet; 0 if no distributions have been made */ function loadTotalDistributed(address wallet) external view returns (uint256) { require(wallet != address(0x0), "Invalid wallet address"); return totalDistributed[wallet]; } /** * @notice Withdraw assets previously assigned to escrow in this contract * * @param quantity The quantity of assets to withdraw */ function withdrawEscrow(uint256 quantity) external onlyAdmin { _transferTo(payable(msg.sender), assetAddress, quantity); if (assetAddress == address(0x0)) { emit EscrowWithdrawn(quantity, address(this).balance); } else { emit EscrowWithdrawn(quantity, IERC20(assetAddress).balanceOf(address(this))); } } // Exchange whitelisting // /** * @notice Sets the wallet whitelisted to sign earning distributions * * @param newExchangeWallet The new whitelisted Exchage wallet. Must be different from the current one */ function setExchange(address newExchangeWallet) external onlyAdmin { require(newExchangeWallet != address(0x0), "Invalid wallet address"); require(newExchangeWallet != exchangeWallet, "Must be different from current exchange"); address oldExchangeWallet = exchangeWallet; exchangeWallet = newExchangeWallet; emit ExchangeChanged(oldExchangeWallet, newExchangeWallet); } /** * @notice Clears the currently whitelisted Exchange wallet, effectively disabling the * `distribute` function until a new wallet is set with `setExchange` */ function removeExchange() external onlyAdmin { emit ExchangeChanged(exchangeWallet, address(0x0)); exchangeWallet = address(0x0); } function _getDistributionHash(AssetDistribution memory distribution) private view returns (bytes32) { return keccak256( abi.encodePacked( address(this), distribution.nonce, distribution.parentNonce, distribution.walletAddress, distribution.assetAddress, distribution.quantity ) ); } function _isSignatureValid(bytes32 hash, bytes memory signature, address signer) private pure returns (bool) { return ECDSA.recover(ECDSA.toEthSignedMessageHash(hash), signature) == signer; } function _transferTo(address payable walletOrContract, address asset, uint256 quantityInAssetUnits) private { if (asset == address(0x0)) { (bool success, ) = walletOrContract.call{ value: quantityInAssetUnits }(""); require(success, "Native asset transfer failed"); } else { require(IERC20(asset).transfer(walletOrContract, quantityInAssetUnits), "Token transfer failed"); } } }
// 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) (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); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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. If 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)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 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) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; /** * Library helper for extracting timestamp component of Version 1 UUIDs */ library UUID { /** * Extracts the timestamp component of a Version 1 UUID. Used to make time-based assertions * against a wallet-provided nonce */ function getTimestampInMsFromUuidV1(uint128 uuid) internal pure returns (uint64 msSinceUnixEpoch) { // https://tools.ietf.org/html/rfc4122#section-4.1.2 uint128 version = (uuid >> 76) & 0x0000000000000000000000000000000F; require(version == 1, "Must be v1 UUID"); // Time components are in reverse order so shift+mask each to reassemble uint128 timeHigh = (uuid >> 16) & 0x00000000000000000FFF000000000000; uint128 timeMid = (uuid >> 48) & 0x00000000000000000000FFFF00000000; uint128 timeLow = (uuid >> 96) & 0x000000000000000000000000FFFFFFFF; uint128 nsSinceGregorianEpoch = (timeHigh | timeMid | timeLow); // Gregorian offset given in seconds by https://www.wolframalpha.com/input/?i=convert+1582-10-15+UTC+to+unix+time msSinceUnixEpoch = uint64(nsSinceGregorianEpoch / 10000) - 12219292800000; return msSinceUnixEpoch; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; /** * @notice Mixin that provide separate owner and admin roles for RBAC */ abstract contract Owned { address public ownerWallet; address public adminWallet; modifier onlyOwner() { require(msg.sender == ownerWallet, "Caller must be Owner wallet"); _; } modifier onlyAdmin() { require(msg.sender == adminWallet, "Caller must be Admin wallet"); _; } /** * @notice Sets both the owner and admin roles to the contract creator */ constructor() { ownerWallet = msg.sender; adminWallet = msg.sender; } /** * @notice Sets a new whitelisted admin wallet * * @param newAdmin The new whitelisted admin wallet. Must be different from the current one */ function setAdmin(address newAdmin) external onlyOwner { require(newAdmin != address(0x0), "Invalid wallet address"); require(newAdmin != adminWallet, "Must be different from current admin"); adminWallet = newAdmin; } /** * @notice Sets a new owner wallet * * @param newOwner The new owner wallet. Must be different from the current one */ function setOwner(address newOwner) external onlyOwner { require(newOwner != address(0x0), "Invalid wallet address"); require(newOwner != ownerWallet, "Must be different from current owner"); ownerWallet = newOwner; } /** * @notice Clears the currently whitelisted admin wallet, effectively disabling any functions requiring * the admin role */ function removeAdmin() external onlyOwner { adminWallet = address(0x0); } /** * @notice Permanently clears the owner wallet, effectively disabling any functions requiring the owner role */ function removeOwner() external onlyOwner { ownerWallet = address(0x0); } }
{ "optimizer": { "enabled": true, "runs": 1000000 }, "viaIR": true, "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":"distributionAssetAddress","type":"address"},{"internalType":"address","name":"initialExchangeWallet","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalQuantity","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"nonce","type":"uint128"}],"name":"AssetsDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newEscrowBalance","type":"uint256"}],"name":"EscrowWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousValue","type":"address"},{"indexed":false,"internalType":"address","name":"newValue","type":"address"}],"name":"ExchangeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"NativeAssetEscrowed","type":"event"},{"inputs":[],"name":"adminWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"assetAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint128","name":"nonce","type":"uint128"},{"internalType":"uint128","name":"parentNonce","type":"uint128"},{"internalType":"address","name":"walletAddress","type":"address"},{"internalType":"address","name":"assetAddress","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes","name":"exchangeSignature","type":"bytes"}],"internalType":"struct AssetDistribution","name":"distribution","type":"tuple"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exchangeWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastNonce","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"loadLastNonce","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"loadTotalDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownerWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"removeExchange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"removeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newExchangeWallet","type":"address"}],"name":"setExchange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"withdrawEscrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a0346200011b57601f62001a6538819003918201601f19168301916001600160401b03831184841017620001205780849260409485528339810103126200011b576200005a6020620000528362000136565b920162000136565b60018060a01b0319913383600054161760005533836001541617600155803b1580159062000109575b15620000c45760805260018060a01b031690600254161760025560405161191990816200014c823960805181818161030a015281816106ff01526110420152f35b60405162461bcd60e51b815260206004820152601560248201527f496e76616c6964206173736574206164647265737300000000000000000000006044820152606490fd5b506001600160a01b0381161562000083565b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036200011b5756fe604060808152600480361015610048575b50361561001c57600080fd5b513481527f0a8c8924156913e023ad70436eefd6bcb9e9c239d018873b802a53ba9a13f1a760203392a2005b600090813560e01c90816313af4035146110665781631ba46cfd14610ff7578163246f8b9614610f7e57816332f3822014610eff57816336b19cd714610eac5781634e17aff114610e3f5781634ea3b64214610d8e57816355ef1df214610d3b57816367b1f5df14610be5578163689537ad14610565578163704b6c021461043f578163876512d0146102ae5781638b8dfa3914610248575080639335dcb7146101f75780639a202d47146101785763c0fd43b4036100105790346101745760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610174576fffffffffffffffffffffffffffffffff8160209373ffffffffffffffffffffffffffffffffffffffff610163611187565b168152600385522054169051908152f35b5080fd5b50346101f457807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f4576101c973ffffffffffffffffffffffffffffffffffffffff825416331461177f565b7fffffffffffffffffffffffff00000000000000000000000000000000000000006001541660015580f35b80fd5b50903461017457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101745773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b839150346102aa5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102aa57602092829173ffffffffffffffffffffffffffffffffffffffff61029c611187565b168252845220549051908152f35b8280fd5b905082346102aa576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043b5782359073ffffffffffffffffffffffffffffffffffffffff610308816001541633146112fc565b7f00000000000000000000000000000000000000000000000000000000000000006103348482336115ce565b16938461036d57507f6cc3dcf57e22ef185db53998d2e562b5c74fe32221d2301dee7120eb17be22ab935047908351928352820152a180f35b819060248551809781937f70a0823100000000000000000000000000000000000000000000000000000000835230908301525afa9081156104315785916103de575b7f6cc3dcf57e22ef185db53998d2e562b5c74fe32221d2301dee7120eb17be22ab94508351928352820152a180f35b80915084813d831161042a575b6103f581836111d0565b81010312610426577f6cc3dcf57e22ef185db53998d2e562b5c74fe32221d2301dee7120eb17be22ab9351906103af565b8480fd5b503d6103eb565b83513d87823e3d90fd5b8380fd5b839150346102aa5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102aa57610479611187565b9073ffffffffffffffffffffffffffffffffffffffff809261049f82875416331461177f565b16926104ac841515611297565b60015492831684146104e35750507fffffffffffffffffffffffff0000000000000000000000000000000000000000161760015580f35b90602060849251917f08c379a00000000000000000000000000000000000000000000000000000000083528201526024808201527f4d75737420626520646966666572656e742066726f6d2063757272656e74206160448201527f646d696e000000000000000000000000000000000000000000000000000000006064820152fd5b9050346101745760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc93818536011261043b5782359267ffffffffffffffff95868511610be15760c09085360301126104265781519360c0850185811088821117610bb55783526105d8818301611240565b85526024916105e8838301611240565b9785870198895260446105fc8185016111af565b908689019182526064906106118287016111af565b9360608b0194855260808b01966084810135885260a481013590828211610bb157019036602383011215610bad578682013561064c8161125d565b926106598c5194856111d0565b818452368b8383010111610ba957818f928c8f9301838701378401015260a08c0191825273ffffffffffffffffffffffffffffffffffffffff91828651163303610b4e578c9d9e6fffffffffffffffffffffffffffffffff9d9a9b9c9d9a8b8083511691511614610acb578f8b8f918f90600383865116943383525220541603610a6f578e8b82511690848d8315938415610a49575b50505050156109c65783885116977f000000000000000000000000000000000000000000000000000000000000000098858a160361096957908f8f959493928f91519251995190518d519251978801933060601b85527fffffffffffffffffffffffffffffffff000000000000000000000000000000009b8c809260801b1660348b015260801b16898901527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16605489015260601b166068870152607c860152607c855260a08501908582108483111761093b57818f528551902091519261010085600254169660c08101947f19457468657265756d205369676e6564204d6573736167653a0a333200000000865260dc820152603c845201908282109082111761093b578e525190206108349161082c916114fa565b919091611361565b16036108e35750509061085f91858a5116338c5260038a52888c2091825416179055835190336115ce565b3388528086528488205493825185018095116108b9575033885285528284882055519451169282519485528401528201527f8189c1c936127b9ba440981e4c0593868f8fa969cab1538e47c81ff8a2c2391a60603392a280f35b886011837f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b7f496e76616c69642065786368616e6765207369676e61747572650000000000008591601a8a8d8d51957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b5050508a8f60418a7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b50505050507f496e76616c696420617373657420616464726573730000000000000000000000859160158a8d8d51957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b505050507f616e20706172656e7400000000000000000000000000000000000000000000006084927f4e6f6e63652074696d657374616d70206d757374206265206c61746572207468879360298c8f8f51977f08c379a0000000000000000000000000000000000000000000000000000000008952880152860152840152820152fd5b8293945090610a5a610a62926117e4565b9451166117e4565b169116108f848d386106ef565b505050507f496e76616c696461746564206e6f6e6365000000000000000000000000000000859160118a8d8d51957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b505050507f656e7400000000000000000000000000000000000000000000000000000000006084927f4e6f6e6365206d75737420626520646966666572656e742066726f6d20706172879360238c8f8f51977f08c379a0000000000000000000000000000000000000000000000000000000008952880152860152840152820152fd5b5050507f496e76616c69642063616c6c65720000000000000000000000000000000000008591600e898c8c51957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b8e80fd5b8c80fd5b8d80fd5b6024876041857f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8580fd5b8284346101745760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017457610c1e611187565b9273ffffffffffffffffffffffffffffffffffffffff8094610c45826001541633146112fc565b16610c51811515611297565b60025494851691828214610cb85750807fffffffffffffffffffffffff00000000000000000000000000000000000000007f28acb18d00680c2516118d7bcca789e3fda00d9203aa3e9c39df6961e1e3d73c9596161760025582519182526020820152a180f35b60849060208551917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602760248201527f4d75737420626520646966666572656e742066726f6d2063757272656e74206560448201527f786368616e6765000000000000000000000000000000000000000000000000006064820152fd5b82843461017457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101745760209073ffffffffffffffffffffffffffffffffffffffff600254169051908152f35b82843461017457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610174577fffffffffffffffffffffffff0000000000000000000000000000000000000000907f28acb18d00680c2516118d7bcca789e3fda00d9203aa3e9c39df6961e1e3d73c73ffffffffffffffffffffffffffffffffffffffff91610e26836001541633146112fc565b6002549281519084168152856020820152a11660025580f35b839150346102aa5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102aa57602092829173ffffffffffffffffffffffffffffffffffffffff610e93611187565b16610e9f811515611297565b8252845220549051908152f35b82843461017457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101745760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b8284346101745760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610174576fffffffffffffffffffffffffffffffff8160209373ffffffffffffffffffffffffffffffffffffffff610f62611187565b16610f6e811515611297565b8152600385522054169051908152f35b82346101f457807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f4577fffffffffffffffffffffffff00000000000000000000000000000000000000008154610ff173ffffffffffffffffffffffffffffffffffffffff8216331461177f565b16815580f35b82843461017457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610174576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b905082346102aa5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102aa576110a0611187565b9183549173ffffffffffffffffffffffffffffffffffffffff808416946110c886331461177f565b16936110d5851515611297565b84146111055750507fffffffffffffffffffffffff00000000000000000000000000000000000000001617815580f35b90602060849251917f08c379a00000000000000000000000000000000000000000000000000000000083528201526024808201527f4d75737420626520646966666572656e742066726f6d2063757272656e74206f60448201527f776e6572000000000000000000000000000000000000000000000000000000006064820152fd5b6004359073ffffffffffffffffffffffffffffffffffffffff821682036111aa57565b600080fd5b359073ffffffffffffffffffffffffffffffffffffffff821682036111aa57565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761121157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b35906fffffffffffffffffffffffffffffffff821682036111aa57565b67ffffffffffffffff811161121157601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b1561129e57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c69642077616c6c65742061646472657373000000000000000000006044820152fd5b1561130357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43616c6c6572206d7573742062652041646d696e2077616c6c657400000000006044820152fd5b60058110156114cb57806113725750565b600181036113d85760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152fd5b6002810361143e5760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152fd5b60031461144757565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b90604181511460001461152857611524916020820151906060604084015193015160001a90611532565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116115c25791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156115b557815173ffffffffffffffffffffffffffffffffffffffff8116156115af579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b73ffffffffffffffffffffffffffffffffffffffff9182168061168a57506000809381938293165af13d15611685573d6116078161125d565b9061161560405192836111d0565b8152600060203d92013e5b1561162757565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4e6174697665206173736574207472616e73666572206661696c6564000000006044820152fd5b611620565b91604093919351937fa9059cbb0000000000000000000000000000000000000000000000000000000085521660048401526024830152602082604481600080955af19182156115b5578192611741575b5050156116e357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f546f6b656e207472616e73666572206661696c656400000000000000000000006044820152fd5b9091506020813d8211611777575b8161175c602093836111d0565b8101031261017457519081151582036101f4575038806116da565b3d915061174f565b1561178657565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43616c6c6572206d757374206265204f776e65722077616c6c657400000000006044820152fd5b6001600f82604c1c1603611885577ffffffffffffffffffffffffffffffffffffffffffffffffffffff4e2f964ac006127109167ffffffffffffffff928163ffffffff65ffff00000000869460301c16670fff0000000000008360101c16179160601c16170416019081116118565790565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4d757374206265207631205555494400000000000000000000000000000000006044820152fdfea264697066735822122014066c61d3eb6dabf44d07d062189c5437f6e662e242e87a7fc9eb5590092d4864736f6c63430008120033000000000000000000000000b705268213d593b8fd88d3fdeff93aff5cbdcfae0000000000000000000000000c3588bdcd2f262cc606635eff5a3c9506455bc2
Deployed Bytecode
0x604060808152600480361015610048575b50361561001c57600080fd5b513481527f0a8c8924156913e023ad70436eefd6bcb9e9c239d018873b802a53ba9a13f1a760203392a2005b600090813560e01c90816313af4035146110665781631ba46cfd14610ff7578163246f8b9614610f7e57816332f3822014610eff57816336b19cd714610eac5781634e17aff114610e3f5781634ea3b64214610d8e57816355ef1df214610d3b57816367b1f5df14610be5578163689537ad14610565578163704b6c021461043f578163876512d0146102ae5781638b8dfa3914610248575080639335dcb7146101f75780639a202d47146101785763c0fd43b4036100105790346101745760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610174576fffffffffffffffffffffffffffffffff8160209373ffffffffffffffffffffffffffffffffffffffff610163611187565b168152600385522054169051908152f35b5080fd5b50346101f457807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f4576101c973ffffffffffffffffffffffffffffffffffffffff825416331461177f565b7fffffffffffffffffffffffff00000000000000000000000000000000000000006001541660015580f35b80fd5b50903461017457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101745773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b839150346102aa5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102aa57602092829173ffffffffffffffffffffffffffffffffffffffff61029c611187565b168252845220549051908152f35b8280fd5b905082346102aa576020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261043b5782359073ffffffffffffffffffffffffffffffffffffffff610308816001541633146112fc565b7f000000000000000000000000b705268213d593b8fd88d3fdeff93aff5cbdcfae6103348482336115ce565b16938461036d57507f6cc3dcf57e22ef185db53998d2e562b5c74fe32221d2301dee7120eb17be22ab935047908351928352820152a180f35b819060248551809781937f70a0823100000000000000000000000000000000000000000000000000000000835230908301525afa9081156104315785916103de575b7f6cc3dcf57e22ef185db53998d2e562b5c74fe32221d2301dee7120eb17be22ab94508351928352820152a180f35b80915084813d831161042a575b6103f581836111d0565b81010312610426577f6cc3dcf57e22ef185db53998d2e562b5c74fe32221d2301dee7120eb17be22ab9351906103af565b8480fd5b503d6103eb565b83513d87823e3d90fd5b8380fd5b839150346102aa5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102aa57610479611187565b9073ffffffffffffffffffffffffffffffffffffffff809261049f82875416331461177f565b16926104ac841515611297565b60015492831684146104e35750507fffffffffffffffffffffffff0000000000000000000000000000000000000000161760015580f35b90602060849251917f08c379a00000000000000000000000000000000000000000000000000000000083528201526024808201527f4d75737420626520646966666572656e742066726f6d2063757272656e74206160448201527f646d696e000000000000000000000000000000000000000000000000000000006064820152fd5b9050346101745760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc93818536011261043b5782359267ffffffffffffffff95868511610be15760c09085360301126104265781519360c0850185811088821117610bb55783526105d8818301611240565b85526024916105e8838301611240565b9785870198895260446105fc8185016111af565b908689019182526064906106118287016111af565b9360608b0194855260808b01966084810135885260a481013590828211610bb157019036602383011215610bad578682013561064c8161125d565b926106598c5194856111d0565b818452368b8383010111610ba957818f928c8f9301838701378401015260a08c0191825273ffffffffffffffffffffffffffffffffffffffff91828651163303610b4e578c9d9e6fffffffffffffffffffffffffffffffff9d9a9b9c9d9a8b8083511691511614610acb578f8b8f918f90600383865116943383525220541603610a6f578e8b82511690848d8315938415610a49575b50505050156109c65783885116977f000000000000000000000000b705268213d593b8fd88d3fdeff93aff5cbdcfae98858a160361096957908f8f959493928f91519251995190518d519251978801933060601b85527fffffffffffffffffffffffffffffffff000000000000000000000000000000009b8c809260801b1660348b015260801b16898901527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16605489015260601b166068870152607c860152607c855260a08501908582108483111761093b57818f528551902091519261010085600254169660c08101947f19457468657265756d205369676e6564204d6573736167653a0a333200000000865260dc820152603c845201908282109082111761093b578e525190206108349161082c916114fa565b919091611361565b16036108e35750509061085f91858a5116338c5260038a52888c2091825416179055835190336115ce565b3388528086528488205493825185018095116108b9575033885285528284882055519451169282519485528401528201527f8189c1c936127b9ba440981e4c0593868f8fa969cab1538e47c81ff8a2c2391a60603392a280f35b886011837f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b7f496e76616c69642065786368616e6765207369676e61747572650000000000008591601a8a8d8d51957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b5050508a8f60418a7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b50505050507f496e76616c696420617373657420616464726573730000000000000000000000859160158a8d8d51957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b505050507f616e20706172656e7400000000000000000000000000000000000000000000006084927f4e6f6e63652074696d657374616d70206d757374206265206c61746572207468879360298c8f8f51977f08c379a0000000000000000000000000000000000000000000000000000000008952880152860152840152820152fd5b8293945090610a5a610a62926117e4565b9451166117e4565b169116108f848d386106ef565b505050507f496e76616c696461746564206e6f6e6365000000000000000000000000000000859160118a8d8d51957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b505050507f656e7400000000000000000000000000000000000000000000000000000000006084927f4e6f6e6365206d75737420626520646966666572656e742066726f6d20706172879360238c8f8f51977f08c379a0000000000000000000000000000000000000000000000000000000008952880152860152840152820152fd5b5050507f496e76616c69642063616c6c65720000000000000000000000000000000000008591600e898c8c51957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b8e80fd5b8c80fd5b8d80fd5b6024876041857f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8580fd5b8284346101745760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017457610c1e611187565b9273ffffffffffffffffffffffffffffffffffffffff8094610c45826001541633146112fc565b16610c51811515611297565b60025494851691828214610cb85750807fffffffffffffffffffffffff00000000000000000000000000000000000000007f28acb18d00680c2516118d7bcca789e3fda00d9203aa3e9c39df6961e1e3d73c9596161760025582519182526020820152a180f35b60849060208551917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602760248201527f4d75737420626520646966666572656e742066726f6d2063757272656e74206560448201527f786368616e6765000000000000000000000000000000000000000000000000006064820152fd5b82843461017457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101745760209073ffffffffffffffffffffffffffffffffffffffff600254169051908152f35b82843461017457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610174577fffffffffffffffffffffffff0000000000000000000000000000000000000000907f28acb18d00680c2516118d7bcca789e3fda00d9203aa3e9c39df6961e1e3d73c73ffffffffffffffffffffffffffffffffffffffff91610e26836001541633146112fc565b6002549281519084168152856020820152a11660025580f35b839150346102aa5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102aa57602092829173ffffffffffffffffffffffffffffffffffffffff610e93611187565b16610e9f811515611297565b8252845220549051908152f35b82843461017457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101745760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b8284346101745760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610174576fffffffffffffffffffffffffffffffff8160209373ffffffffffffffffffffffffffffffffffffffff610f62611187565b16610f6e811515611297565b8152600385522054169051908152f35b82346101f457807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f4577fffffffffffffffffffffffff00000000000000000000000000000000000000008154610ff173ffffffffffffffffffffffffffffffffffffffff8216331461177f565b16815580f35b82843461017457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610174576020905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000b705268213d593b8fd88d3fdeff93aff5cbdcfae168152f35b905082346102aa5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102aa576110a0611187565b9183549173ffffffffffffffffffffffffffffffffffffffff808416946110c886331461177f565b16936110d5851515611297565b84146111055750507fffffffffffffffffffffffff00000000000000000000000000000000000000001617815580f35b90602060849251917f08c379a00000000000000000000000000000000000000000000000000000000083528201526024808201527f4d75737420626520646966666572656e742066726f6d2063757272656e74206f60448201527f776e6572000000000000000000000000000000000000000000000000000000006064820152fd5b6004359073ffffffffffffffffffffffffffffffffffffffff821682036111aa57565b600080fd5b359073ffffffffffffffffffffffffffffffffffffffff821682036111aa57565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761121157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b35906fffffffffffffffffffffffffffffffff821682036111aa57565b67ffffffffffffffff811161121157601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b1561129e57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c69642077616c6c65742061646472657373000000000000000000006044820152fd5b1561130357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43616c6c6572206d7573742062652041646d696e2077616c6c657400000000006044820152fd5b60058110156114cb57806113725750565b600181036113d85760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152fd5b6002810361143e5760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152fd5b60031461144757565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b90604181511460001461152857611524916020820151906060604084015193015160001a90611532565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116115c25791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156115b557815173ffffffffffffffffffffffffffffffffffffffff8116156115af579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b73ffffffffffffffffffffffffffffffffffffffff9182168061168a57506000809381938293165af13d15611685573d6116078161125d565b9061161560405192836111d0565b8152600060203d92013e5b1561162757565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4e6174697665206173736574207472616e73666572206661696c6564000000006044820152fd5b611620565b91604093919351937fa9059cbb0000000000000000000000000000000000000000000000000000000085521660048401526024830152602082604481600080955af19182156115b5578192611741575b5050156116e357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f546f6b656e207472616e73666572206661696c656400000000000000000000006044820152fd5b9091506020813d8211611777575b8161175c602093836111d0565b8101031261017457519081151582036101f4575038806116da565b3d915061174f565b1561178657565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43616c6c6572206d757374206265204f776e65722077616c6c657400000000006044820152fd5b6001600f82604c1c1603611885577ffffffffffffffffffffffffffffffffffffffffffffffffffffff4e2f964ac006127109167ffffffffffffffff928163ffffffff65ffff00000000869460301c16670fff0000000000008360101c16179160601c16170416019081116118565790565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4d757374206265207631205555494400000000000000000000000000000000006044820152fdfea264697066735822122014066c61d3eb6dabf44d07d062189c5437f6e662e242e87a7fc9eb5590092d4864736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b705268213d593b8fd88d3fdeff93aff5cbdcfae0000000000000000000000000c3588bdcd2f262cc606635eff5a3c9506455bc2
-----Decoded View---------------
Arg [0] : distributionAssetAddress (address): 0xB705268213D593B8FD88d3FDEFF93AFF5CbDcfAE
Arg [1] : initialExchangeWallet (address): 0x0C3588bDCD2f262CC606635EfF5A3C9506455bC2
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b705268213d593b8fd88d3fdeff93aff5cbdcfae
Arg [1] : 0000000000000000000000000c3588bdcd2f262cc606635eff5a3c9506455bc2
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.041872 | 87,350 | $3,657.54 |
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.