Contract Overview
Balance:
0 MATIC
MATIC Value:
$0.00
My Name Tag:
Not Available, login to update
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0xcccb2f8b707052269834a731876f40b1f3884243553b8716e7256031f27307cb | 0x60a06040 | 24538580 | 143 days 15 hrs ago | 0xdd7bf9b22bf740f621ed823ae3d70eb7427430b2 | IN | Create: Factory | 0 MATIC | 0.28726803 |
[ Download CSV Export ]
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
Factory
Compiler Version
v0.8.2+commit.661d1103
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "./libraries/PausableUpgradeable.sol"; import "./libraries/AccessControlUpgradeable.sol"; import "./libraries/NativeMetaTransaction.sol"; contract Factory is Initializable, ReentrancyGuardUpgradeable, UUPSUpgradeable, PausableUpgradeable, AccessControlUpgradeable, NativeMetaTransaction { using SafeERC20Upgradeable for IERC20Upgradeable; bytes32 public constant MANAGER = keccak256("MANAGER"); bool internal unAuthorizedDeployment; uint256 defaultDeployLimit; mapping(string => address) public strategy; /* ========== STATE VARIABLES ========== */ struct deployerDetails { uint256 deploymentlimit; uint256 totalDeployments; bool whitelisted; } enum FarmTag { Dfyn, Authorized, UnAuthorized } struct deployedFarmDetails { address farm; bytes params; string id; FarmTag tag; } //Store deployer details mapping(address => deployerDetails) public deployer; //Store farms deployed by deployer mapping(address => address[]) public farms; //Stores deployed farm details deployedFarmDetails[] public deployedFarms; //stores farmowner address mapping(address => address) public farmOwner; // stores blacklisted Unauthorized deployer address mapping(address => bool) public blackList; /* ========== INITIALIZER ========== */ function initialize() external initializer { __AccessControl_init(); _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); __Pausable_init(); __ReentrancyGuard_init(); _initializeEIP712("DIYFARMS"); pauseUnauthorizedDeployment(); defaultDeployLimit = 5; } /* ========== UPGRADABLE FUNCTION ========== */ function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE) {} /* ========== VIEWS ========== */ //Return true if whitelisted function isWhitelisted(address _deployer) external view returns (bool result) { result = deployer[_deployer].whitelisted; } //Return Details of all deployed Farms function getDeployedfarms() external view returns (deployedFarmDetails[] memory) { return deployedFarms; } //Return true if unauthorizedDeployments is paused function unAuthorizedDeploymentPaused() public view returns (bool) { return unAuthorizedDeployment; } /* ========== MUTATIVE FUNCTIONS ========== */ //Creates farm function farmCreator(string memory _id, bytes memory _data) internal returns (address) { address strategyContract = strategy[_id]; require(strategyContract != address(0), "Strategy Not Found"); //Cloning address strategyClone = ClonesUpgradeable.clone(strategyContract); bytes memory payload = abi.encodeWithSelector(0xcce2df03, _data, _msgSender());//keccak256(initialize(bytes memory _data, address _deployer)) (bool success, bytes memory returnData) = address(strategyClone).call(payload); require(success && (returnData.length == 0 || abi.decode(returnData, (bool))), "Initialization Failed"); farms[_msgSender()].push(strategyClone); farmOwner[strategyClone] = _msgSender(); FarmTag farmTag = getFarmTag(_msgSender()); deployedFarmDetails memory details = deployedFarmDetails(strategyClone, _data, _id, farmTag); deployedFarms.push(details); address[] memory _rewardTokens; uint256[] memory _rewardAmount; (_rewardTokens, _rewardAmount) = dataDecoder(_data); rewardTransfer(_rewardTokens, _rewardAmount, strategyClone); emit Deployedfarm(strategyClone, _msgSender(), block.timestamp); return strategyClone; } //Deploys farm function deployFarm(string memory _id, bytes memory _data) external nonReentrant whenNotPaused returns (address) { if ( deployer[_msgSender()].whitelisted || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()) || hasRole(MANAGER, _msgSender()) ) { uint256 deployLimit = deployer[_msgSender()].deploymentlimit; uint256 totalDeployment = deployer[_msgSender()].totalDeployments; require(deployLimit >= totalDeployment + 1, "Deployment:Exceeded Limit"); deployer[_msgSender()].totalDeployments++; address farm = farmCreator(_id, _data); return farm; } else { require(!unAuthorizedDeploymentPaused(), "Unauthorized Farm Deployment:Paused"); require(!blackList[_msgSender()], "Unauthorized Farm Deployment:Blacklisted"); uint256 totalDeployment = deployer[_msgSender()].totalDeployments; require(defaultDeployLimit >= totalDeployment + 1, "Unauthorized Farm Deployment:Exceeded Limit"); deployer[_msgSender()].totalDeployments++; address farm = farmCreator(_id, _data); return farm; } } //Renews Existing Farm function renewFarms(address _farm, bytes memory _data) external nonReentrant onlyDeployer(_msgSender()) { require(_farm != address(0)); address _owner = farmOwner[_farm]; require(_owner == _msgSender(), "Access Denied"); address[] memory _rewardTokens; uint256[] memory _rewardAmount; (_rewardTokens, _rewardAmount) = dataDecoder(_data); rewardTransfer(_rewardTokens, _rewardAmount, _farm); bytes memory payload = abi.encodeWithSelector(0x6d4d6e37, _data);//keccak256(renewFarm(bytes memory _data)) (bool success, bytes memory returnData) = address(_farm).call(payload); require(success && (returnData.length == 0 || abi.decode(returnData, (bool))), "Renewal Failed"); emit RenewFarms(_farm, _data, block.timestamp); } // Transfer Reward during farm creation function rewardTransfer( address[] memory _rewardTokens, uint256[] memory _rewardAmount, address _farm ) internal { for (uint256 i = 0; i < _rewardTokens.length; i++) { uint256 rewardAmount = _rewardAmount[i]; address rewardToken = _rewardTokens[i]; require(IERC20Upgradeable(rewardToken).transferFrom(_msgSender(), _farm, rewardAmount), "Transfer Failed"); } } /* ========== RESTRICTED FUNCTIONS ========== */ /* ========== Admin Controlled Functions ========== */ // Sets manager function authorizeManager(address _account) external onlyRole(DEFAULT_ADMIN_ROLE) { _setupRole(MANAGER, _account); _setRoleAdmin(MANAGER, DEFAULT_ADMIN_ROLE); emit AuthorizeManager(_account); } // Revoke manger function revokeManager(address _account) external onlyRole(DEFAULT_ADMIN_ROLE) { revokeRole(MANAGER, _account); emit RevokeManager(_account); } //Adds new strategie function addStrategies(string memory _id, address _strategies) external onlyRole(DEFAULT_ADMIN_ROLE) { strategy[_id] = _strategies; emit AddedStrategy(_id, _strategies); } //Pause all deployments function pauseDeployment() external onlyRole(DEFAULT_ADMIN_ROLE) { _pause(); emit PauseDeployment(block.timestamp); } //UnPause all deployments if paused function unPauseDeployment() external onlyRole(DEFAULT_ADMIN_ROLE) { _unpause(); emit UnPauseDeployment(block.timestamp); } //Pause Unauthorized Farm deployment function pauseUnauthorizedDeployment() public onlyRole(DEFAULT_ADMIN_ROLE) whenUnauthorizedDeploymentNotPaused { unAuthorizedDeployment = true; emit PauseUnauthorizedDeployment(block.timestamp); } //Unpause Unauthorized Farm deployment function unPauseUnauthorizedDeployment() public onlyRole(DEFAULT_ADMIN_ROLE) whenUnauthorizedDeploymentPaused { unAuthorizedDeployment = false; emit UnPauseUnauthorizedDeployment(block.timestamp); } //set default deployment limit for unauthorized deployers(default 5) function setDefaultDeployLimit(uint256 _limit) external onlyRole(DEFAULT_ADMIN_ROLE) { defaultDeployLimit = _limit; emit SetDefaultDeployLimit(_limit, _msgSender()); } /* ========== Manager Controlled Functions ========== */ //Authorize deployer for deploying farms function authorizeDeployer(address _deployer, uint256 _limit) external onlyRole(MANAGER) { deployer[_deployer].deploymentlimit = _limit; deployer[_deployer].whitelisted = true; emit AuthorizeDeployer(_deployer, block.timestamp); } //Deauthorize deployer function deauthorizeDeployer(address _deployer) external onlyRole(MANAGER) { deployer[_deployer].whitelisted = false; emit DeAuthorizeDeployer(_deployer, block.timestamp); } //Blacklist unauthorized deployer function blackListUnAuthDeployer(address _account) external onlyRole(MANAGER) { blackList[_account] = true; emit BlackListUnAuthDeployer(_account, _msgSender()); } //Whitelist Blacklisted unauthorized deployer function whiteListUnAuthDeployer(address _account) external onlyRole(MANAGER) { blackList[_account] = false; emit WhiteListUnAuthDeployer(_account, _msgSender()); } function rescueFunds( address _tokenAddress, address _receiver, address _farm ) external onlyRole(MANAGER) { bytes memory payload = abi.encodeWithSelector(0x1ff9b6f2, _tokenAddress, _receiver);//keccak256(rescueFunds(address,address)) (bool success, bytes memory returnData) = address(_farm).call(payload); require(success && (returnData.length == 0 || abi.decode(returnData, (bool))), "Rescue Failed"); emit RescueFunds(_tokenAddress, _receiver, _farm); } function rescueBurnableFunds( address _tokenAddress, address _receiver, address _farm ) external onlyRole(MANAGER) { bytes memory payload = abi.encodeWithSelector(0x9adb3836, _receiver, _tokenAddress);//keccak256(rescueBurnableFunds(address,address)) (bool success, bytes memory returnData) = address(_farm).call(payload); require(success && (returnData.length == 0 || abi.decode(returnData, (bool))), "Rescue Failed"); emit RescueBurnableFunds(_tokenAddress, _receiver, _farm); } /* ========== PURE FUNCTIONS ========== */ function dataDecoder(bytes memory _data) internal pure returns (address[] memory, uint256[] memory) { (, , , address[] memory _rewardTokens, uint256[] memory _rewardAmount) = abi.decode( _data, (address, uint256, uint256, address[], uint256[]) ); return (_rewardTokens, _rewardAmount); } function getFarmTag(address _account) internal view returns (FarmTag) { FarmTag tag; if (hasRole(DEFAULT_ADMIN_ROLE, _account) || hasRole(MANAGER, _account)) { tag = FarmTag.Dfyn; } else if (deployer[_account].whitelisted) { tag = FarmTag.Authorized; } else { tag = FarmTag.UnAuthorized; } return tag; } /* ========== MODIFIERS ========== */ modifier onlyDeployer(address _account) { require(deployer[_account].whitelisted == true, "OnlyWhitelisted: caller is not whitelistedr"); _; } modifier whenUnauthorizedDeploymentNotPaused() { require(!unAuthorizedDeploymentPaused(), "UnauthorizedDeployment: paused"); _; } modifier whenUnauthorizedDeploymentPaused() { require(unAuthorizedDeploymentPaused(), "UnauthorizedDeployment: not paused"); _; } /* ========== EVENTS ========== */ event AuthorizeDeployer(address indexed deployer, uint256 time); event DeAuthorizeDeployer(address indexed deployer, uint256 time); event AddedStrategy(string id, address strategy); event Deployedfarm(address farm, address deployer, uint256 time); event RescueFunds(address token, address receiver, address farm); event RescueBurnableFunds(address token, address receiver, address farm); event RenewFarms(address farm, bytes data, uint256 time); event AuthorizeManager(address indexed manager); event RevokeManager(address indexed manager); event PauseUnauthorizedDeployment(uint256 time); event UnPauseUnauthorizedDeployment(uint256 time); event SetDefaultDeployLimit(uint256 limit, address manager); event BlackListUnAuthDeployer(address deployer, address manager); event WhiteListUnAuthDeployer(address deployer, address manager); event PauseDeployment(uint256 time); event UnPauseDeployment(uint256 time); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library ClonesUpgradeable { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create(0, ptr, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create2(0, ptr, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000) mstore(add(ptr, 0x38), shl(0x60, deployer)) mstore(add(ptr, 0x4c), salt) mstore(add(ptr, 0x6c), keccak256(ptr, 0x37)) predicted := keccak256(add(ptr, 0x37), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal initializer { __ERC1967Upgrade_init_unchained(); __UUPSUpgradeable_init_unchained(); } function __UUPSUpgradeable_init_unchained() internal initializer { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallSecure(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal initializer { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal initializer { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable { using AddressUpgradeable for address; function safeTransfer( IERC20Upgradeable token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20Upgradeable 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( IERC20Upgradeable 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( IERC20Upgradeable 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( IERC20Upgradeable 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(IERC20Upgradeable 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 "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal initializer { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal initializer { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(msg.sender); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(msg.sender); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @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 AccessControlUpgradeable is Initializable,IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal initializer { __ERC165_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal initializer { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @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]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, msg.sender); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).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]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.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 == msg.sender, "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 { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account,msg.sender); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, msg.sender); } } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.11; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import './EIP712Base.sol'; contract NativeMetaTransaction is EIP712Base { using SafeMath for uint256; bytes32 private constant META_TRANSACTION_TYPEHASH = keccak256(bytes('MetaTransaction(uint256 nonce,address from,bytes functionSignature)')); event MetaTransactionExecuted(address userAddress, address payable relayerAddress, bytes functionSignature); mapping(address => uint256) nonces; /* * Meta transaction structure. * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas * He should call the desired function directly in that case. */ struct MetaTransaction { uint256 nonce; address from; bytes functionSignature; } function executeMetaTransaction( address userAddress, bytes memory functionSignature, bytes32 sigR, bytes32 sigS, uint8 sigV ) public payable returns (bytes memory) { MetaTransaction memory metaTx = MetaTransaction({nonce: nonces[userAddress], from: userAddress, functionSignature: functionSignature}); require(verify(userAddress, metaTx, sigR, sigS, sigV), 'Signer and signature do not match'); // increase nonce for user (to avoid re-use) nonces[userAddress] = nonces[userAddress].add(1); emit MetaTransactionExecuted(userAddress, payable(msg.sender), functionSignature); // Append userAddress and relayer address at the end to extract it from calling context (bool success, bytes memory returnData) = address(this).call(abi.encodePacked(functionSignature, userAddress)); require(success, 'Function call not successful'); return returnData; } function hashMetaTransaction(MetaTransaction memory metaTx) internal pure returns (bytes32) { return keccak256( abi.encode(META_TRANSACTION_TYPEHASH, metaTx.nonce, metaTx.from, keccak256(metaTx.functionSignature)) ); } function getNonce(address user) public view returns (uint256 nonce) { nonce = nonces[user]; } function verify( address signer, MetaTransaction memory metaTx, bytes32 sigR, bytes32 sigS, uint8 sigV ) internal view returns (bool) { require(signer != address(0), 'NativeMetaTransaction: INVALID_SIGNER'); return signer == ecrecover(toTypedMessageHash(hashMetaTransaction(metaTx)), sigV, sigR, sigS); } function _msgSender() internal view returns (address sender) { if (msg.sender == address(this)) { bytes memory array = msg.data; uint256 index = msg.data.length; assembly { // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those. sender := and(mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff) } } else { sender = msg.sender; } return sender; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal initializer { __ERC1967Upgrade_init_unchained(); } function __ERC1967Upgrade_init_unchained() internal initializer { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallSecure( address newImplementation, bytes memory data, bool forceCall ) internal { address oldImplementation = _getImplementation(); // Initial upgrade and setup call _setImplementation(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } // Perform rollback test if not already in progress StorageSlotUpgradeable.BooleanSlot storage rollbackTesting = StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT); if (!rollbackTesting.value) { // Trigger rollback using upgradeTo from the new implementation rollbackTesting.value = true; _functionDelegateCall( newImplementation, abi.encodeWithSignature("upgradeTo(address)", oldImplementation) ); rollbackTesting.value = false; // Check rollback was effective require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades"); // Finally reset to the new implementation and log the upgrade _upgradeTo(newImplementation); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @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) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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 Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @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 {AccessControl-_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 Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @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) external; /** * @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) external; /** * @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) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { 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 "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal initializer { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal initializer { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } uint256[50] private __gap; }
// 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 IERC165Upgradeable { /** * @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; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.11; import "./MetaInitializable.sol"; contract EIP712Base is MetaInitializable { struct EIP712Domain { string name; string version; address verifyingContract; bytes32 salt; } string public constant ERC712_VERSION = '1'; bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256(bytes('EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)')); bytes32 internal domainSeperator; // supposed to be called once while initializing. // one of the contractsa that inherits this contract follows proxy pattern // so it is not possible to do this in a constructor function _initializeEIP712(string memory name) internal metaInitializer { _setDomainSeperator(name); } function _setDomainSeperator(string memory name) internal { domainSeperator = keccak256( abi.encode( EIP712_DOMAIN_TYPEHASH, keccak256(bytes(name)), keccak256(bytes(ERC712_VERSION)), address(this), bytes32(getChainId()) ) ); } function getDomainSeperator() public view returns (bytes32) { return domainSeperator; } function getChainId() public view returns (uint256) { uint256 id; assembly { id := chainid() } return id; } /** * Accept message hash and returns hash message in EIP712 compatible form * So that it can be used to recover signer from signature signed using EIP712 formatted data * https://eips.ethereum.org/EIPS/eip-712 * "\\x19" makes the encoding deterministic * "\\x01" is the version byte to make it compatible to EIP-191 */ function toTypedMessageHash(bytes32 messageHash) internal view returns (bytes32) { return keccak256(abi.encodePacked('\x19\x01', getDomainSeperator(), messageHash)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.11; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract MetaInitializable is Initializable{ bool inited; function __MetaInitializable_init() internal initializer { inited = false; } modifier metaInitializer() { require(!inited, 'already inited'); _; inited = true; } }
{ "metadata": { "bytecodeHash": "none", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 10000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"id","type":"string"},{"indexed":false,"internalType":"address","name":"strategy","type":"address"}],"name":"AddedStrategy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deployer","type":"address"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"AuthorizeDeployer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"manager","type":"address"}],"name":"AuthorizeManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"deployer","type":"address"},{"indexed":false,"internalType":"address","name":"manager","type":"address"}],"name":"BlackListUnAuthDeployer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deployer","type":"address"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"DeAuthorizeDeployer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"farm","type":"address"},{"indexed":false,"internalType":"address","name":"deployer","type":"address"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"Deployedfarm","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"address payable","name":"relayerAddress","type":"address"},{"indexed":false,"internalType":"bytes","name":"functionSignature","type":"bytes"}],"name":"MetaTransactionExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"PauseDeployment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"PauseUnauthorizedDeployment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"farm","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"RenewFarms","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"address","name":"farm","type":"address"}],"name":"RescueBurnableFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"address","name":"farm","type":"address"}],"name":"RescueFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"manager","type":"address"}],"name":"RevokeManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"limit","type":"uint256"},{"indexed":false,"internalType":"address","name":"manager","type":"address"}],"name":"SetDefaultDeployLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"UnPauseDeployment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"UnPauseUnauthorizedDeployment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"deployer","type":"address"},{"indexed":false,"internalType":"address","name":"manager","type":"address"}],"name":"WhiteListUnAuthDeployer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC712_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_id","type":"string"},{"internalType":"address","name":"_strategies","type":"address"}],"name":"addStrategies","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_deployer","type":"address"},{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"authorizeDeployer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"authorizeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"blackList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"blackListUnAuthDeployer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_deployer","type":"address"}],"name":"deauthorizeDeployer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_id","type":"string"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"deployFarm","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deployedFarms","outputs":[{"internalType":"address","name":"farm","type":"address"},{"internalType":"bytes","name":"params","type":"bytes"},{"internalType":"string","name":"id","type":"string"},{"internalType":"enum Factory.FarmTag","name":"tag","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deployer","outputs":[{"internalType":"uint256","name":"deploymentlimit","type":"uint256"},{"internalType":"uint256","name":"totalDeployments","type":"uint256"},{"internalType":"bool","name":"whitelisted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"bytes","name":"functionSignature","type":"bytes"},{"internalType":"bytes32","name":"sigR","type":"bytes32"},{"internalType":"bytes32","name":"sigS","type":"bytes32"},{"internalType":"uint8","name":"sigV","type":"uint8"}],"name":"executeMetaTransaction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"farmOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"farms","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDeployedfarms","outputs":[{"components":[{"internalType":"address","name":"farm","type":"address"},{"internalType":"bytes","name":"params","type":"bytes"},{"internalType":"string","name":"id","type":"string"},{"internalType":"enum Factory.FarmTag","name":"tag","type":"uint8"}],"internalType":"struct Factory.deployedFarmDetails[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDomainSeperator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_deployer","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseDeployment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseUnauthorizedDeployment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_farm","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"renewFarms","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"address","name":"_farm","type":"address"}],"name":"rescueBurnableFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"address","name":"_farm","type":"address"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"revokeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"setDefaultDeployLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"strategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unAuthorizedDeploymentPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unPauseDeployment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unPauseUnauthorizedDeployment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"whiteListUnAuthDeployer","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523060601b60805234801561001757600080fd5b5060805160601c61498a61004b60003960008181610e1a01528181610eb00152818161166e0152611704015261498a6000f3fe6080604052600436106102d15760003560e01c80635c975abb11610179578063a217fddf116100d6578063cc742ad91161008a578063dd6efa4f11610064578063dd6efa4f146108ad578063e90d7a4e146108cd578063eefc84fc146108fd576102d1565b8063cc742ad914610858578063d0c720af1461086d578063d547741f1461088d576102d1565b8063b818a523116100bb578063b818a52314610799578063b9caf9d9146107db578063beab67e414610838576102d1565b8063a217fddf14610764578063ad59122d14610779576102d1565b806390068cc01161012d578063909b30f111610112578063909b30f1146106de57806391d14854146106fe5780639827a02a14610744576102d1565b806390068cc01461069e5780639050eaeb146106be576102d1565b80638129fc1c1161015e5780638129fc1c1461063d578063851bb64b146106525780638f8a2d5e14610689576102d1565b80635c975abb146106055780636bd91a161461061d576102d1565b80632d0335ab1161023257806336dbc2f2116101e65780634838d165116101c05780634838d1651461059f5780634d4091dc146105d05780634f1ef286146105f2576102d1565b806336dbc2f21461050a578063377e32e6146105425780633af32abf14610562576102d1565b80633408e470116102175780633408e470146104b757806336568abe146104ca5780633659cfe6146104ea576102d1565b80632d0335ab146104605780632f2ff15d14610497576102d1565b80631e7a407b11610289578063248a9ca31161026e578063248a9ca3146103f7578063267c850714610427578063272397a314610447576102d1565b80631e7a407b146103cd57806320379ee5146103e2576102d1565b80630f7e5970116102ba5780630f7e59701461032b57806314ea64a3146103745780631b2df8501461038b576102d1565b806301ffc9a7146102d65780630c53c51c1461030b575b600080fd5b3480156102e257600080fd5b506102f66102f136600461430e565b61091d565b60405190151581526020015b60405180910390f35b61031e610319366004614201565b6109b8565b60405161030291906146c6565b34801561033757600080fd5b5061031e6040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525081565b34801561038057600080fd5b50610389610bc8565b005b34801561039757600080fd5b506103bf7faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c81565b604051908152602001610302565b3480156103d957600080fd5b50610389610c73565b3480156103ee57600080fd5b506103bf610cb7565b34801561040357600080fd5b506103bf6104123660046142c7565b600090815260fb602052604090206001015490565b34801561043357600080fd5b50610389610442366004614062565b610cbf565b34801561045357600080fd5b506101305460ff166102f6565b34801561046c57600080fd5b506103bf61047b366004614062565b6001600160a01b0316600090815261012f602052604090205490565b3480156104a357600080fd5b506103896104b23660046142df565b610d58565b3480156104c357600080fd5b50466103bf565b3480156104d657600080fd5b506103896104e53660046142df565b610d83565b3480156104f657600080fd5b50610389610505366004614062565b610e0f565b34801561051657600080fd5b5061052a6105253660046143ce565b610fad565b6040516001600160a01b039091168152602001610302565b34801561054e57600080fd5b5061038961055d366004614062565b61140c565b34801561056e57600080fd5b506102f661057d366004614062565b6001600160a01b03166000908152610133602052604090206002015460ff1690565b3480156105ab57600080fd5b506102f66105ba366004614062565b6101376020526000908152604090205460ff1681565b3480156105dc57600080fd5b506105e561147a565b60405161030291906145fc565b6103896106003660046141b3565b611663565b34801561061157600080fd5b5060975460ff166102f6565b34801561062957600080fd5b506103896106383660046141b3565b6117ee565b34801561064957600080fd5b50610389611b10565b34801561065e57600080fd5b5061052a61066d366004614062565b610136602052600090815260409020546001600160a01b031681565b34801561069557600080fd5b50610389611c50565b3480156106aa57600080fd5b506103896106b9366004614062565b611c94565b3480156106ca57600080fd5b506103896106d9366004614062565b611d35565b3480156106ea57600080fd5b5061052a6106f936600461427c565b611dab565b34801561070a57600080fd5b506102f66107193660046142df565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561075057600080fd5b5061038961075f366004614389565b611de4565b34801561077057600080fd5b506103bf600081565b34801561078557600080fd5b50610389610794366004614062565b611e86565b3480156107a557600080fd5b5061052a6107b436600461434e565b8051602081830181018051610132825292820191909301209152546001600160a01b031681565b3480156107e757600080fd5b5061081b6107f6366004614062565b6101336020526000908152604090208054600182015460029092015490919060ff1683565b604080519384526020840192909252151590820152606001610302565b34801561084457600080fd5b50610389610853366004614169565b611f13565b34801561086457600080fd5b506103896120df565b34801561087957600080fd5b506103896108883660046142c7565b61219f565b34801561089957600080fd5b506103896108a83660046142df565b6121f8565b3480156108b957600080fd5b506103896108c8366004614169565b61221e565b3480156108d957600080fd5b506108ed6108e83660046142c7565b6123dd565b6040516103029493929190614586565b34801561090957600080fd5b5061038961091836600461427c565b612537565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806109b057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b90505b919050565b60408051606081810183526001600160a01b038816600081815261012f6020908152908590205484528301529181018690526109f787828787876125cb565b610a6e5760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d61746360448201527f680000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b038716600090815261012f6020526040902054610a939060016126d3565b6001600160a01b038816600090815261012f60205260409081902091909155517f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b90610ae490899033908a9061455a565b60405180910390a1600080306001600160a01b0316888a604051602001610b0c92919061448f565b60408051601f1981840301815290829052610b2691614473565b6000604051808303816000865af19150503d8060008114610b63576040519150601f19603f3d011682016040523d82523d6000602084013e610b68565b606091505b509150915081610bba5760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c000000006044820152606401610a65565b925050505b95945050505050565b6000610bd481336126e6565b6101305460ff1615610c285760405162461bcd60e51b815260206004820152601e60248201527f556e617574686f72697a65644465706c6f796d656e743a2070617573656400006044820152606401610a65565b610130805460ff191660011790556040517f10fddae3c7f35be6e2d15f4fbc76dc9f97f3c54dce39a960da62edeeae15186a90610c689042815260200190565b60405180910390a150565b6000610c7f81336126e6565b610c87612766565b6040514281527f8a64f2a73098abfc7d71fd55da937333671db7a704b382b0b2a2e40d06f9d23590602001610c68565b61012e545b90565b6000610ccb81336126e6565b610cf57faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c836127f8565b610d207faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c6000612802565b6040516001600160a01b038316907f8e5f1b0aa2e7145a3122922ddad6c7131207c9be6c93c390f54bd8b46e871a4790600090a25050565b600082815260fb6020526040902060010154610d7481336126e6565b610d7e838361284d565b505050565b6001600160a01b0381163314610e015760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610a65565b610e0b82826128d2565b5050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610eae5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610a65565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610f097f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614610f855760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610a65565b610f8e81612955565b60408051600080825260208201909252610faa91839190612961565b50565b6000600260015414156110025760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a65565b600260015560975460ff161561105a5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a65565b6101336000611067612b25565b6001600160a01b0316815260208101919091526040016000206002015460ff168061109a575061109a6000610719612b25565b806110cc57506110cc7faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c610719612b25565b156111df57600061013360006110e0612b25565b6001600160a01b03168152602081019190915260400160009081205491506101338161110a612b25565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905080600161113d9190614759565b82101561118c5760405162461bcd60e51b815260206004820152601960248201527f4465706c6f796d656e743a4578636565646564204c696d6974000000000000006044820152606401610a65565b6101336000611199612b25565b6001600160a01b03168152602081019190915260400160009081206001018054916111c38361484a565b919050555060006111d48686612b81565b935061140292505050565b6101305460ff16156112595760405162461bcd60e51b815260206004820152602360248201527f556e617574686f72697a6564204661726d204465706c6f796d656e743a50617560448201527f73656400000000000000000000000000000000000000000000000000000000006064820152608401610a65565b6101376000611266612b25565b6001600160a01b0316815260208101919091526040016000205460ff16156112f65760405162461bcd60e51b815260206004820152602860248201527f556e617574686f72697a6564204661726d204465706c6f796d656e743a426c6160448201527f636b6c69737465640000000000000000000000000000000000000000000000006064820152608401610a65565b60006101336000611305612b25565b6001600160a01b03166001600160a01b031681526020019081526020016000206001015490508060016113389190614759565b6101315410156113b05760405162461bcd60e51b815260206004820152602b60248201527f556e617574686f72697a6564204661726d204465706c6f796d656e743a45786360448201527f6565646564204c696d69740000000000000000000000000000000000000000006064820152608401610a65565b61013360006113bd612b25565b6001600160a01b03168152602081019190915260400160009081206001018054916113e78361484a565b919050555060006113f88585612b81565b9250611402915050565b6001805592915050565b600061141881336126e6565b6114427faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c836121f8565b6040516001600160a01b038316907f55ca73285ad9d92452591127e66ca6c9f2958672d3346971cc0a76c803d4f12490600090a25050565b6060610135805480602002602001604051908101604052809291908181526020016000905b8282101561165a57600084815260209081902060408051608081019091526004850290910180546001600160a01b0316825260018101805492939192918401916114e89061480f565b80601f01602080910402602001604051908101604052809291908181526020018280546115149061480f565b80156115615780601f1061153657610100808354040283529160200191611561565b820191906000526020600020905b81548152906001019060200180831161154457829003601f168201915b5050505050815260200160028201805461157a9061480f565b80601f01602080910402602001604051908101604052809291908181526020018280546115a69061480f565b80156115f35780601f106115c8576101008083540402835291602001916115f3565b820191906000526020600020905b8154815290600101906020018083116115d657829003601f168201915b5050509183525050600382015460209091019060ff16600281111561162857634e487b7160e01b600052602160045260246000fd5b600281111561164757634e487b7160e01b600052602160045260246000fd5b815250508152602001906001019061149f565b50505050905090565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156117025760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610a65565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661175d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146117d95760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610a65565b6117e282612955565b610e0b82826001612961565b600260015414156118415760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a65565b600260015561184e612b25565b6001600160a01b0381166000908152610133602052604090206002015460ff1615156001146118e55760405162461bcd60e51b815260206004820152602b60248201527f4f6e6c7957686974656c69737465643a2063616c6c6572206973206e6f74207760448201527f686974656c6973746564720000000000000000000000000000000000000000006064820152608401610a65565b6001600160a01b0383166118f857600080fd5b6001600160a01b03808416600090815261013660205260409020541661191c612b25565b6001600160a01b0316816001600160a01b03161461197c5760405162461bcd60e51b815260206004820152600d60248201527f4163636573732044656e696564000000000000000000000000000000000000006044820152606401610a65565b60608061198885612fdd565b9092509050611998828288613006565b6000636d4d6e37866040516024016119b091906146c6565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050600080886001600160a01b031683604051611a0e9190614473565b6000604051808303816000865af19150503d8060008114611a4b576040519150601f19603f3d011682016040523d82523d6000602084013e611a50565b606091505b5091509150818015611a7a575080511580611a7a575080806020019051810190611a7a91906142a7565b611ac65760405162461bcd60e51b815260206004820152600e60248201527f52656e6577616c204661696c65640000000000000000000000000000000000006044820152606401610a65565b7f177e5dcc817784ce028d3c5b70c77d199fab2fb6573712763c315cb353151a41898942604051611af9939291906145ca565b60405180910390a150506001805550505050505050565b600054610100900460ff1680611b29575060005460ff16155b611b9b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a65565b600054610100900460ff16158015611bc6576000805460ff1961ff0019909116610100171660011790555b611bce613188565b611be06000611bdb612b25565b6127f8565b611be8613262565b611bf0613320565b611c2e6040518060400160405280600881526020017f4449594641524d530000000000000000000000000000000000000000000000008152506133de565b611c36610bc8565b6005610131558015610faa576000805461ff001916905550565b6000611c5c81336126e6565b611c6461344c565b6040514281527fb63d8d2a7522daeb15befdb899d28a8a8dd7e4b072b877782518a71e6ae38aa590602001610c68565b7faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c611cbf81336126e6565b6001600160a01b038216600090815261013760205260409020805460ff191660011790557fe165538c991a5caff3b46cf1dcfe21456ace47379725e082d6e4f8f0e1c3aaa582611d0d612b25565b604080516001600160a01b039384168152929091166020830152015b60405180910390a15050565b7faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c611d6081336126e6565b6001600160a01b038216600090815261013760205260409020805460ff191690557fd00ae7379ee87484d5e7922c10a8e7a3f51d5aa341b65966821fe0e6006837ca82611d0d612b25565b6101346020528160005260406000208181548110611dc857600080fd5b6000918252602090912001546001600160a01b03169150829050565b6000611df081336126e6565b8161013284604051611e029190614473565b90815260405190819003602001812080546001600160a01b03939093167fffffffffffffffffffffffff0000000000000000000000000000000000000000909316929092179091557f38f6936bda115a4b75babb692a178f52e9896da939e556cbb655d801e59f523990611e7990859085906146d9565b60405180910390a1505050565b7faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c611eb181336126e6565b6001600160a01b0382166000818152610133602052604090819020600201805460ff19169055517fab2d03b89d9bfa2e57ecb8db64fbe9f1eeb17a2448ff461565fae496f3ca7b2990611f079042815260200190565b60405180910390a25050565b7faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c611f3e81336126e6565b604080516001600160a01b03868116602483015285811660448084019190915283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f1ff9b6f200000000000000000000000000000000000000000000000000000000179052915190916000918291861690611fce908590614473565b6000604051808303816000865af19150503d806000811461200b576040519150601f19603f3d011682016040523d82523d6000602084013e612010565b606091505b509150915081801561203a57508051158061203a57508080602001905181019061203a91906142a7565b6120865760405162461bcd60e51b815260206004820152600d60248201527f526573637565204661696c6564000000000000000000000000000000000000006044820152606401610a65565b604080516001600160a01b03808a16825280891660208301528716918101919091527f3158698087c4b44381c6e3036919909aeb981e423c22eacc2c83ea0cd8209a61906060015b60405180910390a150505050505050565b60006120eb81336126e6565b6101305460ff166121645760405162461bcd60e51b815260206004820152602260248201527f556e617574686f72697a65644465706c6f796d656e743a206e6f74207061757360448201527f65640000000000000000000000000000000000000000000000000000000000006064820152608401610a65565b610130805460ff191690556040514281527f25d64ae29ac5e92749c4f8bae44eca23e496414fb785aa883f03d315a1bacc6790602001610c68565b60006121ab81336126e6565b6101318290557f781cf2b4cb45f01b82a7cedf00f4afa66e24c5df4f8ba8e3d0b97539ac315390826121db612b25565b604080519283526001600160a01b03909116602083015201611d29565b600082815260fb602052604090206001015461221481336126e6565b610d7e83836128d2565b7faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c61224981336126e6565b604080516001600160a01b03858116602483015286811660448084019190915283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f9adb3836000000000000000000000000000000000000000000000000000000001790529151909160009182918616906122d9908590614473565b6000604051808303816000865af19150503d8060008114612316576040519150601f19603f3d011682016040523d82523d6000602084013e61231b565b606091505b509150915081801561234557508051158061234557508080602001905181019061234591906142a7565b6123915760405162461bcd60e51b815260206004820152600d60248201527f526573637565204661696c6564000000000000000000000000000000000000006044820152606401610a65565b604080516001600160a01b03808a16825280891660208301528716918101919091527f3cc087143cb5f1d6ef4363b4b49b5275fd74f0fe07d7f0da323f845cb3ef8fd9906060016120ce565b61013581815481106123ee57600080fd5b6000918252602090912060049091020180546001820180546001600160a01b0390921693509061241d9061480f565b80601f01602080910402602001604051908101604052809291908181526020018280546124499061480f565b80156124965780601f1061246b57610100808354040283529160200191612496565b820191906000526020600020905b81548152906001019060200180831161247957829003601f168201915b5050505050908060020180546124ab9061480f565b80601f01602080910402602001604051908101604052809291908181526020018280546124d79061480f565b80156125245780601f106124f957610100808354040283529160200191612524565b820191906000526020600020905b81548152906001019060200180831161250757829003601f168201915b5050506003909301549192505060ff1684565b7faf290d8680820aad922855f39b306097b20e28774d6c1ad35a20325630c3a02c61256281336126e6565b6001600160a01b0383166000818152610133602052604090819020848155600201805460ff19166001179055517f48dec0897c56e5cec88037010a806e62409bcf42fc2b73076a66260d80215f76906125be9042815260200190565b60405180910390a2505050565b60006001600160a01b0386166126495760405162461bcd60e51b815260206004820152602560248201527f4e61746976654d6574615472616e73616374696f6e3a20494e56414c49445f5360448201527f49474e45520000000000000000000000000000000000000000000000000000006064820152608401610a65565b600161265c612657876134dc565b613559565b6040805160008152602081018083529290925260ff851690820152606081018690526080810185905260a0016020604051602081039080840390855afa1580156126aa573d6000803e3d6000fd5b505050602060405103516001600160a01b0316866001600160a01b031614905095945050505050565b60006126df8284614759565b9392505050565b600082815260fb602090815260408083206001600160a01b038516845290915290205460ff16610e0b57612724816001600160a01b031660146135a3565b61272f8360206135a3565b6040516020016127409291906144d9565b60408051601f198184030181529082905262461bcd60e51b8252610a65916004016146c6565b60975460ff166127b85760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610a65565b6097805460ff191690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b610e0b828261284d565b600082815260fb6020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b600082815260fb602090815260408083206001600160a01b038516845290915290205460ff16610e0b57600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b600082815260fb602090815260408083206001600160a01b038516845290915290205460ff1615610e0b57600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610e0b81336126e6565b60006129947f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905061299f84613812565b6000835111806129ac5750815b156129bd576129bb84846138df565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff16612b1e57805460ff191660011781556040516001600160a01b0383166024820152612a6a90869060440160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f3659cfe6000000000000000000000000000000000000000000000000000000001790526138df565b50805460ff191681557f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b03838116911614612b155760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201527f75727468657220757067726164657300000000000000000000000000000000006064820152608401610a65565b612b1e856139d8565b5050505050565b600033301415612b7c57600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b03169150610cbc9050565b503390565b60008061013284604051612b959190614473565b908152604051908190036020019020546001600160a01b0316905080612bfd5760405162461bcd60e51b815260206004820152601260248201527f5374726174656779204e6f7420466f756e6400000000000000000000000000006044820152606401610a65565b6000612c0882613a18565b9050600063cce2df0385612c1a612b25565b604051602401612c2b9291906146d9565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050600080836001600160a01b031683604051612c899190614473565b6000604051808303816000865af19150503d8060008114612cc6576040519150601f19603f3d011682016040523d82523d6000602084013e612ccb565b606091505b5091509150818015612cf5575080511580612cf5575080806020019051810190612cf591906142a7565b612d415760405162461bcd60e51b815260206004820152601560248201527f496e697469616c697a6174696f6e204661696c656400000000000000000000006044820152606401610a65565b6101346000612d4e612b25565b6001600160a01b03908116825260208083019390935260409091016000908120805460018101825590825292902090910180547fffffffffffffffffffffffff000000000000000000000000000000000000000016918616919091179055612db4612b25565b6001600160a01b0385811660009081526101366020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001693909216929092179055612e0c612e07612b25565b613ace565b905060006040518060800160405280876001600160a01b031681526020018a81526020018b8152602001836002811115612e5657634e487b7160e01b600052602160045260246000fd5b90526101358054600181018255600091909152815160049091027fdf37d27e88e3bd0b85262482997e409a463f5be0ebb19232abf994dd8474090d810180546001600160a01b039093167fffffffffffffffffffffffff000000000000000000000000000000000000000090931692909217825560208084015180519495508594612f08937fdf37d27e88e3bd0b85262482997e409a463f5be0ebb19232abf994dd8474090e01929190910190613ef2565b5060408201518051612f24916002840191602090910190613ef2565b50606082015160038201805460ff19166001836002811115612f5657634e487b7160e01b600052602160045260246000fd5b02179055505050606080612f698b612fdd565b9092509050612f7982828a613006565b7fd323afd66142298c8bfcc4cc346b4f3c51efc99ceca65215806ecfc0fdda81f388612fa3612b25565b604080516001600160a01b039384168152929091166020830152429082015260600160405180910390a150959a9950505050505050505050565b60608060008084806020019051810190612ff7919061407e565b90975095505050505050915091565b60005b835181101561318257600083828151811061303457634e487b7160e01b600052603260045260246000fd5b60200260200101519050600085838151811061306057634e487b7160e01b600052603260045260246000fd5b60200260200101519050806001600160a01b03166323b872dd613081612b25565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039182166004820152908716602482015260448101859052606401602060405180830381600087803b1580156130e957600080fd5b505af11580156130fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061312191906142a7565b61316d5760405162461bcd60e51b815260206004820152600f60248201527f5472616e73666572204661696c656400000000000000000000000000000000006044820152606401610a65565b5050808061317a9061484a565b915050613009565b50505050565b600054610100900460ff16806131a1575060005460ff16155b6132135760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a65565b600054610100900460ff1615801561323e576000805460ff1961ff0019909116610100171660011790555b613246613b90565b61324e613b90565b8015610faa576000805461ff001916905550565b600054610100900460ff168061327b575060005460ff16155b6132ed5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a65565b600054610100900460ff16158015613318576000805460ff1961ff0019909116610100171660011790555b61324e613c59565b600054610100900460ff1680613339575060005460ff16155b6133ab5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a65565b600054610100900460ff161580156133d6576000805460ff1961ff0019909116610100171660011790555b61324e613d2d565b61012d5460ff16156134325760405162461bcd60e51b815260206004820152600e60248201527f616c726561647920696e697465640000000000000000000000000000000000006044820152606401610a65565b61343b81613dfb565b5061012d805460ff19166001179055565b60975460ff161561349f5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a65565b6097805460ff191660011790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258906020016127ee565b60006040518060800160405280604381526020016148c5604391398051602091820120835184830151604080870151805190860120905161353c950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000613563610cb7565b6040517f1901000000000000000000000000000000000000000000000000000000000000602082015260228101919091526042810183905260620161353c565b606060006135b2836002614771565b6135bd906002614759565b67ffffffffffffffff8111156135e357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561360d576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061365257634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106136c357634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006136ff846002614771565b61370a906001614759565b90505b60018111156137c3577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061375957634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061377d57634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936137bc816147da565b905061370d565b5083156126df5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a65565b803b6138865760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610a65565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6060823b6139555760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610a65565b600080846001600160a01b0316846040516139709190614473565b600060405180830381855af49150503d80600081146139ab576040519150601f19603f3d011682016040523d82523d6000602084013e6139b0565b606091505b5091509150610bbf828260405180606001604052806027815260200161495760279139613eb9565b6139e181613812565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60006040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528260601b60148201527f5af43d82803e903d91602b57fd5bf3000000000000000000000000000000000060288201526037816000f09150506001600160a01b0381166109b35760405162461bcd60e51b815260206004820152601660248201527f455243313136373a20637265617465206661696c6564000000000000000000006044820152606401610a65565b6001600160a01b03811660009081527fc88390e7e62175be0932452175b6a7222b6b094ab0ef984a5153c620345d89756020526040812054819060ff1680613b4d57506001600160a01b03831660009081527fc42a968cef118bc8085d7d6f97f92a2637f2653a31a5e6ec4a83430a34118213602052604090205460ff165b15613b5a575060006109b0565b6001600160a01b0383166000908152610133602052604090206002015460ff1615613b87575060016109b0565b50600292915050565b600054610100900460ff1680613ba9575060005460ff16155b613c1b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a65565b600054610100900460ff1615801561324e576000805460ff1961ff0019909116610100171660011790558015610faa576000805461ff001916905550565b600054610100900460ff1680613c72575060005460ff16155b613ce45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a65565b600054610100900460ff16158015613d0f576000805460ff1961ff0019909116610100171660011790555b6097805460ff191690558015610faa576000805461ff001916905550565b600054610100900460ff1680613d46575060005460ff16155b613db85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a65565b600054610100900460ff16158015613de3576000805460ff1961ff0019909116610100171660011790555b600180558015610faa576000805461ff001916905550565b6040518060800160405280604f8152602001614908604f91398051602091820120825192820192909220604080518082018252600181527f310000000000000000000000000000000000000000000000000000000000000090840152805180840194909452838101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608401523060808401524660a0808501919091528151808503909101815260c09093019052815191012061012e55565b60608315613ec85750816126df565b825115613ed85782518084602001fd5b8160405162461bcd60e51b8152600401610a6591906146c6565b828054613efe9061480f565b90600052602060002090601f016020900481019282613f205760008555613f66565b82601f10613f3957805160ff1916838001178555613f66565b82800160010185558215613f66579182015b82811115613f66578251825591602001919060010190613f4b565b50613f72929150613f76565b5090565b5b80821115613f725760008155600101613f77565b600082601f830112613f9b578081fd5b81516020613fb0613fab83614735565b614704565b8281528181019085830183850287018401881015613fcc578586fd5b855b85811015613fea57815184529284019290840190600101613fce565b5090979650505050505050565b600082601f830112614007578081fd5b813567ffffffffffffffff81111561402157614021614899565b6140346020601f19601f84011601614704565b818152846020838601011115614048578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215614073578081fd5b81356126df816148af565b600080600080600060a08688031215614095578081fd5b85516140a0816148af565b80955050602080870151945060408701519350606087015167ffffffffffffffff808211156140cd578384fd5b818901915089601f8301126140e0578384fd5b81516140ee613fab82614735565b81815284810190848601868402860187018e101561410a578788fd5b8795505b83861015614135578051614121816148af565b83526001959095019491860191860161410e565b5060808c0151909750945050508083111561414e578384fd5b505061415c88828901613f8b565b9150509295509295909350565b60008060006060848603121561417d578283fd5b8335614188816148af565b92506020840135614198816148af565b915060408401356141a8816148af565b809150509250925092565b600080604083850312156141c5578182fd5b82356141d0816148af565b9150602083013567ffffffffffffffff8111156141eb578182fd5b6141f785828601613ff7565b9150509250929050565b600080600080600060a08688031215614218578081fd5b8535614223816148af565b9450602086013567ffffffffffffffff81111561423e578182fd5b61424a88828901613ff7565b9450506040860135925060608601359150608086013560ff8116811461426e578182fd5b809150509295509295909350565b6000806040838503121561428e578182fd5b8235614299816148af565b946020939093013593505050565b6000602082840312156142b8578081fd5b815180151581146126df578182fd5b6000602082840312156142d8578081fd5b5035919050565b600080604083850312156142f1578182fd5b823591506020830135614303816148af565b809150509250929050565b60006020828403121561431f578081fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146126df578182fd5b60006020828403121561435f578081fd5b813567ffffffffffffffff811115614375578182fd5b61438184828501613ff7565b949350505050565b6000806040838503121561439b578182fd5b823567ffffffffffffffff8111156143b1578283fd5b6143bd85828601613ff7565b9250506020830135614303816148af565b600080604083850312156143e0578182fd5b823567ffffffffffffffff808211156143f7578384fd5b61440386838701613ff7565b93506020850135915080821115614418578283fd5b506141f785828601613ff7565b6000815180845261443d8160208601602086016147ae565b601f01601f19169290920160200192915050565b6003811061446f57634e487b7160e01b600052602160045260246000fd5b9052565b600082516144858184602087016147ae565b9190910192915050565b600083516144a18184602088016147ae565b60609390931b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169190920190815260140192915050565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516145118160178501602088016147ae565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161454e8160288401602088016147ae565b01602801949350505050565b60006001600160a01b03808616835280851660208401525060606040830152610bbf6060830184614425565b60006001600160a01b0386168252608060208301526145a86080830186614425565b82810360408401526145ba8186614425565b915050610bbf6060830184614451565b60006001600160a01b0385168252606060208301526145ec6060830185614425565b9050826040830152949350505050565b60208082528251828201819052600091906040908185019080840286018301878501865b838110156146b8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0898403018552815160806001600160a01b03825116855288820151818a87015261467582870182614425565b915050878201518582038987015261468d8282614425565b91505060608083015192506146a481870184614451565b509588019593505090860190600101614620565b509098975050505050505050565b6000602082526126df6020830184614425565b6000604082526146ec6040830185614425565b90506001600160a01b03831660208301529392505050565b604051601f8201601f1916810167ffffffffffffffff8111828210171561472d5761472d614899565b604052919050565b600067ffffffffffffffff82111561474f5761474f614899565b5060209081020190565b6000821982111561476c5761476c614883565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156147a9576147a9614883565b500290565b60005b838110156147c95781810151838201526020016147b1565b838111156131825750506000910152565b6000816147e9576147e9614883565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60028104600182168061482357607f821691505b6020821081141561484457634e487b7160e01b600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561487c5761487c614883565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610faa57600080fdfe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c6164647265737320766572696679696e67436f6e74726163742c627974657333322073616c7429416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000802000a
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.