Overview
ETH Balance
0 ETH
Eth Value
$0.00Token Holdings
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,506 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Unstake | 20207175 | 95 days ago | IN | 0 ETH | 0.00041525 | ||||
Claim | 20124951 | 107 days ago | IN | 0 ETH | 0.00029426 | ||||
Unstake | 20056783 | 116 days ago | IN | 0 ETH | 0.00098031 | ||||
Unstake | 19791765 | 153 days ago | IN | 0 ETH | 0.00037913 | ||||
Unstake | 19724264 | 163 days ago | IN | 0 ETH | 0.00098352 | ||||
Unstake | 19602056 | 180 days ago | IN | 0 ETH | 0.00124845 | ||||
Unstake | 19587527 | 182 days ago | IN | 0 ETH | 0.00170256 | ||||
Unstake | 19489444 | 196 days ago | IN | 0 ETH | 0.00289578 | ||||
Unstake | 19441085 | 202 days ago | IN | 0 ETH | 0.0047644 | ||||
Unstake | 19432370 | 204 days ago | IN | 0 ETH | 0.00533301 | ||||
Unstake | 19390592 | 209 days ago | IN | 0 ETH | 0.00674159 | ||||
Unstake | 19337259 | 217 days ago | IN | 0 ETH | 0.00401177 | ||||
Claim | 19337251 | 217 days ago | IN | 0 ETH | 0.00328627 | ||||
Unstake | 19307770 | 221 days ago | IN | 0 ETH | 0.00253153 | ||||
Unstake | 19305005 | 221 days ago | IN | 0 ETH | 0.00285082 | ||||
Unstake | 19301785 | 222 days ago | IN | 0 ETH | 0.00239699 | ||||
Unstake | 19234882 | 231 days ago | IN | 0 ETH | 0.00462707 | ||||
Unstake | 19211313 | 235 days ago | IN | 0 ETH | 0.00175947 | ||||
Unstake | 19193507 | 237 days ago | IN | 0 ETH | 0.00569292 | ||||
Unstake | 19182081 | 239 days ago | IN | 0 ETH | 0.00399037 | ||||
Unstake | 19121960 | 247 days ago | IN | 0 ETH | 0.00241266 | ||||
Unstake | 19118160 | 248 days ago | IN | 0 ETH | 0.00277702 | ||||
Unstake | 19090388 | 251 days ago | IN | 0 ETH | 0.00226795 | ||||
Unstake | 19077935 | 253 days ago | IN | 0 ETH | 0.00164007 | ||||
Unstake | 19070775 | 254 days ago | IN | 0 ETH | 0.00237484 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
UnipilotStaking
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 10 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity 0.8.15; // Openzeppelin helper import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; // Definition of custom errors error AmountLessThanStakedAmountOrZero(); error CallerNotGovernance(); error EtherNotAccepted(); error InsufficientFunds(); error InsufficientPilotFunds(); error InputLengthMismatch(); error NoPendingRewardsToClaim(); error NoStakeFound(); error PilotAddressInput(); error RewardDistributionPeriodHasExpired(); error RewardPerBlockIsNotSet(); error SameRewardToken(); error ZeroAddress(); error ZeroInput(); /// @title Unipilot Staking /// @author @hammadghazi007 & @mutahhirEth /// @notice Contract for staking Unipilot to earn rewards contract UnipilotStaking { using SafeERC20 for IERC20Metadata; // Info of each user struct UserInfo { uint256 lastUpdateRewardToken; // Timestamp of last reward token update - used to reset user reward debt uint256 amount; // Amount of pilot tokens staked by the user uint256 rewardDebt; // Reward debt } // To determine transaction type enum TxType { STAKE, UNSTAKE, CLAIM, EMERGENCY } // Address of the pilot token IERC20Metadata public immutable pilotToken; // Address of the reward token IERC20Metadata public rewardToken; // Address of the governance address public governance; // Precision factor for multiple calculations uint256 public constant ONE = 1e18; // Accumulated reward per pilot token uint256 public accRewardPerPilot; // Last update block for rewards uint256 public lastUpdateBlock; // Total pilot tokens staked uint256 public totalPilotStaked; // Reward to distribute per block uint256 public currentRewardPerBlock; // Current end block for the current reward period uint256 public periodEndBlock; // Last time reward token was updated uint256 public lastUpdateRewardToken; // Info of each user that stakes Pilot tokens mapping(address => UserInfo) public userInfo; event StakeOrUnstakeOrClaim( address indexed user, uint256 amount, uint256 pendingReward, TxType txType ); event NewRewardPeriod( uint256 numberBlocksToDistributeRewards, uint256 newRewardPerBlock, uint256 rewardToDistribute, uint256 rewardExpirationBlock ); event GovernanceChanged( address indexed oldGovernance, address indexed newGovernance ); event RewardTokenChanged( address indexed oldRewardToken, address indexed newRewardToken ); event FundsMigrated( address indexed _newVersion, IERC20Metadata[] _tokens, uint256[] _amounts ); event PeriodEndBlockUpdate( uint256 numberBlocksToDistributeRewards, uint256 rewardExpirationBlock ); /** * @notice Constructor * @param _governance governance address of unipilot staking * @param _rewardToken address of the reward token * @param _pilotToken address of the pilot token */ constructor( address _governance, address _rewardToken, address _pilotToken ) { if ( _governance == address(0) || _rewardToken == address(0) || _pilotToken == address(0) ) revert ZeroAddress(); governance = _governance; rewardToken = IERC20Metadata(_rewardToken); pilotToken = IERC20Metadata(_pilotToken); emit GovernanceChanged(address(0), _governance); emit RewardTokenChanged(address(0), _rewardToken); } /** * @dev Throws if ether is received */ receive() external payable { revert EtherNotAccepted(); } /** * @dev Throws if called by any account other than the governance */ modifier onlyGovernance() { if (msg.sender != governance) revert CallerNotGovernance(); _; } /** * @notice Updates the governance of this contract * @param _newGovernance address of the new governance of this contract * @dev Only callable by Governance */ function setGovernance(address _newGovernance) external onlyGovernance { if (_newGovernance == address(0)) revert ZeroAddress(); emit GovernanceChanged(governance, _newGovernance); governance = _newGovernance; } /** * @notice Updates the reward token. * @param _newRewardToken address of the new reward token * @dev Only callable by Governance. It also resets reward distribution accounting */ function updateRewardToken(address _newRewardToken) external onlyGovernance { if (_newRewardToken == address(rewardToken)) revert SameRewardToken(); if (_newRewardToken == address(0)) revert ZeroAddress(); // Resetting reward distribution accounting accRewardPerPilot = 0; lastUpdateBlock = _lastRewardBlock(); // Setting reward token update time lastUpdateRewardToken = block.timestamp; emit RewardTokenChanged(address(rewardToken), _newRewardToken); // Updating reward token address rewardToken = IERC20Metadata(_newRewardToken); } /** * @notice Updates the reward per block * @param _reward total reward to distribute. * @param _rewardDurationInBlocks total number of blocks in which the '_reward' should be distributed * @dev Only callable by Governance. */ function updateRewards(uint256 _reward, uint256 _rewardDurationInBlocks) external onlyGovernance { if (_rewardDurationInBlocks == 0) revert ZeroInput(); // Update reward distribution accounting _updateRewardPerPilotAndLastBlock(); // Adjust the current reward per block // If reward distribution duration is expired if (block.number >= periodEndBlock) { if (_reward == 0) revert ZeroInput(); currentRewardPerBlock = _reward / _rewardDurationInBlocks; } // Otherwise, reward distribution duration isn't expired else { currentRewardPerBlock = (_reward + ((periodEndBlock - block.number) * currentRewardPerBlock)) / _rewardDurationInBlocks; } lastUpdateBlock = block.number; // Setting rewards expiration block periodEndBlock = block.number + _rewardDurationInBlocks; emit NewRewardPeriod( _rewardDurationInBlocks, currentRewardPerBlock, _reward, periodEndBlock ); } /** * @notice Updates the reward distribution duration end block * @param _expireDurationInBlocks number of blocks after which reward distribution should be halted * @dev Only callable by Governance */ function updateRewardEndBlock(uint256 _expireDurationInBlocks) external onlyGovernance { // Update reward distribution accounting _updateRewardPerPilotAndLastBlock(); lastUpdateBlock = block.number; // Setting rewards expiration block periodEndBlock = block.number + _expireDurationInBlocks; emit PeriodEndBlockUpdate(_expireDurationInBlocks, periodEndBlock); } /** * @notice Migrates the funds to another address. * @param _newVersion receiver address of the funds * @param _tokens list of token addresses * @param _amounts list of funds amount * @param _isPilotMigrate whether to transfer pilot tokens * @dev Only callable by Governance. */ function migrateFunds( address _newVersion, IERC20Metadata[] calldata _tokens, uint256[] calldata _amounts, bool _isPilotMigrate ) external onlyGovernance { if (_newVersion == address(0)) revert ZeroAddress(); if (_tokens.length != _amounts.length) revert InputLengthMismatch(); // Declaring outside the loop to save gas IERC20Metadata tokenAddress; uint256 amount; for (uint256 i; i < _tokens.length; ) { // Local copy to save gas tokenAddress = _tokens[i]; amount = _amounts[i]; if (tokenAddress == pilotToken) revert PilotAddressInput(); if (address(tokenAddress) == address(0)) revert ZeroAddress(); if (amount == 0) revert ZeroInput(); if (amount > tokenAddress.balanceOf(address(this))) revert InsufficientFunds(); tokenAddress.safeTransfer(_newVersion, amount); unchecked { ++i; } } // Migrate pilot tokens if (_isPilotMigrate) { // Pilot token balance of this contract minus staked pilot uint256 protocolPilotBalance = pilotToken.balanceOf(address(this)) - totalPilotStaked; // If protocol owns any pilot in this contract then transfer if (protocolPilotBalance > 0) pilotToken.safeTransfer(_newVersion, protocolPilotBalance); else revert InsufficientPilotFunds(); } emit FundsMigrated(_newVersion, _tokens, _amounts); } /** * @notice Stake pilot tokens. Also triggers a claim. * @param _to staking reward receiver address * @param _amount amount of pilot tokens to stake */ function stake(address _to, uint256 _amount) external { if (_amount == 0) revert ZeroInput(); if (_to == address(0)) revert ZeroAddress(); if (currentRewardPerBlock == 0) revert RewardPerBlockIsNotSet(); if (block.number >= periodEndBlock) revert RewardDistributionPeriodHasExpired(); if (rewardToken.balanceOf(address(this)) == 0) revert InsufficientFunds(); _stakeOrUnstakeOrClaim(_to, _amount, TxType.STAKE); } /** * @notice Unstake pilot tokens. Also triggers a reward claim. * @param _amount amount of pilot tokens to unstake */ function unstake(uint256 _amount) external { if ((_amount > userInfo[msg.sender].amount) || _amount == 0) revert AmountLessThanStakedAmountOrZero(); _stakeOrUnstakeOrClaim(msg.sender, _amount, TxType.UNSTAKE); } /** * @notice Unstake all staked pilot tokens without caring about rewards, EMERGENCY ONLY */ function emergencyUnstake() external { if (userInfo[msg.sender].amount > 0) { _stakeOrUnstakeOrClaim( msg.sender, userInfo[msg.sender].amount, TxType.EMERGENCY ); } else revert NoStakeFound(); } /** * @notice Claim pending rewards. */ function claim() external { _stakeOrUnstakeOrClaim( msg.sender, userInfo[msg.sender].amount, TxType.CLAIM ); } /** * @notice Calculate pending rewards for a user * @param _user address of the user * @return pending rewards of the user */ function calculatePendingRewards(address _user) external view returns (uint256) { uint256 newAccRewardPerPilot; if (totalPilotStaked != 0) { newAccRewardPerPilot = accRewardPerPilot + (((_lastRewardBlock() - lastUpdateBlock) * (currentRewardPerBlock * ONE)) / totalPilotStaked); // If checking user pending rewards in the block in which reward token is updated if (newAccRewardPerPilot == 0) return 0; } else return 0; uint256 rewardDebt = userInfo[_user].rewardDebt; // Reset debt if user is checking rewards after reward token has changed if (userInfo[_user].lastUpdateRewardToken < lastUpdateRewardToken) rewardDebt = 0; uint256 pendingRewards = ((userInfo[_user].amount * newAccRewardPerPilot) / ONE) - rewardDebt; // Downscale if reward token has less than 18 decimals if (_computeScalingFactor(rewardToken) != 1) { // Downscaling pending rewards before transferring to the user pendingRewards = _downscale(pendingRewards); } return pendingRewards; } /** * @notice Return last block where trading rewards were distributed */ function lastRewardBlock() external view returns (uint256) { return _lastRewardBlock(); } /** * @notice Stake/ Unstake pilot tokens and also distributes reward * @param _to staking reward receiver address * @param _amount amount of pilot tokens to stake or unstake. 0 if claim tx. * @param _txType type of the transaction */ function _stakeOrUnstakeOrClaim( address _to, uint256 _amount, TxType _txType ) private { // Update reward distribution accounting _updateRewardPerPilotAndLastBlock(); // Reset debt if reward token has changed _resetDebtIfNewRewardToken(_to); UserInfo storage user = userInfo[_to]; uint256 pendingRewards; // Distribute rewards if not emergency unstake if (TxType.EMERGENCY != _txType) { // Distribute rewards if not new stake if (user.amount > 0) { // Calculate pending rewards pendingRewards = _calculatePendingRewards(_to); // Downscale if reward token has less than 18 decimals if (_computeScalingFactor(rewardToken) != 1) { // Downscaling pending rewards before transferring to the user pendingRewards = _downscale(pendingRewards); } // If there are rewards to distribute if (pendingRewards > 0) { if (pendingRewards > rewardToken.balanceOf(address(this))) revert InsufficientFunds(); // Transferring rewards to the user rewardToken.safeTransfer(_to, pendingRewards); } // If there are no pending rewards and tx is of claim then revert else if (TxType.CLAIM == _txType) revert NoPendingRewardsToClaim(); } // Claiming rewards without any stake else if (TxType.CLAIM == _txType) revert NoPendingRewardsToClaim(); } if (TxType.STAKE == _txType) { // Transfer Pilot tokens from the caller to this contract pilotToken.safeTransferFrom(msg.sender, address(this), _amount); // Increase user pilot staked amount user.amount += _amount; // Increase total pilot staked amount totalPilotStaked += _amount; } else if (TxType.UNSTAKE == _txType || TxType.EMERGENCY == _txType) { // Decrease user pilot staked amount user.amount -= _amount; // Decrease total pilot staked amount totalPilotStaked -= _amount; // Transfer Pilot tokens back to the sender pilotToken.safeTransfer(_to, _amount); } // Adjust user debt user.rewardDebt = (user.amount * accRewardPerPilot) / ONE; emit StakeOrUnstakeOrClaim(_to, _amount, pendingRewards, _txType); } /** * @notice Resets user reward debt if reward token has changed * @param _to reward debt reset address */ function _resetDebtIfNewRewardToken(address _to) private { // Reset debt if user last update reward token time is less than the time of last reward token update if (userInfo[_to].lastUpdateRewardToken < lastUpdateRewardToken) { userInfo[_to].rewardDebt = 0; userInfo[_to].lastUpdateRewardToken = lastUpdateRewardToken; } } /** * @notice Updates accumulated reward to distribute per pilot token. Also updates the last block in which rewards are distributed */ function _updateRewardPerPilotAndLastBlock() private { if (totalPilotStaked == 0) { lastUpdateBlock = block.number; return; } accRewardPerPilot += ((_lastRewardBlock() - lastUpdateBlock) * (currentRewardPerBlock * ONE)) / totalPilotStaked; if (block.number != lastUpdateBlock) lastUpdateBlock = _lastRewardBlock(); } /** * @notice Calculate pending rewards for a user * @param _user address of the user */ function _calculatePendingRewards(address _user) private view returns (uint256) { return ((userInfo[_user].amount * accRewardPerPilot) / ONE) - userInfo[_user].rewardDebt; } /** * @notice Return last block where rewards must be distributed */ function _lastRewardBlock() private view returns (uint256) { return block.number < periodEndBlock ? block.number : periodEndBlock; } /** * @notice Returns a scaling factor that, when multiplied to a token amount for `token`, normalizes its balance as if * it had 18 decimals. */ function _computeScalingFactor(IERC20Metadata _token) private view returns (uint256) { // Tokens that don't implement the `decimals` method are not supported. uint256 tokenDecimals = _token.decimals(); // Tokens with more than 18 decimals are not supported. uint256 decimalsDifference = 18 - tokenDecimals; return 10**decimalsDifference; } /** * @notice Reverses the upscaling applied to `amount`, resulting in a smaller or equal value depending on * whether it needed scaling or not */ function _downscale(uint256 _amount) private view returns (uint256) { return _amount / _computeScalingFactor(rewardToken); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @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); } } } }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 10 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_governance","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"address","name":"_pilotToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AmountLessThanStakedAmountOrZero","type":"error"},{"inputs":[],"name":"CallerNotGovernance","type":"error"},{"inputs":[],"name":"EtherNotAccepted","type":"error"},{"inputs":[],"name":"InputLengthMismatch","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InsufficientPilotFunds","type":"error"},{"inputs":[],"name":"NoPendingRewardsToClaim","type":"error"},{"inputs":[],"name":"NoStakeFound","type":"error"},{"inputs":[],"name":"PilotAddressInput","type":"error"},{"inputs":[],"name":"RewardDistributionPeriodHasExpired","type":"error"},{"inputs":[],"name":"RewardPerBlockIsNotSet","type":"error"},{"inputs":[],"name":"SameRewardToken","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroInput","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_newVersion","type":"address"},{"indexed":false,"internalType":"contract IERC20Metadata[]","name":"_tokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"FundsMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldGovernance","type":"address"},{"indexed":true,"internalType":"address","name":"newGovernance","type":"address"}],"name":"GovernanceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"numberBlocksToDistributeRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRewardPerBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardToDistribute","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardExpirationBlock","type":"uint256"}],"name":"NewRewardPeriod","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"numberBlocksToDistributeRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardExpirationBlock","type":"uint256"}],"name":"PeriodEndBlockUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldRewardToken","type":"address"},{"indexed":true,"internalType":"address","name":"newRewardToken","type":"address"}],"name":"RewardTokenChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pendingReward","type":"uint256"},{"indexed":false,"internalType":"enum UnipilotStaking.TxType","name":"txType","type":"uint8"}],"name":"StakeOrUnstakeOrClaim","type":"event"},{"inputs":[],"name":"ONE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accRewardPerPilot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"calculatePendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentRewardPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"governance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRewardBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateRewardToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newVersion","type":"address"},{"internalType":"contract IERC20Metadata[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"bool","name":"_isPilotMigrate","type":"bool"}],"name":"migrateFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"periodEndBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pilotToken","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newGovernance","type":"address"}],"name":"setGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalPilotStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_expireDurationInBlocks","type":"uint256"}],"name":"updateRewardEndBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newRewardToken","type":"address"}],"name":"updateRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_reward","type":"uint256"},{"internalType":"uint256","name":"_rewardDurationInBlocks","type":"uint256"}],"name":"updateRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"lastUpdateRewardToken","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a06040523480156200001157600080fd5b5060405162001c6538038062001c6583398101604081905262000034916200013c565b6001600160a01b03831615806200005257506001600160a01b038216155b806200006557506001600160a01b038116155b15620000845760405163d92e233d60e01b815260040160405180910390fd5b600180546001600160a01b038086166001600160a01b0319928316811790935560008054868316931692909217825583166080526040517f3aaaebeb4821d6a7e5c77ece53cff0afcc56c82add2c978dbbb7f73e84cbcfd2908290a36040516001600160a01b038316906000907fab27a2419bd7a3bc605bff66b38aacb84061d9e20edab7f7680ce52e6fcd9256908290a350505062000186565b80516001600160a01b03811681146200013757600080fd5b919050565b6000806000606084860312156200015257600080fd5b6200015d846200011f565b92506200016d602085016200011f565b91506200017d604085016200011f565b90509250925092565b608051611aa0620001c5600039600081816101ea015281816107c90152818161092f015281816109c20152818161103a01526111100152611aa06000f3fe6080604052600436106101095760003560e01c8063097aad101461012c5780631959a0021461015f5780632e17de78146101b657806339c3b99c146101d8578063442da82f146102195780634e71d92d1461022f5780635aa6e675146102445780635be9aa84146102645780637589cf2f1461027a5780638223c60c1461028f57806397e50818146102a5578063a0040736146102c5578063a218141b146102e5578063a9f8d181146102fb578063ab033ea914610310578063adc9772e14610330578063be7ebe7714610350578063c2ee3a0814610366578063cb4aec6114610382578063f5d9e4b214610398578063f7c618c1146103b8578063f8cf31cb146103d857600080fd5b3661012757604051630dccd20d60e21b815260040160405180910390fd5b600080fd5b34801561013857600080fd5b5061014c6101473660046115da565b6103f8565b6040519081526020015b60405180910390f35b34801561016b57600080fd5b5061019b61017a3660046115da565b60086020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610156565b3480156101c257600080fd5b506101d66101d13660046115f7565b61051d565b005b3480156101e457600080fd5b5061020c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516101569190611610565b34801561022557600080fd5b5061014c60065481565b34801561023b57600080fd5b506101d6610568565b34801561025057600080fd5b5060015461020c906001600160a01b031681565b34801561027057600080fd5b5061014c60045481565b34801561028657600080fd5b506101d6610589565b34801561029b57600080fd5b5061014c60025481565b3480156102b157600080fd5b506101d66102c0366004611624565b6105d9565b3480156102d157600080fd5b506101d66102e036600461169f565b610703565b3480156102f157600080fd5b5061014c60035481565b34801561030757600080fd5b5061014c610a5a565b34801561031c57600080fd5b506101d661032b3660046115da565b610a69565b34801561033c57600080fd5b506101d661034b366004611733565b610b17565b34801561035c57600080fd5b5061014c60075481565b34801561037257600080fd5b5061014c670de0b6b3a764000081565b34801561038e57600080fd5b5061014c60055481565b3480156103a457600080fd5b506101d66103b33660046115f7565b610c45565b3480156103c457600080fd5b5060005461020c906001600160a01b031681565b3480156103e457600080fd5b506101d66103f33660046115da565b610ccb565b60008060045460001461046c57600454670de0b6b3a764000060055461041e9190611775565b600354610429610dbb565b6104339190611794565b61043d9190611775565b61044791906117ab565b60025461045491906117cd565b9050806000036104675750600092915050565b610475565b50600092915050565b6001600160a01b038316600090815260086020526040902060028101546007549154909111156104a3575060005b6001600160a01b0384166000908152600860205260408120600101548290670de0b6b3a7640000906104d6908690611775565b6104e091906117ab565b6104ea9190611794565b600054909150610502906001600160a01b0316610dd2565b6001146105155761051281610e56565b90505b949350505050565b3360009081526008602052604090206001015481118061053b575080155b15610559576040516341a0765d60e11b815260040160405180910390fd5b61056533826001610e7c565b50565b3360008181526008602052604090206001015461058791906002610e7c565b565b33600090815260086020526040902060010154156105c0573360008181526008602052604090206001015461058791906003610e7c565b604051632cdf478160e11b815260040160405180910390fd5b6001546001600160a01b031633146106045760405163f2be30fb60e01b815260040160405180910390fd5b806000036106255760405163af458c0760e01b815260040160405180910390fd5b61062d6111af565b600654431061066957816000036106575760405163af458c0760e01b815260040160405180910390fd5b61066181836117ab565b60055561069d565b806005544360065461067b9190611794565b6106859190611775565b61068f90846117cd565b61069991906117ab565b6005555b4360038190556106ae9082906117cd565b6006819055600554604080518481526020810192909252810184905260608101919091527fde9c32a09b9b33b8ec313cd054ee758c1d6eaaaa43a5269496d63ec17001e91b9060800160405180910390a15050565b6001546001600160a01b0316331461072e5760405163f2be30fb60e01b815260040160405180910390fd5b6001600160a01b0386166107555760405163d92e233d60e01b815260040160405180910390fd5b8382146107755760405163aaad13f760e01b815260040160405180910390fd5b60008060005b8681101561090a57878782818110610795576107956117e5565b90506020020160208101906107aa91906115da565b92508585828181106107be576107be6117e5565b9050602002013591507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031603610819576040516331365d2560e21b815260040160405180910390fd5b6001600160a01b0383166108405760405163d92e233d60e01b815260040160405180910390fd5b816000036108615760405163af458c0760e01b815260040160405180910390fd5b6040516370a0823160e01b81526001600160a01b038416906370a082319061088d903090600401611610565b602060405180830381865afa1580156108aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ce91906117fb565b8211156108ee5760405163356680b760e01b815260040160405180910390fd5b6109026001600160a01b0384168a8461122d565b60010161077b565b508215610a0957600480546040516370a0823160e01b81526000926001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916370a082319161096291309101611610565b602060405180830381865afa15801561097f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a391906117fb565b6109ad9190611794565b905080156109ee576109e96001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168a8361122d565b610a07565b60405163cf2b32b560e01b815260040160405180910390fd5b505b876001600160a01b03167fd128d90658babd0cd73afa715caba1d52211c7d041a65228501bd8fe9d9e81c388888888604051610a489493929190611814565b60405180910390a25050505050505050565b6000610a64610dbb565b905090565b6001546001600160a01b03163314610a945760405163f2be30fb60e01b815260040160405180910390fd5b6001600160a01b038116610abb5760405163d92e233d60e01b815260040160405180910390fd5b6001546040516001600160a01b038084169216907f3aaaebeb4821d6a7e5c77ece53cff0afcc56c82add2c978dbbb7f73e84cbcfd290600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b80600003610b385760405163af458c0760e01b815260040160405180910390fd5b6001600160a01b038216610b5f5760405163d92e233d60e01b815260040160405180910390fd5b600554600003610b8257604051630e6a65f960e31b815260040160405180910390fd5b6006544310610ba4576040516302b113d760e31b815260040160405180910390fd5b6000546040516370a0823160e01b81526001600160a01b03909116906370a0823190610bd4903090600401611610565b602060405180830381865afa158015610bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1591906117fb565b600003610c355760405163356680b760e01b815260040160405180910390fd5b610c4182826000610e7c565b5050565b6001546001600160a01b03163314610c705760405163f2be30fb60e01b815260040160405180910390fd5b610c786111af565b436003819055610c899082906117cd565b60068190556040805183815260208101929092527fa8c9ab0c946981b63aaa38b74a8808bdc24c3e4814ec19bc1d77b83cf98de13d910160405180910390a150565b6001546001600160a01b03163314610cf65760405163f2be30fb60e01b815260040160405180910390fd5b6000546001600160a01b0390811690821603610d2557604051631a07168f60e01b815260040160405180910390fd5b6001600160a01b038116610d4c5760405163d92e233d60e01b815260040160405180910390fd5b6000600255610d59610dbb565b60035542600755600080546040516001600160a01b03808516939216917fab27a2419bd7a3bc605bff66b38aacb84061d9e20edab7f7680ce52e6fcd925691a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006006544310610dcd575060065490565b504390565b600080826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e379190611898565b60ff1690506000610e49826012611794565b905061051581600a61199f565b60008054610e6c906001600160a01b0316610dd2565b610e7690836117ab565b92915050565b610e846111af565b610e8d83611295565b6001600160a01b038316600090815260086020526040812090826003811115610eb857610eb86119ab565b60031461101457600182015415610fe257610ed2856112dd565b600054909150610eea906001600160a01b0316610dd2565b600114610efd57610efa81610e56565b90505b8015610fb0576000546040516370a0823160e01b81526001600160a01b03909116906370a0823190610f33903090600401611610565b602060405180830381865afa158015610f50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7491906117fb565b811115610f945760405163356680b760e01b815260040160405180910390fd5b600054610fab906001600160a01b0316868361122d565b611014565b826003811115610fc257610fc26119ab565b600203610fab57604051632e0f8c4960e01b815260040160405180910390fd5b826003811115610ff457610ff46119ab565b60020361101457604051632e0f8c4960e01b815260040160405180910390fd5b826003811115611026576110266119ab565b60000361109a576110626001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308761132d565b8382600101600082825461107691906117cd565b92505081905550836004600082825461108f91906117cd565b909155506111379050565b8260038111156110ac576110ac6119ab565b600114806110cb57508260038111156110c7576110c76119ab565b6003145b1561113757838260010160008282546110e49190611794565b9250508190555083600460008282546110fd9190611794565b9091555061113790506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016868661122d565b670de0b6b3a764000060025483600101546111529190611775565b61115c91906117ab565b60028301556040516001600160a01b038616907f28cbddf77ad6b07493e2020cd23c869986ccd78295364fb3f9ea4aa268f31e16906111a0908790859088906119c1565b60405180910390a25050505050565b6004546000036111bf5743600355565b600454670de0b6b3a76400006005546111d89190611775565b6003546111e3610dbb565b6111ed9190611794565b6111f79190611775565b61120191906117ab565b6002600082825461121291906117cd565b9091555050600354431461058757611228610dbb565b600355565b6040516001600160a01b03831660248201526044810182905261129090849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261136b565b505050565b6007546001600160a01b0382166000908152600860205260409020541015610565576001600160a01b0316600090815260086020526040812060028101919091556007549055565b6001600160a01b038116600090815260086020526040812060028082015490546001909201549091670de0b6b3a7640000916113199190611775565b61132391906117ab565b610e769190611794565b6040516001600160a01b03808516602483015283166044820152606481018290526113659085906323b872dd60e01b90608401611259565b50505050565b60006113c0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114429092919063ffffffff16565b80519091501561129057808060200190518101906113de91906119fb565b6112905760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084015b60405180910390fd5b6060611451848460008561145b565b90505b9392505050565b6060824710156114bc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611439565b6001600160a01b0385163b6115135760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611439565b600080866001600160a01b0316858760405161152f9190611a44565b60006040518083038185875af1925050503d806000811461156c576040519150601f19603f3d011682016040523d82523d6000602084013e611571565b606091505b509150915061158182828661158c565b979650505050505050565b6060831561159b575081611454565b8251156115ab5782518084602001fd5b8160405162461bcd60e51b81526004016114399190611a60565b6001600160a01b038116811461056557600080fd5b6000602082840312156115ec57600080fd5b8135611454816115c5565b60006020828403121561160957600080fd5b5035919050565b6001600160a01b0391909116815260200190565b6000806040838503121561163757600080fd5b50508035926020909101359150565b60008083601f84011261165857600080fd5b5081356001600160401b0381111561166f57600080fd5b6020830191508360208260051b850101111561168a57600080fd5b9250929050565b801515811461056557600080fd5b600080600080600080608087890312156116b857600080fd5b86356116c3816115c5565b955060208701356001600160401b03808211156116df57600080fd5b6116eb8a838b01611646565b9097509550604089013591508082111561170457600080fd5b5061171189828a01611646565b909450925050606087013561172581611691565b809150509295509295509295565b6000806040838503121561174657600080fd5b8235611751816115c5565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561178f5761178f61175f565b500290565b6000828210156117a6576117a661175f565b500390565b6000826117c857634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156117e0576117e061175f565b500190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561180d57600080fd5b5051919050565b6040808252810184905260008560608301825b8781101561185757823561183a816115c5565b6001600160a01b0316825260209283019290910190600101611827565b5083810360208501528481526001600160fb1b0385111561187757600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b6000602082840312156118aa57600080fd5b815160ff8116811461145457600080fd5b600181815b808511156118f65781600019048211156118dc576118dc61175f565b808516156118e957918102915b93841c93908002906118c0565b509250929050565b60008261190d57506001610e76565b8161191a57506000610e76565b8160018114611930576002811461193a57611956565b6001915050610e76565b60ff84111561194b5761194b61175f565b50506001821b610e76565b5060208310610133831016604e8410600b8410161715611979575081810a610e76565b61198383836118bb565b80600019048211156119975761199761175f565b029392505050565b600061145483836118fe565b634e487b7160e01b600052602160045260246000fd5b8381526020810183905260608101600483106119ed57634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b600060208284031215611a0d57600080fd5b815161145481611691565b60005b83811015611a33578181015183820152602001611a1b565b838111156113655750506000910152565b60008251611a56818460208701611a18565b9190910192915050565b6020815260008251806020840152611a7f816040850160208701611a18565b601f01601f1916919091016040019291505056fea164736f6c634300080f000a0000000000000000000000005e865b76cdc0fd429938eb4a36097addbe0970a8000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000037c997b35c619c21323f3518b9357914e8b99525
Deployed Bytecode
0x6080604052600436106101095760003560e01c8063097aad101461012c5780631959a0021461015f5780632e17de78146101b657806339c3b99c146101d8578063442da82f146102195780634e71d92d1461022f5780635aa6e675146102445780635be9aa84146102645780637589cf2f1461027a5780638223c60c1461028f57806397e50818146102a5578063a0040736146102c5578063a218141b146102e5578063a9f8d181146102fb578063ab033ea914610310578063adc9772e14610330578063be7ebe7714610350578063c2ee3a0814610366578063cb4aec6114610382578063f5d9e4b214610398578063f7c618c1146103b8578063f8cf31cb146103d857600080fd5b3661012757604051630dccd20d60e21b815260040160405180910390fd5b600080fd5b34801561013857600080fd5b5061014c6101473660046115da565b6103f8565b6040519081526020015b60405180910390f35b34801561016b57600080fd5b5061019b61017a3660046115da565b60086020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610156565b3480156101c257600080fd5b506101d66101d13660046115f7565b61051d565b005b3480156101e457600080fd5b5061020c7f00000000000000000000000037c997b35c619c21323f3518b9357914e8b9952581565b6040516101569190611610565b34801561022557600080fd5b5061014c60065481565b34801561023b57600080fd5b506101d6610568565b34801561025057600080fd5b5060015461020c906001600160a01b031681565b34801561027057600080fd5b5061014c60045481565b34801561028657600080fd5b506101d6610589565b34801561029b57600080fd5b5061014c60025481565b3480156102b157600080fd5b506101d66102c0366004611624565b6105d9565b3480156102d157600080fd5b506101d66102e036600461169f565b610703565b3480156102f157600080fd5b5061014c60035481565b34801561030757600080fd5b5061014c610a5a565b34801561031c57600080fd5b506101d661032b3660046115da565b610a69565b34801561033c57600080fd5b506101d661034b366004611733565b610b17565b34801561035c57600080fd5b5061014c60075481565b34801561037257600080fd5b5061014c670de0b6b3a764000081565b34801561038e57600080fd5b5061014c60055481565b3480156103a457600080fd5b506101d66103b33660046115f7565b610c45565b3480156103c457600080fd5b5060005461020c906001600160a01b031681565b3480156103e457600080fd5b506101d66103f33660046115da565b610ccb565b60008060045460001461046c57600454670de0b6b3a764000060055461041e9190611775565b600354610429610dbb565b6104339190611794565b61043d9190611775565b61044791906117ab565b60025461045491906117cd565b9050806000036104675750600092915050565b610475565b50600092915050565b6001600160a01b038316600090815260086020526040902060028101546007549154909111156104a3575060005b6001600160a01b0384166000908152600860205260408120600101548290670de0b6b3a7640000906104d6908690611775565b6104e091906117ab565b6104ea9190611794565b600054909150610502906001600160a01b0316610dd2565b6001146105155761051281610e56565b90505b949350505050565b3360009081526008602052604090206001015481118061053b575080155b15610559576040516341a0765d60e11b815260040160405180910390fd5b61056533826001610e7c565b50565b3360008181526008602052604090206001015461058791906002610e7c565b565b33600090815260086020526040902060010154156105c0573360008181526008602052604090206001015461058791906003610e7c565b604051632cdf478160e11b815260040160405180910390fd5b6001546001600160a01b031633146106045760405163f2be30fb60e01b815260040160405180910390fd5b806000036106255760405163af458c0760e01b815260040160405180910390fd5b61062d6111af565b600654431061066957816000036106575760405163af458c0760e01b815260040160405180910390fd5b61066181836117ab565b60055561069d565b806005544360065461067b9190611794565b6106859190611775565b61068f90846117cd565b61069991906117ab565b6005555b4360038190556106ae9082906117cd565b6006819055600554604080518481526020810192909252810184905260608101919091527fde9c32a09b9b33b8ec313cd054ee758c1d6eaaaa43a5269496d63ec17001e91b9060800160405180910390a15050565b6001546001600160a01b0316331461072e5760405163f2be30fb60e01b815260040160405180910390fd5b6001600160a01b0386166107555760405163d92e233d60e01b815260040160405180910390fd5b8382146107755760405163aaad13f760e01b815260040160405180910390fd5b60008060005b8681101561090a57878782818110610795576107956117e5565b90506020020160208101906107aa91906115da565b92508585828181106107be576107be6117e5565b9050602002013591507f00000000000000000000000037c997b35c619c21323f3518b9357914e8b995256001600160a01b0316836001600160a01b031603610819576040516331365d2560e21b815260040160405180910390fd5b6001600160a01b0383166108405760405163d92e233d60e01b815260040160405180910390fd5b816000036108615760405163af458c0760e01b815260040160405180910390fd5b6040516370a0823160e01b81526001600160a01b038416906370a082319061088d903090600401611610565b602060405180830381865afa1580156108aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ce91906117fb565b8211156108ee5760405163356680b760e01b815260040160405180910390fd5b6109026001600160a01b0384168a8461122d565b60010161077b565b508215610a0957600480546040516370a0823160e01b81526000926001600160a01b037f00000000000000000000000037c997b35c619c21323f3518b9357914e8b9952516916370a082319161096291309101611610565b602060405180830381865afa15801561097f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a391906117fb565b6109ad9190611794565b905080156109ee576109e96001600160a01b037f00000000000000000000000037c997b35c619c21323f3518b9357914e8b99525168a8361122d565b610a07565b60405163cf2b32b560e01b815260040160405180910390fd5b505b876001600160a01b03167fd128d90658babd0cd73afa715caba1d52211c7d041a65228501bd8fe9d9e81c388888888604051610a489493929190611814565b60405180910390a25050505050505050565b6000610a64610dbb565b905090565b6001546001600160a01b03163314610a945760405163f2be30fb60e01b815260040160405180910390fd5b6001600160a01b038116610abb5760405163d92e233d60e01b815260040160405180910390fd5b6001546040516001600160a01b038084169216907f3aaaebeb4821d6a7e5c77ece53cff0afcc56c82add2c978dbbb7f73e84cbcfd290600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b80600003610b385760405163af458c0760e01b815260040160405180910390fd5b6001600160a01b038216610b5f5760405163d92e233d60e01b815260040160405180910390fd5b600554600003610b8257604051630e6a65f960e31b815260040160405180910390fd5b6006544310610ba4576040516302b113d760e31b815260040160405180910390fd5b6000546040516370a0823160e01b81526001600160a01b03909116906370a0823190610bd4903090600401611610565b602060405180830381865afa158015610bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1591906117fb565b600003610c355760405163356680b760e01b815260040160405180910390fd5b610c4182826000610e7c565b5050565b6001546001600160a01b03163314610c705760405163f2be30fb60e01b815260040160405180910390fd5b610c786111af565b436003819055610c899082906117cd565b60068190556040805183815260208101929092527fa8c9ab0c946981b63aaa38b74a8808bdc24c3e4814ec19bc1d77b83cf98de13d910160405180910390a150565b6001546001600160a01b03163314610cf65760405163f2be30fb60e01b815260040160405180910390fd5b6000546001600160a01b0390811690821603610d2557604051631a07168f60e01b815260040160405180910390fd5b6001600160a01b038116610d4c5760405163d92e233d60e01b815260040160405180910390fd5b6000600255610d59610dbb565b60035542600755600080546040516001600160a01b03808516939216917fab27a2419bd7a3bc605bff66b38aacb84061d9e20edab7f7680ce52e6fcd925691a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006006544310610dcd575060065490565b504390565b600080826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e379190611898565b60ff1690506000610e49826012611794565b905061051581600a61199f565b60008054610e6c906001600160a01b0316610dd2565b610e7690836117ab565b92915050565b610e846111af565b610e8d83611295565b6001600160a01b038316600090815260086020526040812090826003811115610eb857610eb86119ab565b60031461101457600182015415610fe257610ed2856112dd565b600054909150610eea906001600160a01b0316610dd2565b600114610efd57610efa81610e56565b90505b8015610fb0576000546040516370a0823160e01b81526001600160a01b03909116906370a0823190610f33903090600401611610565b602060405180830381865afa158015610f50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7491906117fb565b811115610f945760405163356680b760e01b815260040160405180910390fd5b600054610fab906001600160a01b0316868361122d565b611014565b826003811115610fc257610fc26119ab565b600203610fab57604051632e0f8c4960e01b815260040160405180910390fd5b826003811115610ff457610ff46119ab565b60020361101457604051632e0f8c4960e01b815260040160405180910390fd5b826003811115611026576110266119ab565b60000361109a576110626001600160a01b037f00000000000000000000000037c997b35c619c21323f3518b9357914e8b995251633308761132d565b8382600101600082825461107691906117cd565b92505081905550836004600082825461108f91906117cd565b909155506111379050565b8260038111156110ac576110ac6119ab565b600114806110cb57508260038111156110c7576110c76119ab565b6003145b1561113757838260010160008282546110e49190611794565b9250508190555083600460008282546110fd9190611794565b9091555061113790506001600160a01b037f00000000000000000000000037c997b35c619c21323f3518b9357914e8b9952516868661122d565b670de0b6b3a764000060025483600101546111529190611775565b61115c91906117ab565b60028301556040516001600160a01b038616907f28cbddf77ad6b07493e2020cd23c869986ccd78295364fb3f9ea4aa268f31e16906111a0908790859088906119c1565b60405180910390a25050505050565b6004546000036111bf5743600355565b600454670de0b6b3a76400006005546111d89190611775565b6003546111e3610dbb565b6111ed9190611794565b6111f79190611775565b61120191906117ab565b6002600082825461121291906117cd565b9091555050600354431461058757611228610dbb565b600355565b6040516001600160a01b03831660248201526044810182905261129090849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261136b565b505050565b6007546001600160a01b0382166000908152600860205260409020541015610565576001600160a01b0316600090815260086020526040812060028101919091556007549055565b6001600160a01b038116600090815260086020526040812060028082015490546001909201549091670de0b6b3a7640000916113199190611775565b61132391906117ab565b610e769190611794565b6040516001600160a01b03808516602483015283166044820152606481018290526113659085906323b872dd60e01b90608401611259565b50505050565b60006113c0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114429092919063ffffffff16565b80519091501561129057808060200190518101906113de91906119fb565b6112905760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084015b60405180910390fd5b6060611451848460008561145b565b90505b9392505050565b6060824710156114bc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611439565b6001600160a01b0385163b6115135760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611439565b600080866001600160a01b0316858760405161152f9190611a44565b60006040518083038185875af1925050503d806000811461156c576040519150601f19603f3d011682016040523d82523d6000602084013e611571565b606091505b509150915061158182828661158c565b979650505050505050565b6060831561159b575081611454565b8251156115ab5782518084602001fd5b8160405162461bcd60e51b81526004016114399190611a60565b6001600160a01b038116811461056557600080fd5b6000602082840312156115ec57600080fd5b8135611454816115c5565b60006020828403121561160957600080fd5b5035919050565b6001600160a01b0391909116815260200190565b6000806040838503121561163757600080fd5b50508035926020909101359150565b60008083601f84011261165857600080fd5b5081356001600160401b0381111561166f57600080fd5b6020830191508360208260051b850101111561168a57600080fd5b9250929050565b801515811461056557600080fd5b600080600080600080608087890312156116b857600080fd5b86356116c3816115c5565b955060208701356001600160401b03808211156116df57600080fd5b6116eb8a838b01611646565b9097509550604089013591508082111561170457600080fd5b5061171189828a01611646565b909450925050606087013561172581611691565b809150509295509295509295565b6000806040838503121561174657600080fd5b8235611751816115c5565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561178f5761178f61175f565b500290565b6000828210156117a6576117a661175f565b500390565b6000826117c857634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156117e0576117e061175f565b500190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561180d57600080fd5b5051919050565b6040808252810184905260008560608301825b8781101561185757823561183a816115c5565b6001600160a01b0316825260209283019290910190600101611827565b5083810360208501528481526001600160fb1b0385111561187757600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b6000602082840312156118aa57600080fd5b815160ff8116811461145457600080fd5b600181815b808511156118f65781600019048211156118dc576118dc61175f565b808516156118e957918102915b93841c93908002906118c0565b509250929050565b60008261190d57506001610e76565b8161191a57506000610e76565b8160018114611930576002811461193a57611956565b6001915050610e76565b60ff84111561194b5761194b61175f565b50506001821b610e76565b5060208310610133831016604e8410600b8410161715611979575081810a610e76565b61198383836118bb565b80600019048211156119975761199761175f565b029392505050565b600061145483836118fe565b634e487b7160e01b600052602160045260246000fd5b8381526020810183905260608101600483106119ed57634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b600060208284031215611a0d57600080fd5b815161145481611691565b60005b83811015611a33578181015183820152602001611a1b565b838111156113655750506000910152565b60008251611a56818460208701611a18565b9190910192915050565b6020815260008251806020840152611a7f816040850160208701611a18565b601f01601f1916919091016040019291505056fea164736f6c634300080f000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005e865b76cdc0fd429938eb4a36097addbe0970a8000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000037c997b35c619c21323f3518b9357914e8b99525
-----Decoded View---------------
Arg [0] : _governance (address): 0x5E865b76CdC0fD429938eb4a36097aDDBe0970a8
Arg [1] : _rewardToken (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : _pilotToken (address): 0x37C997B35C619C21323F3518B9357914E8B99525
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000005e865b76cdc0fd429938eb4a36097addbe0970a8
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 00000000000000000000000037c997b35c619c21323f3518b9357914e8b99525
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $2,374.21 | 2.5682 | $6,097.35 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.