Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 149 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Grant Access | 8581542 | 25 days ago | IN | 0 ETH | 0.00000275 | ||||
Grant Access | 8163055 | 39 days ago | IN | 0 ETH | 0.00000819 | ||||
Grant Access | 8162197 | 39 days ago | IN | 0 ETH | 0.00000815 | ||||
Grant Access | 8161731 | 39 days ago | IN | 0 ETH | 0.00000715 | ||||
Grant Access | 8125718 | 40 days ago | IN | 0 ETH | 0.00000529 | ||||
Grant Access | 7963121 | 45 days ago | IN | 0 ETH | 0.00000461 | ||||
Grant Access | 7711374 | 54 days ago | IN | 0 ETH | 0.00000719 | ||||
Grant Access | 7525550 | 60 days ago | IN | 0 ETH | 0.00001516 | ||||
Grant Access | 7421853 | 63 days ago | IN | 0 ETH | 0.0000139 | ||||
Grant Access | 7363672 | 65 days ago | IN | 0 ETH | 0.00000754 | ||||
Grant Access | 7358199 | 65 days ago | IN | 0 ETH | 0.00000692 | ||||
Grant Access | 7341144 | 66 days ago | IN | 0 ETH | 0.00000728 | ||||
Grant Access | 7273077 | 68 days ago | IN | 0 ETH | 0.00001022 | ||||
Grant Access | 7266642 | 68 days ago | IN | 0 ETH | 0.00000962 | ||||
Grant Access | 7257605 | 69 days ago | IN | 0 ETH | 0.00000622 | ||||
Grant Access | 7257597 | 69 days ago | IN | 0 ETH | 0.00000963 | ||||
Grant Access | 7236094 | 69 days ago | IN | 0 ETH | 0.00000933 | ||||
Grant Access | 7211045 | 70 days ago | IN | 0 ETH | 0.00000928 | ||||
Grant Access | 7195496 | 71 days ago | IN | 0 ETH | 0.00000626 | ||||
Grant Access | 7195494 | 71 days ago | IN | 0 ETH | 0.00000976 | ||||
Grant Access | 7162075 | 72 days ago | IN | 0 ETH | 0.00009399 | ||||
Grant Access | 7155607 | 72 days ago | IN | 0 ETH | 0.00002443 | ||||
Grant Access | 7155271 | 72 days ago | IN | 0 ETH | 0.0000154 | ||||
Grant Access | 7106371 | 74 days ago | IN | 0 ETH | 0.00003392 | ||||
Grant Access | 7100145 | 74 days ago | IN | 0 ETH | 0.00001401 |
Loading...
Loading
Contract Name:
AccessManager
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 10000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "./interfaces/IAccessManager.sol"; import "./dao/interfaces/IDAO.sol"; import "./SigningTools.sol"; // A simple AccessManager in which user IP is mapped offchain to a geolocation and then whitelisted user status is stored in the contract. // If geographic regions are later excluded, users are required to reverify (allowing avoiding storing countries for specific wallets and potentially violating user privacy). // The AccessManager restricts users from adding liquidity, and staking - but always allows existing assets to be removed (in case a user's region is restricted after depositing assets). // // This contract can be replaced by the DAO with other mechanics such as completely open access, decentralized ID services, KYC by region, or whatever else deemed the best option by the DAO. // // Making proposals and voting is not access restricted - just in case AccessManager.sol is ever updated with a flaw in it that universally blocks access (which would effectively cripple the DAO if proposals and voting were then mistakingly restricted). // // Updateable using DAO.proposeSetAccessManager( "accessManager" ) contract AccessManager is IAccessManager { event AccessGranted(address indexed wallet, uint256 geoVersion); IDAO immutable public dao; // Determines granted access for [geoVersion][wallet] mapping(uint256 => mapping(address => bool)) private _walletsWithAccess; // The current geoVersion for the AccessManager - which is incremented when new countries are excluded by the DAO. uint256 public geoVersion; constructor( IDAO _dao ) { dao = _dao; } // Called whenever the DAO updates the list of excluded countries. // This effectively clears access for all users as the geoVersion is used to reference _walletsWithAccess. // If, in contrast, new countries are included, then updating the geoVersion isn't necessary as the existing _walletsWithAccess will still be valid. function excludedCountriesUpdated() external { require( msg.sender == address(dao), "AccessManager.excludedCountriedUpdated only callable by the DAO" ); geoVersion += 1; } // Verify that the access request was signed by the authoratative signer. // Note that this is only a simplistic default mechanism and can be changed by the DAO at any time (either altering the regional restrictions themselves or replacing the access mechanism entirely). function _verifyAccess(address wallet, bytes memory signature ) internal view returns (bool) { bytes32 messageHash = keccak256(abi.encodePacked(block.chainid, geoVersion, wallet)); return SigningTools._verifySignature(messageHash, signature); } // Grant access to the sender for the given geoVersion. // Requires the accompanying correct message signature from the offchain verifier. function grantAccess(bytes calldata signature) external { require( _verifyAccess(msg.sender, signature), "Incorrect AccessManager.grantAccess signatory" ); _walletsWithAccess[geoVersion][msg.sender] = true; emit AccessGranted( msg.sender, geoVersion ); } // === VIEWS === // Returns true if the wallet has access at the current geoVersion function walletHasAccess(address wallet) external view returns (bool) { return _walletsWithAccess[geoVersion][wallet]; } }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; interface IAccessManager { function excludedCountriesUpdated() external; function grantAccess(bytes calldata signature) external; // Views function geoVersion() external view returns (uint256); function walletHasAccess(address wallet) external view returns (bool); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "../../rewards/interfaces/IZeroRewards.sol"; import "../../pools/interfaces/IPools.sol"; import "../../interfaces/IZero.sol"; interface IDAO { function finalizeBallot( uint256 ballotID ) external; function manuallyRemoveBallot( uint256 ballotID ) external; function withdrawFromDAO( IERC20 token ) external returns (uint256 withdrawnAmount); // Views function pools() external view returns (IPools); function websiteURL() external view returns (string memory); function countryIsExcluded( string calldata country ) external view returns (bool); }
pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol"; library SigningTools { // The public address of the signer for verfication of BootstrapBallot voting and default AccessManager address constant public EXPECTED_SIGNER = 0x1234519DCA2ef23207E1CA7fd70b96f281893bAa; // Verify that the messageHash was signed by the authoratative signer. function _verifySignature(bytes32 messageHash, bytes memory signature ) internal pure returns (bool) { bytes32 r; bytes32 s; uint8 v; assembly { r := mload (add (signature, 0x20)) s := mload (add (signature, 0x40)) v := mload (add (signature, 0x41)) } address recoveredAddress = ECDSA.recover(messageHash, v, r, s); return (recoveredAddress == EXPECTED_SIGNER); } }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "./IRewardsEmitter.sol"; interface IZeroRewards { function sendInitialZERORewards( uint256 liquidityBootstrapAmount, bytes32[] calldata poolIDs ) external; function performUpkeep( bytes32[] calldata poolIDs, uint256[] calldata profitsForPools ) external; // Views function stakingRewardsEmitter() external view returns (IRewardsEmitter); function liquidityRewardsEmitter() external view returns (IRewardsEmitter); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "../../staking/interfaces/ILiquidity.sol"; import "../../dao/interfaces/IDAO.sol"; import "./IPoolStats.sol"; interface IPools is IPoolStats { function startExchangeApproved() external; function setContracts( IDAO _dao, ILiquidity _liquidity ) external; // onlyOwner function addLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 maxAmountA, uint256 maxAmountB, uint256 minAddedAmountA, uint256 minAddedAmountB, uint256 totalLiquidity ) external returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity); function removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external returns (uint256 reclaimedA, uint256 reclaimedB); function deposit( IERC20 token, uint256 amount ) external; function withdraw( IERC20 token, uint256 amount ) external; function swap( IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut); function depositSwapWithdraw(IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut); function depositDoubleSwapWithdraw( IERC20 swapTokenIn, IERC20 swapTokenMiddle, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut); function depositZapSwapWithdraw(IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn ) external returns (uint256 swapAmountOut); // Views function exchangeIsLive() external view returns (bool); function getPoolReserves(IERC20 tokenA, IERC20 tokenB) external view returns (uint256 reserveA, uint256 reserveB); function depositedUserBalance(address user, IERC20 token) external view returns (uint256); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; interface IZero is IERC20 { function burnTokensInContract() external; // Views function totalBurned() external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @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 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "../../staking/interfaces/IStakingRewards.sol"; interface IRewardsEmitter { function addZERORewards( AddedReward[] calldata addedRewards ) external; function performUpkeep( uint256 timeSinceLastUpkeep ) external; // Views function pendingRewardsForPools( bytes32[] calldata pools ) external view returns (uint256[] calldata); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import "./IStakingRewards.sol"; interface ILiquidity is IStakingRewards { function depositLiquidityAndIncreaseShare( IERC20 tokenA, IERC20 tokenB, uint256 maxAmountA, uint256 maxAmountB, uint256 minAddedAmountA, uint256 minAddedAmountB, uint256 minAddedLiquidity, uint256 deadline, bool useZapping ) external returns (uint256 addedLiquidity); function withdrawLiquidityAndClaim( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToWithdraw, uint256 minReclaimedA, uint256 minReclaimedB, uint256 deadline ) external returns (uint256 reclaimedA, uint256 reclaimedB); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; interface IPoolStats { // These are the indicies (in terms of a poolIDs location in the current whitelistedPoolIDs array) of pools involved in an arbitrage path struct ArbitrageIndicies { uint64 index1; uint64 index2; uint64 index3; } function clearProfitsForPools() external; function updateArbitrageIndicies() external; // Views function profitsForWhitelistedPools() external view returns (uint256[] memory _calculatedProfits); function arbitrageIndicies(bytes32 poolID) external view returns (ArbitrageIndicies memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.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 `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @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); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; struct AddedReward { bytes32 poolID; // The pool to add rewards to uint256 amountToAdd; // The amount of rewards (as ZERO) to add } struct UserShareInfo { uint256 userShare; // A user's share for a given poolID uint256 virtualRewards; // The amount of rewards that were added to maintain proper rewards/share ratio - and will be deducted from a user's pending rewards. uint256 cooldownExpiration; // The timestamp when the user can modify their share } interface IStakingRewards { function claimAllRewards( bytes32[] calldata poolIDs ) external returns (uint256 rewardsAmount); function addZERORewards( AddedReward[] calldata addedRewards ) external; // Views function totalShares(bytes32 poolID) external view returns (uint256); function totalSharesForPools( bytes32[] calldata poolIDs ) external view returns (uint256[] calldata shares); function totalRewardsForPools( bytes32[] calldata poolIDs ) external view returns (uint256[] calldata rewards); function userRewardForPool( address wallet, bytes32 poolID ) external view returns (uint256); function userShareForPool( address wallet, bytes32 poolID ) external view returns (uint256); function userVirtualRewardsForPool( address wallet, bytes32 poolID ) external view returns (uint256); function userRewardsForPools( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata rewards); function userShareForPools( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata shares); function userCooldowns( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata cooldowns); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 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 256, 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 << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
{ "remappings": [ "chainlink/=lib/chainlink/", "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/openzeppelin-contracts/contracts/", "v3-core/=lib/v3-core/contracts/" ], "optimizer": { "enabled": true, "runs": 10000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IDAO","name":"_dao","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"geoVersion","type":"uint256"}],"name":"AccessGranted","type":"event"},{"inputs":[],"name":"dao","outputs":[{"internalType":"contract IDAO","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"excludedCountriesUpdated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"geoVersion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"grantAccess","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"walletHasAccess","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b506040516108fa3803806108fa83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161086961009160003960008181607101526102b301526108696000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063783af99711610050578063783af997146100d2578063a5e293b0146100da578063cf4a6651146100f157600080fd5b80634162169f1461006c5780634e25bada146100bd575b600080fd5b6100937f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100d06100cb36600461071b565b610146565b005b6100d061029b565b6100e360015481565b6040519081526020016100b4565b6101366100ff36600461078d565b60015460009081526020818152604080832073ffffffffffffffffffffffffffffffffffffffff9094168352929052205460ff1690565b60405190151581526020016100b4565b6101863383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061037992505050565b610217576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f496e636f7272656374204163636573734d616e616765722e6772616e7441636360448201527f657373207369676e61746f72790000000000000000000000000000000000000060648201526084015b60405180910390fd5b600180546000908152602081815260408083203380855292529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001684179055915490517fb4c6779ceb4a20f448e76a0e11f39bd183cff9c9dbac53df6bfcc202e2eb32f19161028f9190815260200190565b60405180910390a25050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4163636573734d616e616765722e6578636c75646564436f756e74726965645560448201527f706461746564206f6e6c792063616c6c61626c65206279207468652044414f00606482015260840161020e565b600180600082825461037291906107ca565b9091555050565b60008046600154856040516020016103c993929190928352602083019190915260601b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016604082015260540190565b6040516020818303038152906040528051906020012090506103eb81846103f5565b9150505b92915050565b6020810151604082015160418301516000929190836104168783868661044e565b73ffffffffffffffffffffffffffffffffffffffff16731234519dca2ef23207e1ca7fd70b96f281893baa1494505050505092915050565b600080600061045f87878787610476565b9150915061046c81610565565b5095945050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156104ad575060009050600361055c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610501573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166105555760006001925092505061055c565b9150600090505b94509492505050565b600081600481111561057957610579610804565b036105815750565b600181600481111561059557610595610804565b036105fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161020e565b600281600481111561061057610610610804565b03610677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161020e565b600381600481111561068b5761068b610804565b03610718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161020e565b50565b6000806020838503121561072e57600080fd5b823567ffffffffffffffff8082111561074657600080fd5b818501915085601f83011261075a57600080fd5b81358181111561076957600080fd5b86602082850101111561077b57600080fd5b60209290920196919550909350505050565b60006020828403121561079f57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146107c357600080fd5b9392505050565b808201808211156103ef577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122025a1c3dfda3aec667c92f7d6c2e440d422f112275438bb3f4d700edc0994b89e64736f6c63430008160033000000000000000000000000ed6c6391e7cb7d3f980710d5afc9ba784d942158
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100675760003560e01c8063783af99711610050578063783af997146100d2578063a5e293b0146100da578063cf4a6651146100f157600080fd5b80634162169f1461006c5780634e25bada146100bd575b600080fd5b6100937f000000000000000000000000ed6c6391e7cb7d3f980710d5afc9ba784d94215881565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100d06100cb36600461071b565b610146565b005b6100d061029b565b6100e360015481565b6040519081526020016100b4565b6101366100ff36600461078d565b60015460009081526020818152604080832073ffffffffffffffffffffffffffffffffffffffff9094168352929052205460ff1690565b60405190151581526020016100b4565b6101863383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061037992505050565b610217576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f496e636f7272656374204163636573734d616e616765722e6772616e7441636360448201527f657373207369676e61746f72790000000000000000000000000000000000000060648201526084015b60405180910390fd5b600180546000908152602081815260408083203380855292529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001684179055915490517fb4c6779ceb4a20f448e76a0e11f39bd183cff9c9dbac53df6bfcc202e2eb32f19161028f9190815260200190565b60405180910390a25050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ed6c6391e7cb7d3f980710d5afc9ba784d9421581614610360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4163636573734d616e616765722e6578636c75646564436f756e74726965645560448201527f706461746564206f6e6c792063616c6c61626c65206279207468652044414f00606482015260840161020e565b600180600082825461037291906107ca565b9091555050565b60008046600154856040516020016103c993929190928352602083019190915260601b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016604082015260540190565b6040516020818303038152906040528051906020012090506103eb81846103f5565b9150505b92915050565b6020810151604082015160418301516000929190836104168783868661044e565b73ffffffffffffffffffffffffffffffffffffffff16731234519dca2ef23207e1ca7fd70b96f281893baa1494505050505092915050565b600080600061045f87878787610476565b9150915061046c81610565565b5095945050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156104ad575060009050600361055c565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610501573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166105555760006001925092505061055c565b9150600090505b94509492505050565b600081600481111561057957610579610804565b036105815750565b600181600481111561059557610595610804565b036105fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161020e565b600281600481111561061057610610610804565b03610677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161020e565b600381600481111561068b5761068b610804565b03610718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161020e565b50565b6000806020838503121561072e57600080fd5b823567ffffffffffffffff8082111561074657600080fd5b818501915085601f83011261075a57600080fd5b81358181111561076957600080fd5b86602082850101111561077b57600080fd5b60209290920196919550909350505050565b60006020828403121561079f57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146107c357600080fd5b9392505050565b808201808211156103ef577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122025a1c3dfda3aec667c92f7d6c2e440d422f112275438bb3f4d700edc0994b89e64736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ed6c6391e7cb7d3f980710d5afc9ba784d942158
-----Decoded View---------------
Arg [0] : _dao (address): 0xed6C6391E7Cb7D3f980710D5afc9ba784D942158
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ed6c6391e7cb7d3f980710d5afc9ba784d942158
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 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.