More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 134 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Extract Tokens | 20146843 | 69 days ago | IN | 0 ETH | 0.00016151 | ||||
Extract Tokens | 20139852 | 70 days ago | IN | 0 ETH | 0.00016402 | ||||
Extract Tokens | 19861423 | 109 days ago | IN | 0 ETH | 0.00067376 | ||||
Extract Tokens | 19293899 | 189 days ago | IN | 0 ETH | 0.00109686 | ||||
Extract Tokens | 19242613 | 196 days ago | IN | 0 ETH | 0.00142239 | ||||
Extract Tokens | 19191224 | 203 days ago | IN | 0 ETH | 0.00403192 | ||||
Extract Tokens | 19142452 | 210 days ago | IN | 0 ETH | 0.00069919 | ||||
Extract Tokens | 19142430 | 210 days ago | IN | 0 ETH | 0.00080579 | ||||
Extract Tokens | 18935679 | 239 days ago | IN | 0 ETH | 0.00110257 | ||||
Extract Tokens | 18882707 | 246 days ago | IN | 0 ETH | 0.00156301 | ||||
Extract Tokens | 18703633 | 271 days ago | IN | 0 ETH | 0.00155676 | ||||
Extract Tokens | 18697588 | 272 days ago | IN | 0 ETH | 0.00163816 | ||||
Extract Tokens | 18527818 | 296 days ago | IN | 0 ETH | 0.00188912 | ||||
Extract Tokens | 18105944 | 355 days ago | IN | 0 ETH | 0.00051385 | ||||
Extract Tokens | 18017851 | 367 days ago | IN | 0 ETH | 0.00073764 | ||||
Extract Tokens | 17953871 | 376 days ago | IN | 0 ETH | 0.00053195 | ||||
Extract Tokens | 17850729 | 391 days ago | IN | 0 ETH | 0.00170558 | ||||
Extract Tokens | 17850723 | 391 days ago | IN | 0 ETH | 0.00134932 | ||||
Extract Tokens | 17793385 | 399 days ago | IN | 0 ETH | 0.00192872 | ||||
Extract Tokens | 17751911 | 405 days ago | IN | 0 ETH | 0.0012903 | ||||
Extract Tokens | 17709654 | 411 days ago | IN | 0 ETH | 0.00073951 | ||||
Extract Tokens | 17644403 | 420 days ago | IN | 0 ETH | 0.00192931 | ||||
Extract Tokens | 17207367 | 481 days ago | IN | 0 ETH | 0.00507447 | ||||
Extract Tokens | 17186690 | 484 days ago | IN | 0 ETH | 0.00375481 | ||||
Extract Tokens | 17129164 | 492 days ago | IN | 0 ETH | 0.0016184 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
CudosTokenRecovery
Compiler Version
v0.8.0+commit.c7dfd78e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: Unlicense pragma solidity 0.8.0; import {CudosAccessControls} from "./CudosAccessControls.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; contract CudosTokenRecovery { mapping(address => uint256) public whitelistedStakersAmount; uint256 constant MAX_ADDRESSES_BATCH = 4000; IERC20 public token; CudosAccessControls public accessControls; event StakersWhitelisted(address[] addresses, uint[] amounts); event TokensExtracted(address indexed user, uint256 amount); constructor (IERC20 _token, CudosAccessControls _accessControls){ require(address(_token) != address(0), "CudosTokenRecovery: Token address cannot be zero"); require(address(_accessControls) != address(0), "CudosTokenRecovery: CudosAccessControls address cannot be zero"); token = _token; accessControls = _accessControls; } function extractTokens() public { uint256 stakerAmmount = whitelistedStakersAmount[msg.sender]; require(stakerAmmount > 0, "CudosTokenRecovery.extractTokens: Address is not whitelisted for token recovery"); whitelistedStakersAmount[msg.sender] = 0; require(token.transfer(msg.sender, stakerAmmount), "CudosTokenRecovery.extractTokens: Token transfer is unsuccessful"); emit TokensExtracted(msg.sender, stakerAmmount); } function setWhitelistedStakers(address[] calldata _addresses, uint256[] calldata _amounts) public { require(accessControls.hasAdminRole(msg.sender), "CudosTokenRecovery.setWhitelistedStakers: Only admin"); require(_addresses.length == _amounts.length, "CudosTokenRecovery.setWhitelistedStakers: Number of addresses must match the number of amounts"); require(_addresses.length <= MAX_ADDRESSES_BATCH, "CudosTokenRecovery.setWhitelistedStakers: Cannot whitelist more than 4000 addresses at a time"); for(uint i; i < _addresses.length; i++){ whitelistedStakersAmount[_addresses[i]] = _amounts[i]; } emit StakersWhitelisted(_addresses, _amounts); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; contract CudosAccessControls is AccessControl { // Role definitions bytes32 public constant WHITELISTED_ROLE = keccak256("WHITELISTED_ROLE"); bytes32 public constant SMART_CONTRACT_ROLE = keccak256("SMART_CONTRACT_ROLE"); // Events event AdminRoleGranted( address indexed beneficiary, address indexed caller ); event AdminRoleRemoved( address indexed beneficiary, address indexed caller ); event WhitelistRoleGranted( address indexed beneficiary, address indexed caller ); event WhitelistRoleRemoved( address indexed beneficiary, address indexed caller ); event SmartContractRoleGranted( address indexed beneficiary, address indexed caller ); event SmartContractRoleRemoved( address indexed beneficiary, address indexed caller ); modifier onlyAdminRole() { require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "CudosAccessControls: sender must be an admin"); _; } constructor() { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); } ///////////// // Lookups // ///////////// function hasAdminRole(address _address) external view returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _address); } function hasWhitelistRole(address _address) external view returns (bool) { return hasRole(WHITELISTED_ROLE, _address); } function hasSmartContractRole(address _address) external view returns (bool) { return hasRole(SMART_CONTRACT_ROLE, _address); } /////////////// // Modifiers // /////////////// function addAdminRole(address _address) external onlyAdminRole { _setupRole(DEFAULT_ADMIN_ROLE, _address); emit AdminRoleGranted(_address, _msgSender()); } function removeAdminRole(address _address) external onlyAdminRole { revokeRole(DEFAULT_ADMIN_ROLE, _address); emit AdminRoleRemoved(_address, _msgSender()); } function addWhitelistRole(address _address) external onlyAdminRole { _setupRole(WHITELISTED_ROLE, _address); emit WhitelistRoleGranted(_address, _msgSender()); } function removeWhitelistRole(address _address) external onlyAdminRole { revokeRole(WHITELISTED_ROLE, _address); emit WhitelistRoleRemoved(_address, _msgSender()); } function addSmartContractRole(address _address) external onlyAdminRole { _setupRole(SMART_CONTRACT_ROLE, _address); emit SmartContractRoleGranted(_address, _msgSender()); } function removeSmartContractRole(address _address) external onlyAdminRole { revokeRole(SMART_CONTRACT_ROLE, _address); emit SmartContractRoleRemoved(_address, _msgSender()); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount ) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { function hasRole(bytes32 role, address account) external view returns (bool); function getRoleAdmin(bytes32 role) external view returns (bytes32); function grantRole(bytes32 role, address account) external; function revokeRole(bytes32 role, address account) external; function renounceRole(bytes32 role, address account) external; } /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, getRoleAdmin(role), adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract CudosAccessControls","name":"_accessControls","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"addresses","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"StakersWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensExtracted","type":"event"},{"inputs":[],"name":"accessControls","outputs":[{"internalType":"contract CudosAccessControls","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"extractTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"setWhitelistedStakers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedStakersAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516109e03803806109e083398101604081905261002f916100b5565b6001600160a01b03821661005e5760405162461bcd60e51b8152600401610055906100ee565b60405180910390fd5b6001600160a01b0381166100845760405162461bcd60e51b81526004016100559061013e565b600180546001600160a01b039384166001600160a01b031991821617909155600280549290931691161790556101b3565b600080604083850312156100c7578182fd5b82516100d28161019b565b60208401519092506100e38161019b565b809150509250929050565b60208082526030908201527f4375646f73546f6b656e5265636f766572793a20546f6b656e2061646472657360408201526f732063616e6e6f74206265207a65726f60801b606082015260800190565b6020808252603e908201527f4375646f73546f6b656e5265636f766572793a204375646f734163636573734360408201527f6f6e74726f6c7320616464726573732063616e6e6f74206265207a65726f0000606082015260800190565b6001600160a01b03811681146101b057600080fd5b50565b61081e806101c26000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063162770891461005c57806351abde6914610085578063748365ef1461008f578063c56f317b146100a4578063fc0c546a146100b7575b600080fd5b61006f61006a366004610437565b6100bf565b60405161007c91906107b8565b60405180910390f35b61008d6100d1565b005b6100976101fd565b60405161007c91906104e1565b61008d6100b2366004610458565b61020c565b6100976103c3565b60006020819052908152604090205481565b33600090815260208190526040902054806101075760405162461bcd60e51b81526004016100fe9061066c565b60405180910390fd5b3360008181526020819052604080822091909155600154905163a9059cbb60e01b81526001600160a01b039091169163a9059cbb9161014b919085906004016104f5565b602060405180830381600087803b15801561016557600080fd5b505af1158015610179573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019d91906104c1565b6101b95760405162461bcd60e51b81526004016100fe9061060e565b336001600160a01b03167f8f8d27e529b41a5ef123b4ddba0b70b45def70658adf4c8e62952e02443a69f2826040516101f291906107b8565b60405180910390a250565b6002546001600160a01b031681565b60025460405163c395fcb360e01b81526001600160a01b039091169063c395fcb39061023c9033906004016104e1565b60206040518083038186803b15801561025457600080fd5b505afa158015610268573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028c91906104c1565b6102a85760405162461bcd60e51b81526004016100fe906106e1565b8281146102c75760405162461bcd60e51b81526004016100fe90610735565b610fa08311156102e95760405162461bcd60e51b81526004016100fe9061058b565b60005b8381101561037f5782828281811061031457634e487b7160e01b600052603260045260246000fd5b9050602002013560008087878581811061033e57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906103539190610437565b6001600160a01b0316815260208101919091526040016000205580610377816107c1565b9150506102ec565b507f92609fab4b743a2504d335e2c067caac9f3cd0e3e6159dc852931d935b8f3ac4848484846040516103b5949392919061050e565b60405180910390a150505050565b6001546001600160a01b031681565b80356001600160a01b03811681146103e957600080fd5b919050565b60008083601f8401126103ff578182fd5b50813567ffffffffffffffff811115610416578182fd5b602083019150836020808302850101111561043057600080fd5b9250929050565b600060208284031215610448578081fd5b610451826103d2565b9392505050565b6000806000806040858703121561046d578283fd5b843567ffffffffffffffff80821115610484578485fd5b610490888389016103ee565b909650945060208701359150808211156104a8578384fd5b506104b5878288016103ee565b95989497509550505050565b6000602082840312156104d2578081fd5b81518015158114610451578182fd5b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6040808252810184905260008560608301825b8781101561054f576001600160a01b0361053a846103d2565b16825260209283019290910190600101610521565b5083810360208501528481526001600160fb1b0385111561056e578283fd5b602085029150818660208301370160200190815295945050505050565b6020808252605d908201527f4375646f73546f6b656e5265636f766572792e73657457686974656c6973746560408201527f645374616b6572733a2043616e6e6f742077686974656c697374206d6f72652060608201527f7468616e20343030302061646472657373657320617420612074696d65000000608082015260a00190565b602080825260409082018190527f4375646f73546f6b656e5265636f766572792e65787472616374546f6b656e73908201527f3a20546f6b656e207472616e7366657220697320756e7375636365737366756c606082015260800190565b6020808252604f908201527f4375646f73546f6b656e5265636f766572792e65787472616374546f6b656e7360408201527f3a2041646472657373206973206e6f742077686974656c697374656420666f7260608201526e20746f6b656e207265636f7665727960881b608082015260a00190565b60208082526034908201527f4375646f73546f6b656e5265636f766572792e73657457686974656c697374656040820152733229ba30b5b2b9399d1027b7363c9030b236b4b760611b606082015260800190565b6020808252605e908201527f4375646f73546f6b656e5265636f766572792e73657457686974656c6973746560408201527f645374616b6572733a204e756d626572206f6620616464726573736573206d7560608201527f7374206d6174636820746865206e756d626572206f6620616d6f756e74730000608082015260a00190565b90815260200190565b60006000198214156107e157634e487b7160e01b81526011600452602481fd5b506001019056fea2646970667358221220b630b34d0fb4abd9ccec329a6d9c09e2bb4096b75b5d97a4d11b3da8533f49ee64736f6c63430008000033000000000000000000000000817bbdbc3e8a1204f3691d14bb44992841e3db35000000000000000000000000efb546ec7babc97af3791033cc3ca1cc1f680993
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063162770891461005c57806351abde6914610085578063748365ef1461008f578063c56f317b146100a4578063fc0c546a146100b7575b600080fd5b61006f61006a366004610437565b6100bf565b60405161007c91906107b8565b60405180910390f35b61008d6100d1565b005b6100976101fd565b60405161007c91906104e1565b61008d6100b2366004610458565b61020c565b6100976103c3565b60006020819052908152604090205481565b33600090815260208190526040902054806101075760405162461bcd60e51b81526004016100fe9061066c565b60405180910390fd5b3360008181526020819052604080822091909155600154905163a9059cbb60e01b81526001600160a01b039091169163a9059cbb9161014b919085906004016104f5565b602060405180830381600087803b15801561016557600080fd5b505af1158015610179573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019d91906104c1565b6101b95760405162461bcd60e51b81526004016100fe9061060e565b336001600160a01b03167f8f8d27e529b41a5ef123b4ddba0b70b45def70658adf4c8e62952e02443a69f2826040516101f291906107b8565b60405180910390a250565b6002546001600160a01b031681565b60025460405163c395fcb360e01b81526001600160a01b039091169063c395fcb39061023c9033906004016104e1565b60206040518083038186803b15801561025457600080fd5b505afa158015610268573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028c91906104c1565b6102a85760405162461bcd60e51b81526004016100fe906106e1565b8281146102c75760405162461bcd60e51b81526004016100fe90610735565b610fa08311156102e95760405162461bcd60e51b81526004016100fe9061058b565b60005b8381101561037f5782828281811061031457634e487b7160e01b600052603260045260246000fd5b9050602002013560008087878581811061033e57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906103539190610437565b6001600160a01b0316815260208101919091526040016000205580610377816107c1565b9150506102ec565b507f92609fab4b743a2504d335e2c067caac9f3cd0e3e6159dc852931d935b8f3ac4848484846040516103b5949392919061050e565b60405180910390a150505050565b6001546001600160a01b031681565b80356001600160a01b03811681146103e957600080fd5b919050565b60008083601f8401126103ff578182fd5b50813567ffffffffffffffff811115610416578182fd5b602083019150836020808302850101111561043057600080fd5b9250929050565b600060208284031215610448578081fd5b610451826103d2565b9392505050565b6000806000806040858703121561046d578283fd5b843567ffffffffffffffff80821115610484578485fd5b610490888389016103ee565b909650945060208701359150808211156104a8578384fd5b506104b5878288016103ee565b95989497509550505050565b6000602082840312156104d2578081fd5b81518015158114610451578182fd5b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6040808252810184905260008560608301825b8781101561054f576001600160a01b0361053a846103d2565b16825260209283019290910190600101610521565b5083810360208501528481526001600160fb1b0385111561056e578283fd5b602085029150818660208301370160200190815295945050505050565b6020808252605d908201527f4375646f73546f6b656e5265636f766572792e73657457686974656c6973746560408201527f645374616b6572733a2043616e6e6f742077686974656c697374206d6f72652060608201527f7468616e20343030302061646472657373657320617420612074696d65000000608082015260a00190565b602080825260409082018190527f4375646f73546f6b656e5265636f766572792e65787472616374546f6b656e73908201527f3a20546f6b656e207472616e7366657220697320756e7375636365737366756c606082015260800190565b6020808252604f908201527f4375646f73546f6b656e5265636f766572792e65787472616374546f6b656e7360408201527f3a2041646472657373206973206e6f742077686974656c697374656420666f7260608201526e20746f6b656e207265636f7665727960881b608082015260a00190565b60208082526034908201527f4375646f73546f6b656e5265636f766572792e73657457686974656c697374656040820152733229ba30b5b2b9399d1027b7363c9030b236b4b760611b606082015260800190565b6020808252605e908201527f4375646f73546f6b656e5265636f766572792e73657457686974656c6973746560408201527f645374616b6572733a204e756d626572206f6620616464726573736573206d7560608201527f7374206d6174636820746865206e756d626572206f6620616d6f756e74730000608082015260a00190565b90815260200190565b60006000198214156107e157634e487b7160e01b81526011600452602481fd5b506001019056fea2646970667358221220b630b34d0fb4abd9ccec329a6d9c09e2bb4096b75b5d97a4d11b3da8533f49ee64736f6c63430008000033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000817bbdbc3e8a1204f3691d14bb44992841e3db35000000000000000000000000efb546ec7babc97af3791033cc3ca1cc1f680993
-----Decoded View---------------
Arg [0] : _token (address): 0x817bbDbC3e8A1204f3691d14bB44992841e3dB35
Arg [1] : _accessControls (address): 0xefB546ec7bABC97af3791033cc3CA1cc1F680993
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000817bbdbc3e8a1204f3691d14bb44992841e3db35
Arg [1] : 000000000000000000000000efb546ec7babc97af3791033cc3ca1cc1f680993
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.009178 | 16,878,175.029 | $154,904.89 |
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.