Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
StakingData
Compiler Version
v0.5.16+commit.9c3226ce
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; // Inheritance import "./StakingThales.sol"; import "./EscrowThales.sol"; import "../utils/proxy/ProxyOwned.sol"; import "../utils/proxy/ProxyPausable.sol"; import "@openzeppelin/upgrades-core/contracts/Initializable.sol"; contract StakingData is Initializable, ProxyOwned, ProxyPausable { struct StakingData { bool paused; uint periodsOfStaking; uint lastPeriodTimeStamp; uint durationPeriod; uint unstakeDurationPeriod; uint baseRewardsPool; uint bonusRewardsPool; uint totalStakedAmount; bool canClosePeriod; bool mergeAccountEnabled; uint totalEscrowBalanceNotIncludedInStaking; uint totalEscrowedRewards; } struct UserStakingData { uint thalesStaked; bool unstaking; uint lastUnstakeTime; uint unstakingAmount; address delegatedVolume; uint rewards; uint baseRewards; uint totalBonus; uint lastPeriodOfClaimedRewards; uint escrowedBalance; uint claimable; } struct UserVestingData { uint numberOfPeriods; uint currentVestingPeriod; uint lastPeriodTimeStamp; uint claimable; EscrowThales.VestingEntry[] vestingEntries; } address public stakingThales; address public escrowThales; function initialize(address _owner) external initializer { setOwner(_owner); } /// @notice getStakingData returns Thales staking data /// @return StakingData function getStakingData() external view returns (StakingData memory) { StakingThales staking = StakingThales(stakingThales); EscrowThales escrow = EscrowThales(escrowThales); return StakingData( staking.paused(), staking.periodsOfStaking(), staking.lastPeriodTimeStamp(), staking.durationPeriod(), staking.unstakeDurationPeriod(), staking.fixedPeriodReward(), staking.periodExtraReward(), staking.totalStakedAmount(), staking.canClosePeriod(), staking.mergeAccountEnabled(), escrow.totalEscrowBalanceNotIncludedInStaking(), escrow.totalEscrowedRewards() ); } /// @notice getUserStakingData returns user Thales staking data /// @param user address of the user /// @return UserStakingData function getUserStakingData(address user) external view returns (UserStakingData memory) { StakingThales staking = StakingThales(stakingThales); EscrowThales escrow = EscrowThales(escrowThales); return UserStakingData( staking.stakedBalanceOf(user), staking.unstaking(user), staking.lastUnstakeTime(user), staking.unstakingAmount(user), staking.delegatedVolume(user), staking.getRewardsAvailable(user), staking.getBaseReward(user), staking.getTotalBonus(user), staking.getLastPeriodOfClaimedRewards(user), escrow.totalAccountEscrowedAmount(user), escrow.claimable(user) ); } /// @notice getUserVestingData returns user Thales vesting data /// @param user address of the user /// @return UserVestingData function getUserVestingData(address user) external view returns (UserVestingData memory) { StakingThales staking = StakingThales(stakingThales); EscrowThales escrow = EscrowThales(escrowThales); uint numberOfPeriods = escrow.NUM_PERIODS(); EscrowThales.VestingEntry[] memory vestingEntries = new EscrowThales.VestingEntry[](numberOfPeriods); for (uint i = 0; i < numberOfPeriods; i++) { (uint amount, uint vesting_period) = escrow.vestingEntries(user, i); vestingEntries[i].amount = amount; vestingEntries[i].vesting_period = vesting_period; } return UserVestingData( escrow.NUM_PERIODS(), escrow.currentVestingPeriod(), staking.lastPeriodTimeStamp(), escrow.claimable(user), vestingEntries ); } function setStakingThales(address _stakingThales) external onlyOwner { stakingThales = _stakingThales; emit StakingThalesChnaged(_stakingThales); } function setEscrowThales(address _escrowThales) external onlyOwner { escrowThales = _escrowThales; emit EscrowThalesChnaged(_escrowThales); } event StakingThalesChnaged(address _stakingThales); event EscrowThalesChnaged(address _escrowThales); }
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/SafeERC20.sol"; import "openzeppelin-solidity-2.3.0/contracts/math/SafeMath.sol"; import "../utils/proxy/ProxyReentrancyGuard.sol"; import "../utils/proxy/ProxyOwned.sol"; import "../utils/proxy/ProxyPausable.sol"; import "@openzeppelin/upgrades-core/contracts/Initializable.sol"; import "../interfaces/IEscrowThales.sol"; import "../interfaces/IStakingThales.sol"; import "../interfaces/ISNXRewards.sol"; import "../interfaces/IThalesRoyale.sol"; import "../interfaces/IPriceFeed.sol"; import "../interfaces/IThalesStakingRewardsPool.sol"; import "../interfaces/IAddressResolver.sol"; import "../interfaces/ISportsAMMLiquidityPool.sol"; import "../interfaces/IThalesAMMLiquidityPool.sol"; import "../interfaces/IParlayAMMLiquidityPool.sol"; import "../interfaces/IThalesAMM.sol"; import "../interfaces/IPositionalMarketManager.sol"; import "../interfaces/IStakingThalesBonusRewardsManager.sol"; import "../interfaces/ICCIPCollector.sol"; /// @title A Staking contract that provides logic for staking and claiming rewards contract StakingThales is IStakingThales, Initializable, ProxyOwned, ProxyReentrancyGuard, ProxyPausable { /* ========== LIBRARIES ========== */ using SafeMath for uint; using SafeERC20 for IERC20; /* ========== STATE VARIABLES ========== */ IEscrowThales public iEscrowThales; IERC20 public stakingToken; IERC20 public feeToken; ISNXRewards private SNXRewards; IThalesRoyale private thalesRoyale; IPriceFeed public priceFeed; uint public periodsOfStaking; uint public lastPeriodTimeStamp; uint public durationPeriod; uint public unstakeDurationPeriod; uint public startTimeStamp; uint public currentPeriodRewards; uint public currentPeriodFees; bool public distributeFeesEnabled; uint public fixedPeriodReward; uint public periodExtraReward; uint private totalSNXRewardsInPeriod; uint private totalSNXFeesInPeriod; bool public claimEnabled; mapping(address => uint) public stakerLifetimeRewardsClaimed; mapping(address => uint) public stakerFeesClaimed; uint private _totalStakedAmount; uint private _totalEscrowedAmount; uint private _totalPendingStakeAmount; uint private _totalUnclaimedRewards; uint private _totalRewardsClaimed; uint private _totalRewardFeesClaimed; mapping(address => uint) public lastUnstakeTime; mapping(address => bool) public unstaking; mapping(address => uint) public unstakingAmount; mapping(address => uint) private _stakedBalances; mapping(address => uint) private _lastRewardsClaimedPeriod; address public thalesAMM; uint constant HUNDRED = 1e18; uint constant AMM_EXTRA_REWARD_PERIODS = 4; struct AMMVolumeEntry { uint amount; uint period; } mapping(address => uint) private lastAMMUpdatePeriod; mapping(address => AMMVolumeEntry[AMM_EXTRA_REWARD_PERIODS]) private stakerAMMVolume; bool public extraRewardsActive; IThalesStakingRewardsPool public ThalesStakingRewardsPool; uint private maxSNXRewardsPercentage; uint private maxAMMVolumeRewardsPercentage; uint private AMMVolumeRewardsMultiplier; uint private maxThalesRoyaleRewardsPercentage; uint constant ONE = 1e18; uint constant ONE_PERCENT = 1e16; uint private SNXVolumeRewardsMultiplier; mapping(address => uint) private _lastStakingPeriod; uint public totalStakedLastPeriodEnd; uint public totalEscrowedLastPeriodEnd; address private exoticBonds; IAddressResolver private addressResolver; address public thalesRangedAMM; address public sportsAMM; mapping(address => uint) private lastThalesAMMUpdatePeriod; mapping(address => AMMVolumeEntry[AMM_EXTRA_REWARD_PERIODS]) private thalesAMMVolume; mapping(address => uint) private lastThalesRangedAMMUpdatePeriod; mapping(address => AMMVolumeEntry[AMM_EXTRA_REWARD_PERIODS]) private thalesRangedAMMVolume; mapping(address => uint) private lastExoticMarketsUpdatePeriod; mapping(address => AMMVolumeEntry[AMM_EXTRA_REWARD_PERIODS]) private exoticMarketsVolume; mapping(address => uint) private lastSportsAMMUpdatePeriod; mapping(address => AMMVolumeEntry[AMM_EXTRA_REWARD_PERIODS]) private sportsAMMVolume; mapping(address => mapping(address => bool)) public canClaimOnBehalf; bool public mergeAccountEnabled; mapping(address => address) public delegatedVolume; mapping(address => bool) public supportedSportVault; mapping(address => bool) public supportedAMMVault; ISportsAMMLiquidityPool private sportsAMMLiquidityPool; IThalesAMMLiquidityPool private thalesAMMLiquidityPool; IStakingThalesBonusRewardsManager public stakingThalesBonusRewardsManager; IParlayAMMLiquidityPool private parlayAMMLiquidityPool; bool public readOnlyMode; bool public closingPeriodInProgress; uint public closingPeriodPauseTime; bool sendCCIPMessage; /* ========== CONSTRUCTOR ========== */ function initialize( address _owner, address _iEscrowThales, //THALES address _stakingToken, //THALES address _feeToken, //sUSD uint _durationPeriod, uint _unstakeDurationPeriod, address _ISNXRewards ) public initializer { setOwner(_owner); initNonReentrant(); iEscrowThales = IEscrowThales(_iEscrowThales); stakingToken = IERC20(_stakingToken); feeToken = IERC20(_feeToken); stakingToken.approve(_iEscrowThales, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); durationPeriod = _durationPeriod; unstakeDurationPeriod = _unstakeDurationPeriod; fixedPeriodReward = 70000 * 1e18; periodExtraReward = 21000 * 1e18; SNXRewards = ISNXRewards(_ISNXRewards); } /* ========== VIEWS ========== */ /// @notice Get the total staked amount on the contract /// @return total staked amount function totalStakedAmount() external view returns (uint) { return _totalStakedAmount; } /// @notice Get the staked balance for the account /// @param account to get the staked balance for /// @return the staked balance for the account function stakedBalanceOf(address account) external view returns (uint) { return _stakedBalances[account]; } /// @notice Get the last period of claimed rewards for the account /// @param account to get the last period of claimed rewards for /// @return the last period of claimed rewards for the account function getLastPeriodOfClaimedRewards(address account) external view returns (uint) { return _lastRewardsClaimedPeriod[account]; } /// @notice Get the rewards available for the claim for the account /// @param account to get the rewards available for the claim for /// @return the rewards available for the claim for the account function getRewardsAvailable(address account) external view returns (uint) { return _calculateAvailableRewardsToClaim(account); } /// @notice Get the reward fees available for the claim for the account /// @param account to get the reward fees available for the claim for /// @return the rewards fees available for the claim for the account function getRewardFeesAvailable(address account) external view returns (uint) { return _calculateAvailableFeesToClaim(account); } /// @notice Get the total rewards claimed for the account until now /// @param account to get the total rewards claimed for /// @return the total rewards claimed for the account until now function getAlreadyClaimedRewards(address account) external view returns (uint) { return stakerLifetimeRewardsClaimed[account]; } /// @notice Get the rewards funds available on the rewards pool /// @return the rewards funds available on the rewards pool function getContractRewardFunds() external view returns (uint) { return stakingToken.balanceOf(address(ThalesStakingRewardsPool)); } /// @notice Get the fee funds available on the staking contract /// @return the fee funds available on the staking contract function getContractFeeFunds() external view returns (uint) { return feeToken.balanceOf(address(this)); } /// @notice Set staking parametars /// @param _claimEnabled enable/disable claim rewards /// @param _distributeFeesEnabled enable/disable fees distribution /// @param _durationPeriod duration of the staking period /// @param _unstakeDurationPeriod duration of the unstaking cooldown period /// @param _mergeAccountEnabled enable/disable account merging /// @param _readOnlyMode enable/disable readonlymode /// @param _sendCCIPMessage enable/disable sending CCIP message function setStakingParameters( bool _claimEnabled, bool _distributeFeesEnabled, uint _durationPeriod, uint _unstakeDurationPeriod, bool _mergeAccountEnabled, bool _readOnlyMode, bool _sendCCIPMessage ) external onlyOwner { claimEnabled = _claimEnabled; distributeFeesEnabled = _distributeFeesEnabled; durationPeriod = _durationPeriod; unstakeDurationPeriod = _unstakeDurationPeriod; mergeAccountEnabled = _mergeAccountEnabled; readOnlyMode = _readOnlyMode; sendCCIPMessage = _sendCCIPMessage; emit StakingParametersChanged( _claimEnabled, _distributeFeesEnabled, _durationPeriod, _unstakeDurationPeriod, _mergeAccountEnabled, _readOnlyMode, _sendCCIPMessage ); } /// @notice Set staking rewards parameters /// @param _fixedReward amount for weekly base rewards pool /// @param _extraReward amount for weekly bonus rewards pool /// @param _extraRewardsActive enable/disable bonus rewards function setStakingRewardsParameters( uint _fixedReward, uint _extraReward, bool _extraRewardsActive ) external onlyOwner { fixedPeriodReward = _fixedReward; periodExtraReward = _extraReward; extraRewardsActive = _extraRewardsActive; emit StakingRewardsParametersChanged(_fixedReward, _extraReward, _extraRewardsActive); } /// @notice Set contract addresses /// @param _thalesAMM address of Thales AMM contract /// @param _thalesRangedAMM address of Thales ranged AMM contract /// @param _sportsAMM address of sport markets AMM contract /// @param _priceFeed address of price feed contract /// @param _thalesStakingRewardsPool address of Thales staking rewards pool /// @param _addressResolver address of address resolver contract /// @param _stakingThalesBonusRewardsManager manager for TIP-135 gamification systme function setAddresses( address _thalesAMM, address _thalesRangedAMM, address _sportsAMM, address _priceFeed, address _thalesStakingRewardsPool, address _addressResolver, address _stakingThalesBonusRewardsManager ) external onlyOwner { thalesAMM = _thalesAMM; thalesRangedAMM = _thalesRangedAMM; sportsAMM = _sportsAMM; priceFeed = IPriceFeed(_priceFeed); ThalesStakingRewardsPool = IThalesStakingRewardsPool(_thalesStakingRewardsPool); addressResolver = IAddressResolver(_addressResolver); stakingThalesBonusRewardsManager = IStakingThalesBonusRewardsManager(_stakingThalesBonusRewardsManager); emit AddressesChanged( _thalesAMM, _thalesRangedAMM, _sportsAMM, _priceFeed, _thalesStakingRewardsPool, _addressResolver, _stakingThalesBonusRewardsManager ); } /// @notice Set address of Escrow Thales contract /// @param _escrowThalesContract address of Escrow Thales contract function setEscrow(address _escrowThalesContract) external onlyOwner { if (address(iEscrowThales) != address(0)) { stakingToken.approve(address(iEscrowThales), 0); } iEscrowThales = IEscrowThales(_escrowThalesContract); stakingToken.approve(_escrowThalesContract, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); emit EscrowChanged(_escrowThalesContract); } /// @notice add a sport vault address to count towards gamified staking volume /// @param _sportVault address to set /// @param value to set function setSupportedSportVault(address _sportVault, bool value) external onlyOwner { supportedSportVault[_sportVault] = value; emit SupportedSportVaultSet(_sportVault, value); } /// @notice add a amm vault address to count towards gamified staking volume /// @param _ammVault address to set /// @param value to set function setSupportedAMMVault(address _ammVault, bool value) external onlyOwner { supportedAMMVault[_ammVault] = value; emit SupportedAMMVaultSet(_ammVault, value); } /// @notice Set last period timestamp /// @param _lastPeriodTimestamp last period timestamp to be set function setLastPeriodTimestamp(uint _lastPeriodTimestamp) external onlyOwner { require(_lastPeriodTimestamp > (lastPeriodTimeStamp - 5 hours), "Too far back"); lastPeriodTimeStamp = _lastPeriodTimestamp; emit LastPeriodTimestampSet(_lastPeriodTimestamp); } /// @notice Get the base reward amount available for the claim for the account /// @param account to get the base reward amount available for the claim for /// @return the base reward amount available for the claim for the account function getBaseReward(address account) public view returns (uint _baseRewards) { if ( !((_lastStakingPeriod[account] == periodsOfStaking) || (_stakedBalances[account] == 0) || (_lastRewardsClaimedPeriod[account] == periodsOfStaking) || (totalStakedLastPeriodEnd == 0)) ) { _baseRewards = _stakedBalances[account] .add(iEscrowThales.getStakedEscrowedBalanceForRewards(account)) .mul(currentPeriodRewards) .div(totalStakedLastPeriodEnd.add(totalEscrowedLastPeriodEnd)); } } /// @notice [DEPRECATED maintained because of IStakingThales] Get the total protocol volume for the account /// @param account to get the total protocol volume for /// @return the total protocol volume for the account function getAMMVolume(address account) external view returns (uint) { return 0; } /// @notice Get the total bonus rewards for the account /// @param account to get the total bonus rewards for /// @return the total bonus rewards for the account function getTotalBonus(address account) public view returns (uint returnValue) { if ( (address(stakingThalesBonusRewardsManager) != address(0)) && stakingThalesBonusRewardsManager.useNewBonusModel() ) { returnValue = periodExtraReward .mul(stakingThalesBonusRewardsManager.getUserRoundBonusShare(account, periodsOfStaking - 1)) .div(ONE); } } /// @notice Get the flag that indicates whether the current period can be closed /// @return the flag that indicates whether the current period can be closed function canClosePeriod() external view returns (bool) { return (startTimeStamp > 0 && (block.timestamp >= lastPeriodTimeStamp.add(durationPeriod))); } /* ========== PUBLIC ========== */ /// @notice Start the first staking period function startStakingPeriod() external onlyOwner { require(startTimeStamp == 0, "Staking has already started"); startTimeStamp = block.timestamp; periodsOfStaking = 0; lastPeriodTimeStamp = startTimeStamp; _totalRewardsClaimed = 0; _totalRewardFeesClaimed = 0; _totalStakedAmount = 0; _totalEscrowedAmount = 0; _totalPendingStakeAmount = 0; emit StakingPeriodStarted(); } /// @notice Close the current staking period function closePeriod() external nonReentrant notPaused { require(startTimeStamp > 0, "Staking period has not started"); require( block.timestamp >= lastPeriodTimeStamp.add(durationPeriod), "A full period has not passed since the last closed period" ); require(!closingPeriodInProgress, "ClosingInProgress"); iEscrowThales.updateCurrentPeriod(); lastPeriodTimeStamp = block.timestamp; periodsOfStaking = iEscrowThales.currentVestingPeriod(); totalEscrowedLastPeriodEnd = iEscrowThales.totalEscrowedRewards().sub( iEscrowThales.totalEscrowBalanceNotIncludedInStaking() ); currentPeriodRewards = fixedPeriodReward; currentPeriodFees = feeToken.balanceOf(address(this)); totalStakedLastPeriodEnd = _totalStakedAmount; if (sendCCIPMessage) { _sendRoundClosingMessageCrosschain(); } emit ClosedPeriod(periodsOfStaking, lastPeriodTimeStamp); } /// @notice if CCIP is configured, this method will send the staking data to relevant chains function sendRoundClosingMessageCrosschain() external onlyOwner { _sendRoundClosingMessageCrosschain(); } function _sendRoundClosingMessageCrosschain() internal { if (addressResolver.checkIfContractExists("CrossChainCollector")) { if (!readOnlyMode) { paused = true; closingPeriodInProgress = true; lastPauseTime = block.timestamp; closingPeriodPauseTime = block.timestamp; } ICCIPCollector(addressResolver.getAddress("CrossChainCollector")).sendOnClosePeriod( totalStakedLastPeriodEnd, totalEscrowedLastPeriodEnd, stakingThalesBonusRewardsManager.totalRoundBonusPoints(periodsOfStaking - 1), _reverseTransformCollateral(feeToken.balanceOf(address(this))) ); } } /// @notice Updating the staking rewards parameters after closed period with the calculated values via CCIP /// @param _currentPeriodRewards the calculated base rewards to be distributed for the current period on the particular chain /// @param _extraRewards the calculated extra rewards to be distributed for the current period on the particular chain /// @param _revShare the calculated revenue share to be distributed for the current period on the particular chain function updateStakingRewards( uint _currentPeriodRewards, uint _extraRewards, uint _revShare ) external nonReentrant { if (!readOnlyMode) { // if it is readOnlyMode==true discard all following the updates require(msg.sender == addressResolver.getAddress("CrossChainCollector") || msg.sender == owner, "InvCCIP"); require(closingPeriodInProgress, "NotInClosePeriod"); require( _currentPeriodRewards <= fixedPeriodReward && _extraRewards <= fixedPeriodReward && _revShare <= 5 * fixedPeriodReward, "Rejected due to suspicious values" ); bool safeBoxBufferSet = addressResolver.checkIfContractExists("SafeBoxBuffer"); bool insufficientFundsInBuffer; uint currentBalance = feeToken.balanceOf(address(this)); currentPeriodFees = _transformCollateral(_revShare); if (safeBoxBufferSet) { address safeBoxBuffer = addressResolver.getAddress("SafeBoxBuffer"); if (currentPeriodFees > currentBalance) { if (feeToken.balanceOf(safeBoxBuffer) < (currentPeriodFees - currentBalance)) { insufficientFundsInBuffer = true; } else { ICCIPCollector(safeBoxBuffer).pullExtraFunds(currentPeriodFees - currentBalance); } } else if (currentPeriodFees > 0 && currentPeriodFees < currentBalance) { feeToken.transfer(safeBoxBuffer, currentBalance - currentPeriodFees); } } currentPeriodRewards = _currentPeriodRewards; periodExtraReward = _extraRewards; closingPeriodInProgress = false; if (closingPeriodPauseTime == lastPauseTime) { paused = !safeBoxBufferSet || insufficientFundsInBuffer; } } emit ReceivedStakingRewardsUpdate(_currentPeriodRewards, _extraRewards, _transformCollateral(_revShare)); } /// @notice Stake the amount of staking token to get weekly rewards /// @param amount to stake function stake(uint amount) external nonReentrant notPaused { _stake(amount, msg.sender, msg.sender); emit Staked(msg.sender, amount); } /// @notice Start unstaking cooldown for the amount of staking token /// @param amount to unstake function startUnstake(uint amount) external notPaused { require(amount > 0, "Cannot unstake 0"); require(_stakedBalances[msg.sender] >= amount, "Account doesnt have that much staked"); require(!unstaking[msg.sender], "Account has already triggered unstake cooldown"); if (_calculateAvailableRewardsToClaim(msg.sender) > 0) { _claimReward(msg.sender); } lastUnstakeTime[msg.sender] = block.timestamp; unstaking[msg.sender] = true; _totalStakedAmount = _totalStakedAmount.sub(amount); unstakingAmount[msg.sender] = amount; _stakedBalances[msg.sender] = _stakedBalances[msg.sender].sub(amount); // on full unstake add his escrowed balance to totalEscrowBalanceNotIncludedInStaking if (_stakedBalances[msg.sender] == 0) { if (iEscrowThales.totalAccountEscrowedAmount(msg.sender) > 0) { iEscrowThales.addTotalEscrowBalanceNotIncludedInStaking( iEscrowThales.totalAccountEscrowedAmount(msg.sender) ); } } emit UnstakeCooldown(msg.sender, lastUnstakeTime[msg.sender].add(unstakeDurationPeriod), amount); } /// @notice Cancel unstaking cooldown function cancelUnstake() external notPaused { require(unstaking[msg.sender], "Account is not unstaking"); // on revert full unstake remove his escrowed balance from totalEscrowBalanceNotIncludedInStaking _subtractTotalEscrowBalanceNotIncludedInStaking(msg.sender); if (_calculateAvailableRewardsToClaim(msg.sender) > 0) { _claimReward(msg.sender); } unstaking[msg.sender] = false; _totalStakedAmount = _totalStakedAmount.add(unstakingAmount[msg.sender]); _stakedBalances[msg.sender] = _stakedBalances[msg.sender].add(unstakingAmount[msg.sender]); unstakingAmount[msg.sender] = 0; emit CancelUnstake(msg.sender); } /// @notice Unstake after the cooldown period expired function unstake() external notPaused { require(unstaking[msg.sender], "Account has not triggered unstake cooldown"); require( lastUnstakeTime[msg.sender] < block.timestamp.sub(unstakeDurationPeriod), "Cannot unstake yet, cooldown not expired." ); unstaking[msg.sender] = false; uint unstakeAmount = unstakingAmount[msg.sender]; stakingToken.safeTransfer(msg.sender, unstakeAmount); unstakingAmount[msg.sender] = 0; emit Unstaked(msg.sender, unstakeAmount); } /// @notice Claim the weekly staking rewards function claimReward() public nonReentrant notPaused { _claimReward(msg.sender); } /// @notice Claim the weekly staking rewards on behalf of the account /// @param account to claim on behalf of function claimRewardOnBehalf(address account) public nonReentrant notPaused { require(account != address(0) && account != msg.sender, "Invalid address"); require(canClaimOnBehalf[account][msg.sender], "Cannot claim on behalf"); _claimReward(account); } /// @notice Update the protocol volume for the account /// @param account to update the protocol volume for /// @param amount to add to the existing protocol volume function updateVolume(address account, uint amount) external { require(account != address(0) && amount > 0, "Invalid params"); if (delegatedVolume[account] != address(0)) { account = delegatedVolume[account]; } require( msg.sender == thalesAMM || msg.sender == thalesRangedAMM || msg.sender == sportsAMM || supportedSportVault[msg.sender] || supportedAMMVault[msg.sender], "Invalid address" ); amount = _reverseTransformCollateral(amount); if (address(stakingThalesBonusRewardsManager) != address(0)) { stakingThalesBonusRewardsManager.storePoints(account, msg.sender, amount, periodsOfStaking); } emit AMMVolumeUpdated(account, amount, msg.sender); } /// @notice Merge account to transfer all staking amounts to another account /// @param destAccount to merge into function mergeAccount(address destAccount) external notPaused { require(mergeAccountEnabled, "Merge account is disabled"); require(destAccount != address(0) && destAccount != msg.sender, "Invalid address"); require( _calculateAvailableRewardsToClaim(msg.sender) == 0 && _calculateAvailableRewardsToClaim(destAccount) == 0, "Cannot merge, claim rewards on both accounts before merging" ); require( !unstaking[msg.sender] && !unstaking[destAccount], "Cannot merge, cancel unstaking on both accounts before merging" ); iEscrowThales.mergeAccount(msg.sender, destAccount); _stakedBalances[destAccount] = _stakedBalances[destAccount].add(_stakedBalances[msg.sender]); stakerLifetimeRewardsClaimed[destAccount] = stakerLifetimeRewardsClaimed[destAccount].add( stakerLifetimeRewardsClaimed[msg.sender] ); stakerFeesClaimed[destAccount] = stakerFeesClaimed[destAccount].add(stakerFeesClaimed[msg.sender]); _lastRewardsClaimedPeriod[destAccount] = periodsOfStaking; _lastStakingPeriod[destAccount] = periodsOfStaking; delete lastUnstakeTime[msg.sender]; delete unstaking[msg.sender]; delete unstakingAmount[msg.sender]; delete _stakedBalances[msg.sender]; delete stakerLifetimeRewardsClaimed[msg.sender]; delete stakerFeesClaimed[msg.sender]; delete _lastRewardsClaimedPeriod[msg.sender]; delete _lastStakingPeriod[msg.sender]; emit AccountMerged(msg.sender, destAccount); } /// @notice Set flag to enable/disable claim on behalf of the msg.sender for the account /// @param account to enable/disable claim on behalf of msg.sender /// @param _canClaimOnBehalf enable/disable claim on behalf of the msg.sender for the account function setCanClaimOnBehalf(address account, bool _canClaimOnBehalf) external notPaused { require(account != address(0) && account != msg.sender, "Invalid address"); canClaimOnBehalf[msg.sender][account] = _canClaimOnBehalf; emit CanClaimOnBehalfChanged(msg.sender, account, _canClaimOnBehalf); } /// @notice delegate your volume to another address /// @param account address to delegate to function delegateVolume(address account) external notPaused { delegatedVolume[msg.sender] = account; emit DelegatedVolume(account); } /* ========== INTERNAL FUNCTIONS ========== */ function _claimReward(address account) internal notPaused { require(claimEnabled, "Claiming is not enabled."); require(startTimeStamp > 0, "Staking period has not started"); //Calculate rewards if (distributeFeesEnabled) { uint availableFeesToClaim = _calculateAvailableFeesToClaim(account); if (availableFeesToClaim > 0) { feeToken.safeTransfer(account, availableFeesToClaim); stakerFeesClaimed[account] = stakerFeesClaimed[account].add(availableFeesToClaim); _totalRewardFeesClaimed = _totalRewardFeesClaimed.add(availableFeesToClaim); emit FeeRewardsClaimed(account, availableFeesToClaim); } } uint availableRewardsToClaim = _calculateAvailableRewardsToClaim(account); if (availableRewardsToClaim > 0) { // Transfer THALES to Escrow contract ThalesStakingRewardsPool.addToEscrow(account, availableRewardsToClaim); // Record the total claimed rewards stakerLifetimeRewardsClaimed[account] = stakerLifetimeRewardsClaimed[account].add(availableRewardsToClaim); _totalRewardsClaimed = _totalRewardsClaimed.add(availableRewardsToClaim); emit RewardsClaimed(account, availableRewardsToClaim, getBaseReward(account)); } // Update last claiming period _lastRewardsClaimedPeriod[account] = periodsOfStaking; } function _stake( uint amount, address staker, address sender ) internal { require(startTimeStamp > 0, "Staking period has not started"); require(amount > 0, "Cannot stake 0"); require(!unstaking[staker], "The staker is paused from staking due to unstaking"); // Check if there are not claimable rewards from last period. // Claim them, and add new stake if (_calculateAvailableRewardsToClaim(staker) > 0) { _claimReward(staker); } _lastStakingPeriod[staker] = periodsOfStaking; // if just started staking subtract his escrowed balance from totalEscrowBalanceNotIncludedInStaking _subtractTotalEscrowBalanceNotIncludedInStaking(staker); _totalStakedAmount = _totalStakedAmount.add(amount); _stakedBalances[staker] = _stakedBalances[staker].add(amount); stakingToken.safeTransferFrom(sender, address(this), amount); } function _subtractTotalEscrowBalanceNotIncludedInStaking(address account) internal { if (_stakedBalances[account] == 0) { if (iEscrowThales.totalAccountEscrowedAmount(account) > 0) { iEscrowThales.subtractTotalEscrowBalanceNotIncludedInStaking( iEscrowThales.totalAccountEscrowedAmount(account) ); } } } function _calculateAvailableRewardsToClaim(address account) internal view returns (uint) { uint baseReward = getBaseReward(account); if (baseReward == 0) { return 0; } if (!extraRewardsActive) { return baseReward; } else { return baseReward.add(getTotalBonus(account)); } } function _calculateAvailableFeesToClaim(address account) internal view returns (uint) { uint baseReward = getBaseReward(account); if (baseReward == 0) { return 0; } return _stakedBalances[account] .add(iEscrowThales.getStakedEscrowedBalanceForRewards(account)) .mul(currentPeriodFees) .div(totalStakedLastPeriodEnd.add(totalEscrowedLastPeriodEnd)); } function _transformCollateral(uint _amount) internal view returns (uint) { return (ICCIPCollector(address(feeToken)).decimals() == 6) ? _amount / 1e12 : _amount; } function _reverseTransformCollateral(uint _amount) internal view returns (uint) { return (ICCIPCollector(address(feeToken)).decimals() == 6) ? _amount * 1e12 : _amount; } /* ========== EVENTS ========== */ event RewardAdded(uint reward); event Staked(address user, uint amount); event StakedOnBehalf(address user, address staker, uint amount); event ClosedPeriod(uint PeriodOfStaking, uint lastPeriodTimeStamp); event RewardsClaimed(address account, uint unclaimedReward, uint baseRewards); event FeeRewardsClaimed(address account, uint unclaimedFees); event UnstakeCooldown(address account, uint cooldownTime, uint amount); event CancelUnstake(address account); event Unstaked(address account, uint unstakeAmount); event StakingParametersChanged( bool claimEnabled, bool distributeFeesEnabled, uint durationPeriod, uint unstakeDurationPeriod, bool mergeAccountEnabled, bool readOnlyMode, bool sendCCIPMessage ); event StakingRewardsParametersChanged(uint fixedPeriodReward, uint periodExtraReward, bool extraRewardsActive); event AddressesChanged( address thalesAMM, address thalesRangedAMM, address sportsAMM, address priceFeed, address ThalesStakingRewardsPool, address addressResolver, address stakingThalesBonusRewardsManager ); event ReceivedStakingRewardsUpdate(uint _currentPeriodRewards, uint _extraRewards, uint _revShare); event EscrowChanged(address newEscrow); event StakingPeriodStarted(); event AMMVolumeUpdated(address account, uint amount, address source); event AccountMerged(address srcAccount, address destAccount); event DelegatedVolume(address destAccount); event CanClaimOnBehalfChanged(address sender, address account, bool canClaimOnBehalf); event SupportedAMMVaultSet(address vault, bool value); event SupportedSportVaultSet(address vault, bool value); event LastPeriodTimestampSet(uint lastPeriodTimestamp); }
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; import "openzeppelin-solidity-2.3.0/contracts/math/SafeMath.sol"; import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/SafeERC20.sol"; import "../utils/proxy/ProxyReentrancyGuard.sol"; import "../utils/proxy/ProxyOwned.sol"; import "../utils/proxy/ProxyPausable.sol"; import "@openzeppelin/upgrades-core/contracts/Initializable.sol"; import "../interfaces/IEscrowThales.sol"; import "../interfaces/IStakingThales.sol"; import "../interfaces/IThalesStakingRewardsPool.sol"; /// @title A Escrow contract that provides logic for escrow and vesting staking rewards contract EscrowThales is IEscrowThales, Initializable, ProxyOwned, ProxyReentrancyGuard, ProxyPausable { using SafeMath for uint; using SafeERC20 for IERC20; IERC20 public vestingToken; IStakingThales public iStakingThales; address public airdropContract; uint public constant NUM_PERIODS = 10; uint public totalEscrowedRewards; uint public totalEscrowBalanceNotIncludedInStaking; uint public currentVestingPeriod; uint private _totalVested; struct VestingEntry { uint amount; uint vesting_period; } mapping(address => VestingEntry[NUM_PERIODS]) public vestingEntries; mapping(address => uint) public totalAccountEscrowedAmount; mapping(address => uint) public lastPeriodAddedReward; bool private testMode; IThalesStakingRewardsPool public ThalesStakingRewardsPool; /* ========== CONSTRUCTOR ========== */ function initialize( address _owner, address _vestingToken //THALES ) public initializer { setOwner(_owner); initNonReentrant(); vestingToken = IERC20(_vestingToken); } /* ========== VIEWS ========== */ /// @notice Get the vesting period of specific vesting entry for the account /// @param account to get the vesting period for /// @param index of vesting entry to get vesting period for /// @return the vesting period function getStakerPeriod(address account, uint index) external view returns (uint) { require(account != address(0), "Invalid account address"); return vestingEntries[account][index].vesting_period; } /// @notice Get the vesting amount of specific vesting entry for the account /// @param account to get the vesting amount for /// @param index of vesting entry to get vesting amount for /// @return the vesting amount for the account function getStakerAmounts(address account, uint index) external view returns (uint) { require(account != address(0), "Invalid account address"); return vestingEntries[account][index].amount; } /// @notice Get the staked escrowed balance for the account /// @param account to get the staked escrowed balance for /// @return the staked escrowed balance for the account function getStakedEscrowedBalanceForRewards(address account) external view returns (uint) { if (lastPeriodAddedReward[account] == currentVestingPeriod) { return totalAccountEscrowedAmount[account].sub( vestingEntries[account][currentVestingPeriod.mod(NUM_PERIODS)].amount ); } else { return totalAccountEscrowedAmount[account]; } } /// @notice Get the claimable vesting amount for the account /// @param account to get the claimable vesting amount for /// @return the claimable vesting amount for the account function claimable(address account) external view returns (uint) { require(account != address(0), "Invalid address"); return totalAccountEscrowedAmount[account].sub(_getVestingNotAvailable(account)); } /* ========== PUBLIC ========== */ /// @notice Add the amount of staking token to the escrow for the account /// @param account to add the amount to the escrow for /// @param amount to add to the escrow function addToEscrow(address account, uint amount) external notPaused { require(account != address(0), "Invalid address"); require(amount > 0, "Amount is 0"); require( msg.sender == address(ThalesStakingRewardsPool) || msg.sender == airdropContract, "Add to escrow can only be called from staking or ongoing airdrop contracts" ); totalAccountEscrowedAmount[account] = totalAccountEscrowedAmount[account].add(amount); if (lastPeriodAddedReward[account] == currentVestingPeriod) { vestingEntries[account][currentVestingPeriod.mod(NUM_PERIODS)].amount = vestingEntries[account][ currentVestingPeriod.mod(NUM_PERIODS) ].amount.add(amount); } else { vestingEntries[account][currentVestingPeriod.mod(NUM_PERIODS)].amount = amount; } vestingEntries[account][currentVestingPeriod.mod(NUM_PERIODS)].vesting_period = currentVestingPeriod.add( NUM_PERIODS ); lastPeriodAddedReward[account] = currentVestingPeriod; totalEscrowedRewards = totalEscrowedRewards.add(amount); //Transfering THALES from StakingThales to EscrowThales vestingToken.safeTransferFrom(msg.sender, address(this), amount); // add to totalEscrowBalanceNotIncludedInStaking if user is not staking if (iStakingThales.stakedBalanceOf(account) == 0) { totalEscrowBalanceNotIncludedInStaking = totalEscrowBalanceNotIncludedInStaking.add(amount); } emit AddedToEscrow(account, amount); } /// @notice Vest the amount of escrowed tokens /// @param amount to vest function vest(uint amount) external nonReentrant notPaused returns (bool) { require(amount > 0, "Claimed amount is 0"); require(currentVestingPeriod >= NUM_PERIODS, "Vesting rewards still not available"); uint vestingAmount = 0; vestingAmount = totalAccountEscrowedAmount[msg.sender].sub(_getVestingNotAvailable(msg.sender)); // Amount must be lower than the reward require(amount <= vestingAmount, "Amount exceeds the claimable rewards"); totalAccountEscrowedAmount[msg.sender] = totalAccountEscrowedAmount[msg.sender].sub(amount); totalEscrowedRewards = totalEscrowedRewards.sub(amount); _totalVested = _totalVested.add(amount); vestingToken.safeTransfer(msg.sender, amount); // subtract from totalEscrowBalanceNotIncludedInStaking if user is not staking if (iStakingThales.stakedBalanceOf(msg.sender) == 0) { totalEscrowBalanceNotIncludedInStaking = totalEscrowBalanceNotIncludedInStaking.sub(amount); } emit Vested(msg.sender, amount); return true; } /// @notice Add the amount of tokens to the total escrow balance not included in staking /// @param amount to add function addTotalEscrowBalanceNotIncludedInStaking(uint amount) external { require(msg.sender == address(iStakingThales), "Can only be called from staking contract"); totalEscrowBalanceNotIncludedInStaking = totalEscrowBalanceNotIncludedInStaking.add(amount); } /// @notice Subtract the amount of tokens form the total escrow balance not included in staking /// @param amount to subtract function subtractTotalEscrowBalanceNotIncludedInStaking(uint amount) external { require(msg.sender == address(iStakingThales), "Can only be called from staking contract"); totalEscrowBalanceNotIncludedInStaking = totalEscrowBalanceNotIncludedInStaking.sub(amount); } /// @notice Update the current vesting period function updateCurrentPeriod() external returns (bool) { if (!testMode) { require(msg.sender == address(iStakingThales), "Can only be called from staking contract"); } currentVestingPeriod = currentVestingPeriod.add(1); return true; } /// @notice Set address of Staking Thales contract /// @param StakingThalesContract address of Staking Thales contract function setStakingThalesContract(address StakingThalesContract) external onlyOwner { require(StakingThalesContract != address(0), "Invalid address set"); iStakingThales = IStakingThales(StakingThalesContract); emit StakingThalesContractChanged(StakingThalesContract); } /// @notice Enable the test mode function enableTestMode() external onlyOwner { testMode = true; } /// @notice Set address of Airdrop contract /// @param AirdropContract address of Airdrop contract function setAirdropContract(address AirdropContract) external onlyOwner { require(AirdropContract != address(0), "Invalid address set"); airdropContract = AirdropContract; emit AirdropContractChanged(AirdropContract); } /// @notice Set address of Thales staking rewards pool /// @param _thalesStakingRewardsPool address of Thales staking rewards pool function setThalesStakingRewardsPool(address _thalesStakingRewardsPool) public onlyOwner { require(_thalesStakingRewardsPool != address(0), "Invalid address"); ThalesStakingRewardsPool = IThalesStakingRewardsPool(_thalesStakingRewardsPool); emit ThalesStakingRewardsPoolChanged(_thalesStakingRewardsPool); } /// @notice Fix the vesting entry for the account /// @param account to fix the vesting entry for function fixEscrowEntry(address account) external onlyOwner { vestingEntries[account][currentVestingPeriod.mod(NUM_PERIODS)].vesting_period = currentVestingPeriod.add( NUM_PERIODS ); } /// @notice Merge account to transfer all escrow amounts to another account /// @param srcAccount to merge /// @param destAccount to merge into function mergeAccount(address srcAccount, address destAccount) external { require(msg.sender == address(iStakingThales), "Can only be called from staking contract"); if (iStakingThales.stakedBalanceOf(srcAccount) == 0 && iStakingThales.stakedBalanceOf(destAccount) > 0) { if (totalAccountEscrowedAmount[srcAccount] > 0) { totalEscrowBalanceNotIncludedInStaking = totalEscrowBalanceNotIncludedInStaking.sub( totalAccountEscrowedAmount[srcAccount] ); } } if (iStakingThales.stakedBalanceOf(destAccount) == 0 && iStakingThales.stakedBalanceOf(srcAccount) > 0) { if (totalAccountEscrowedAmount[destAccount] > 0) { totalEscrowBalanceNotIncludedInStaking = totalEscrowBalanceNotIncludedInStaking.sub( totalAccountEscrowedAmount[destAccount] ); } } totalAccountEscrowedAmount[destAccount] = totalAccountEscrowedAmount[destAccount].add( totalAccountEscrowedAmount[srcAccount] ); lastPeriodAddedReward[destAccount] = currentVestingPeriod; uint vestingEntriesIndex; uint vestingEntriesPeriod; for (uint i = 1; i <= NUM_PERIODS; i++) { vestingEntriesIndex = currentVestingPeriod.add(i).mod(NUM_PERIODS); vestingEntriesPeriod = currentVestingPeriod.add(i); if (vestingEntriesPeriod != vestingEntries[destAccount][vestingEntriesIndex].vesting_period) { vestingEntries[destAccount][vestingEntriesIndex].amount = 0; vestingEntries[destAccount][vestingEntriesIndex].vesting_period = vestingEntriesPeriod; } if (vestingEntriesPeriod == vestingEntries[srcAccount][vestingEntriesIndex].vesting_period) { vestingEntries[destAccount][vestingEntriesIndex].amount = vestingEntries[destAccount][vestingEntriesIndex] .amount .add(vestingEntries[srcAccount][vestingEntriesIndex].amount); } } delete totalAccountEscrowedAmount[srcAccount]; delete lastPeriodAddedReward[srcAccount]; delete vestingEntries[srcAccount]; } /* ========== INTERNAL FUNCTIONS ========== */ function _getVestingNotAvailable(address account) internal view returns (uint) { uint vesting_not_available = 0; for (uint i = 0; i < NUM_PERIODS; i++) { if (vestingEntries[account][i].vesting_period > currentVestingPeriod) { vesting_not_available = vesting_not_available.add(vestingEntries[account][i].amount); } } return vesting_not_available; } /* ========== EVENTS ========== */ event AddedToEscrow(address acount, uint amount); event Vested(address account, uint amount); event StakingThalesContractChanged(address newAddress); event AirdropContractChanged(address newAddress); event ThalesStakingRewardsPoolChanged(address thalesStakingRewardsPool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; // Clone of syntetix contract without constructor contract ProxyOwned { address public owner; address public nominatedOwner; bool private _initialized; bool private _transferredAtInit; function setOwner(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); require(!_initialized, "Already initialized, use nominateNewOwner"); _initialized = true; owner = _owner; emit OwnerChanged(address(0), _owner); } function nominateNewOwner(address _owner) external onlyOwner { nominatedOwner = _owner; emit OwnerNominated(_owner); } function acceptOwnership() external { require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } function transferOwnershipAtInit(address proxyAddress) external onlyOwner { require(proxyAddress != address(0), "Invalid address"); require(!_transferredAtInit, "Already transferred"); owner = proxyAddress; _transferredAtInit = true; emit OwnerChanged(owner, proxyAddress); } modifier onlyOwner { _onlyOwner(); _; } function _onlyOwner() private view { require(msg.sender == owner, "Only the contract owner may perform this action"); } event OwnerNominated(address newOwner); event OwnerChanged(address oldOwner, address newOwner); }
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; // Inheritance import "./ProxyOwned.sol"; // Clone of syntetix contract without constructor contract ProxyPausable is ProxyOwned { uint public lastPauseTime; bool public paused; /** * @notice Change the paused state of the contract * @dev Only the contract owner may call this. */ function setPaused(bool _paused) external onlyOwner { // Ensure we're actually changing the state before we do anything if (_paused == paused) { return; } // Set our paused state. paused = _paused; // If applicable, set the last pause time. if (paused) { lastPauseTime = block.timestamp; } // Let everyone know that our pause state has changed. emit PauseChanged(paused); } event PauseChanged(bool isPaused); modifier notPaused { require(!paused, "This action cannot be performed while the contract is paused"); _; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer functions must be manually * invoked. This applies both to deploying an Initializable contract, as well * as extending an Initializable contract via inheritance. * WARNING: When used with inheritance, manual care must be taken to not invoke * a parent initializer twice, or ensure that all initializers are idempotent, * because this is not dealt with automatically as with constructors. */ 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 use in the initializer function of a contract. */ modifier initializer() { require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized"); bool isTopLevelCall = !initializing; if (isTopLevelCall) { initializing = true; initialized = true; } _; if (isTopLevelCall) { initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; assembly { cs := extcodesize(self) } return cs == 0; } // Reserved storage space to allow for layout changes in the future. uint256[50] private ______gap; }
pragma solidity ^0.5.0; import "./IERC20.sol"; import "../../math/SafeMath.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 ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; 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)); } 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' // solhint-disable-next-line max-line-length 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).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(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. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @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) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @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) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } /** * @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) { // 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-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts 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) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts 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) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.5.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the `nonReentrant` modifier * available, which can be aplied 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. */ contract ProxyReentrancyGuard { /// @dev counter to allow mutex lock with only one SSTORE operation uint256 private _guardCounter; bool private _initialized; function initNonReentrant() public { require(!_initialized, "Already initialized"); _initialized = true; _guardCounter = 1; } /** * @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() { _guardCounter += 1; uint256 localCounter = _guardCounter; _; require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call"); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; interface IEscrowThales { /* ========== VIEWS / VARIABLES ========== */ function getStakerPeriod(address account, uint index) external view returns (uint); function getStakerAmounts(address account, uint index) external view returns (uint); function totalAccountEscrowedAmount(address account) external view returns (uint); function getStakedEscrowedBalanceForRewards(address account) external view returns (uint); function totalEscrowedRewards() external view returns (uint); function totalEscrowBalanceNotIncludedInStaking() external view returns (uint); function currentVestingPeriod() external view returns (uint); function updateCurrentPeriod() external returns (bool); function claimable(address account) external view returns (uint); function addToEscrow(address account, uint amount) external; function vest(uint amount) external returns (bool); function addTotalEscrowBalanceNotIncludedInStaking(uint amount) external; function subtractTotalEscrowBalanceNotIncludedInStaking(uint amount) external; function mergeAccount(address srcAccount, address destAccount) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; interface IStakingThales { function updateVolume(address account, uint amount) external; function updateStakingRewards( uint _currentPeriodRewards, uint _extraRewards, uint _revShare ) external; /* ========== VIEWS / VARIABLES ========== */ function totalStakedAmount() external view returns (uint); function stakedBalanceOf(address account) external view returns (uint); function currentPeriodRewards() external view returns (uint); function currentPeriodFees() external view returns (uint); function getLastPeriodOfClaimedRewards(address account) external view returns (uint); function getRewardsAvailable(address account) external view returns (uint); function getRewardFeesAvailable(address account) external view returns (uint); function getAlreadyClaimedRewards(address account) external view returns (uint); function getContractRewardFunds() external view returns (uint); function getContractFeeFunds() external view returns (uint); function getAMMVolume(address account) external view returns (uint); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; interface ISNXRewards { /* ========== VIEWS / VARIABLES ========== */ function collateralisationRatioAndAnyRatesInvalid(address account) external view returns (uint, bool); function debtBalanceOf(address _issuer, bytes32 currencyKey) external view returns (uint); function issuanceRatio() external view returns (uint); function setCRatio(address account, uint _c_ratio) external; function setIssuanceRatio(uint _issuanceRation) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; pragma experimental ABIEncoderV2; import "../interfaces/IPassportPosition.sol"; interface IThalesRoyale { /* ========== VIEWS / VARIABLES ========== */ function getBuyInAmount() external view returns (uint); function season() external view returns (uint); function tokenSeason(uint tokenId) external view returns (uint); function seasonFinished(uint _season) external view returns (bool); function roundInASeason(uint _round) external view returns (uint); function roundResultPerSeason(uint _season, uint round) external view returns (uint); function isTokenAliveInASpecificSeason(uint tokenId, uint _season) external view returns (bool); function hasParticipatedInCurrentOrLastRoyale(address _player) external view returns (bool); function getTokenPositions(uint tokenId) external view returns (IPassportPosition.Position[] memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; interface IPriceFeed { // Structs struct RateAndUpdatedTime { uint216 rate; uint40 time; } // Mutative functions function addAggregator(bytes32 currencyKey, address aggregatorAddress) external; function removeAggregator(bytes32 currencyKey) external; // Views function rateForCurrency(bytes32 currencyKey) external view returns (uint); function rateAndUpdatedTime(bytes32 currencyKey) external view returns (uint rate, uint time); function getRates() external view returns (uint[] memory); function getCurrencies() external view returns (bytes32[] memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; interface IThalesStakingRewardsPool { function addToEscrow(address account, uint amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; // pragma experimental ABIEncoderV2; interface IAddressResolver { /* ========== VIEWS / VARIABLES ========== */ // function getAddress(bytes32 _contractName) external view returns (address contract_); // function getAddresses(string[] calldata _contractNames) external view returns (address[] memory contracts); function getAddress(string calldata _contractName) external view returns (address contract_); function checkIfContractExists(string calldata _contractName) external view returns (bool contractExists); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; interface ISportsAMMLiquidityPool { /* ========== VIEWS / VARIABLES ========== */ function isUserLPing(address user) external view returns (bool isUserInLP); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; interface IThalesAMMLiquidityPool { /* ========== VIEWS / VARIABLES ========== */ function isUserLPing(address user) external view returns (bool isUserInLP); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; interface IParlayAMMLiquidityPool { function commitTrade(address market, uint amountToMint) external; function getMarketRound(address market) external view returns (uint _round); function getMarketPool(address market) external view returns (address roundPool); function transferToPool(address market, uint amount) external; function isUserLPing(address user) external view returns (bool isUserInLP); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; import "./IPriceFeed.sol"; interface IThalesAMM { enum Position { Up, Down } function manager() external view returns (address); function availableToBuyFromAMM(address market, Position position) external view returns (uint); function impliedVolatilityPerAsset(bytes32 oracleKey) external view returns (uint); function buyFromAmmQuote( address market, Position position, uint amount ) external view returns (uint); function buyFromAMM( address market, Position position, uint amount, uint expectedPayout, uint additionalSlippage ) external returns (uint); function availableToSellToAMM(address market, Position position) external view returns (uint); function sellToAmmQuote( address market, Position position, uint amount ) external view returns (uint); function sellToAMM( address market, Position position, uint amount, uint expectedPayout, uint additionalSlippage ) external returns (uint); function isMarketInAMMTrading(address market) external view returns (bool); function price(address market, Position position) external view returns (uint); function buyPriceImpact( address market, Position position, uint amount ) external view returns (int); function sellPriceImpact( address market, Position position, uint amount ) external view returns (int); function priceFeed() external view returns (IPriceFeed); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; import "../interfaces/IPositionalMarket.sol"; interface IPositionalMarketManager { /* ========== VIEWS / VARIABLES ========== */ function durations() external view returns (uint expiryDuration, uint maxTimeToMaturity); function capitalRequirement() external view returns (uint); function marketCreationEnabled() external view returns (bool); function onlyAMMMintingAndBurning() external view returns (bool); function transformCollateral(uint value) external view returns (uint); function reverseTransformCollateral(uint value) external view returns (uint); function totalDeposited() external view returns (uint); function numActiveMarkets() external view returns (uint); function activeMarkets(uint index, uint pageSize) external view returns (address[] memory); function numMaturedMarkets() external view returns (uint); function maturedMarkets(uint index, uint pageSize) external view returns (address[] memory); function isActiveMarket(address candidate) external view returns (bool); function isKnownMarket(address candidate) external view returns (bool); function getThalesAMM() external view returns (address); /* ========== MUTATIVE FUNCTIONS ========== */ function createMarket( bytes32 oracleKey, uint strikePrice, uint maturity, uint initialMint // initial sUSD to mint options for, ) external returns (IPositionalMarket); function resolveMarket(address market) external; function expireMarkets(address[] calldata market) external; function transferSusdTo( address sender, address receiver, uint amount ) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; interface IStakingThalesBonusRewardsManager { function storePoints( address user, address origin, uint basePoins, uint round ) external; function getUserRoundBonusShare(address user, uint round) external view returns (uint); function useNewBonusModel() external view returns (bool); function totalRoundBonusPoints(uint round) external view returns (uint); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; interface ICCIPCollector { function sendOnClosePeriod( uint _totalStakedLastPeriodEnd, uint _totalEscrowedLastPeriodEnd, uint _totalBonusPointsInRound, uint _revShare ) external; function pullExtraFunds(uint _amount) external; function decimals() external view returns (uint); }
pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * > 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); }
pragma solidity ^0.5.0; /** * @dev Collection of functions related to the address type, */ library Address { /** * @dev Returns true if `account` is a contract. * * This test is non-exhaustive, and there may be false-negatives: during the * execution of a contract's constructor, its address will be reported as * not containing a contract. * * > It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; interface IPassportPosition { struct Position { uint round; uint position; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; import "../interfaces/IPositionalMarketManager.sol"; import "../interfaces/IPosition.sol"; import "../interfaces/IPriceFeed.sol"; interface IPositionalMarket { /* ========== TYPES ========== */ enum Phase { Trading, Maturity, Expiry } enum Side { Up, Down } /* ========== VIEWS / VARIABLES ========== */ function getOptions() external view returns (IPosition up, IPosition down); function times() external view returns (uint maturity, uint destructino); function getOracleDetails() external view returns ( bytes32 key, uint strikePrice, uint finalPrice ); function fees() external view returns (uint poolFee, uint creatorFee); function deposited() external view returns (uint); function creator() external view returns (address); function resolved() external view returns (bool); function phase() external view returns (Phase); function oraclePrice() external view returns (uint); function oraclePriceAndTimestamp() external view returns (uint price, uint updatedAt); function canResolve() external view returns (bool); function result() external view returns (Side); function balancesOf(address account) external view returns (uint up, uint down); function totalSupplies() external view returns (uint up, uint down); function getMaximumBurnable(address account) external view returns (uint amount); /* ========== MUTATIVE FUNCTIONS ========== */ function mint(uint value) external; function exerciseOptions() external returns (uint); function burnOptions(uint amount) external; function burnOptionsMaximum() external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.16; import "./IPositionalMarket.sol"; interface IPosition { /* ========== VIEWS / VARIABLES ========== */ function getBalanceOf(address account) external view returns (uint); function getTotalSupply() external view returns (uint); function exerciseWithAmount(address claimant, uint amount) external; }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_escrowThales","type":"address"}],"name":"EscrowThalesChnaged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"PauseChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_stakingThales","type":"address"}],"name":"StakingThalesChnaged","type":"event"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"escrowThales","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getStakingData","outputs":[{"components":[{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"uint256","name":"periodsOfStaking","type":"uint256"},{"internalType":"uint256","name":"lastPeriodTimeStamp","type":"uint256"},{"internalType":"uint256","name":"durationPeriod","type":"uint256"},{"internalType":"uint256","name":"unstakeDurationPeriod","type":"uint256"},{"internalType":"uint256","name":"baseRewardsPool","type":"uint256"},{"internalType":"uint256","name":"bonusRewardsPool","type":"uint256"},{"internalType":"uint256","name":"totalStakedAmount","type":"uint256"},{"internalType":"bool","name":"canClosePeriod","type":"bool"},{"internalType":"bool","name":"mergeAccountEnabled","type":"bool"},{"internalType":"uint256","name":"totalEscrowBalanceNotIncludedInStaking","type":"uint256"},{"internalType":"uint256","name":"totalEscrowedRewards","type":"uint256"}],"internalType":"struct StakingData.StakingData","name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserStakingData","outputs":[{"components":[{"internalType":"uint256","name":"thalesStaked","type":"uint256"},{"internalType":"bool","name":"unstaking","type":"bool"},{"internalType":"uint256","name":"lastUnstakeTime","type":"uint256"},{"internalType":"uint256","name":"unstakingAmount","type":"uint256"},{"internalType":"address","name":"delegatedVolume","type":"address"},{"internalType":"uint256","name":"rewards","type":"uint256"},{"internalType":"uint256","name":"baseRewards","type":"uint256"},{"internalType":"uint256","name":"totalBonus","type":"uint256"},{"internalType":"uint256","name":"lastPeriodOfClaimedRewards","type":"uint256"},{"internalType":"uint256","name":"escrowedBalance","type":"uint256"},{"internalType":"uint256","name":"claimable","type":"uint256"}],"internalType":"struct StakingData.UserStakingData","name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserVestingData","outputs":[{"components":[{"internalType":"uint256","name":"numberOfPeriods","type":"uint256"},{"internalType":"uint256","name":"currentVestingPeriod","type":"uint256"},{"internalType":"uint256","name":"lastPeriodTimeStamp","type":"uint256"},{"internalType":"uint256","name":"claimable","type":"uint256"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"vesting_period","type":"uint256"}],"internalType":"struct EscrowThales.VestingEntry[]","name":"vestingEntries","type":"tuple[]"}],"internalType":"struct StakingData.UserVestingData","name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"lastPauseTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_escrowThales","type":"address"}],"name":"setEscrowThales","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_stakingThales","type":"address"}],"name":"setStakingThales","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"stakingThales","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"proxyAddress","type":"address"}],"name":"transferOwnershipAtInit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50611ec4806100206000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c806376e35d89116100a2578063909ece0511610071578063909ece05146101fe57806391b4ded914610211578063c3b83f5f14610226578063c4d66de814610239578063fd8a8cc61461024c5761010b565b806376e35d89146101c657806379ba5097146101db5780637f852582146101e35780638da5cb5b146101f65761010b565b806338d22110116100de57806338d2211014610174578063436ec6ef1461018957806353a47bb7146101a95780635c975abb146101b15761010b565b806304c475801461011057806313af4035146101395780631627540c1461014e57806316c38b3c14610161575b600080fd5b61012361011e36600461176a565b610254565b6040516101309190611df9565b60405180910390f35b61014c61014736600461176a565b6105f8565b005b61014c61015c36600461176a565b6106bf565b61014c61016f3660046117ae565b610712565b61017c610787565b6040516101309190611d04565b61019c61019736600461176a565b610796565b6040516101309190611dea565b61017c610d55565b6101b9610d64565b6040516101309190611d5d565b6101ce610d6d565b6040516101309190611ddb565b61014c611329565b61014c6101f136600461176a565b6113c5565b61017c61141d565b61014c61020c36600461176a565b61142c565b61021961147f565b6040516101309190611e0a565b61014c61023436600461176a565b611485565b61014c61024736600461176a565b611545565b61017c6115d2565b61025c611618565b60365460375460408051630faab8cf60e01b815290516101009093046001600160a01b03908116939216916000918391630faab8cf91600480820192602092909190829003018186803b1580156102b257600080fd5b505afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506102ea91908101906117ea565b905060608160405190808252806020026020018201604052801561032857816020015b610315611647565b81526020019060019003908161030d5790505b50905060005b828110156103fc57600080856001600160a01b031663ab6108508a856040518363ffffffff1660e01b8152600401610367929190611d42565b604080518083038186803b15801561037e57600080fd5b505afa158015610392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103b69190810190611808565b91509150818484815181106103c757fe5b60200260200101516000018181525050808484815181106103e457fe5b6020908102919091018101510152505060010161032e565b506040518060a00160405280846001600160a01b0316630faab8cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561044157600080fd5b505afa158015610455573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061047991908101906117ea565b8152602001846001600160a01b0316635d1385056040518163ffffffff1660e01b815260040160206040518083038186803b1580156104b757600080fd5b505afa1580156104cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104ef91908101906117ea565b8152602001856001600160a01b031663200743546040518163ffffffff1660e01b815260040160206040518083038186803b15801561052d57600080fd5b505afa158015610541573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061056591908101906117ea565b8152602001846001600160a01b031663402914f5896040518263ffffffff1660e01b81526004016105969190611d04565b60206040518083038186803b1580156105ae57600080fd5b505afa1580156105c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105e691908101906117ea565b81526020019190915295945050505050565b6001600160a01b0381166106275760405162461bcd60e51b815260040161061e90611dcb565b60405180910390fd5b603454600160a01b900460ff16156106515760405162461bcd60e51b815260040161061e90611d8b565b6034805460ff60a01b1916600160a01b179055603380546001600160a01b0383166001600160a01b03199091161790556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c906106b4906000908490611d12565b60405180910390a150565b6106c76115e6565b603480546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906106b4908390611d04565b61071a6115e6565b60365460ff161515811515141561073057610784565b6036805460ff1916821515179081905560ff161561074d57426035555b6036546040517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916106b49160ff90911690611d5d565b50565b6037546001600160a01b031681565b61079e611661565b60365460375460408051610160810191829052631676539160e01b9091526101009092046001600160a01b0390811692911690808363167653916107e6886101648501611d04565b60206040518083038186803b1580156107fe57600080fd5b505afa158015610812573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061083691908101906117ea565b8152602001836001600160a01b031663cb8d751a876040518263ffffffff1660e01b81526004016108679190611d04565b60206040518083038186803b15801561087f57600080fd5b505afa158015610893573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108b791908101906117cc565b15158152602001836001600160a01b031663331e03a8876040518263ffffffff1660e01b81526004016108ea9190611d04565b60206040518083038186803b15801561090257600080fd5b505afa158015610916573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061093a91908101906117ea565b8152602001836001600160a01b0316632d287886876040518263ffffffff1660e01b815260040161096b9190611d04565b60206040518083038186803b15801561098357600080fd5b505afa158015610997573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109bb91908101906117ea565b8152602001836001600160a01b031663bd450062876040518263ffffffff1660e01b81526004016109ec9190611d04565b60206040518083038186803b158015610a0457600080fd5b505afa158015610a18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a3c9190810190611790565b6001600160a01b03168152602001836001600160a01b0316637a685677876040518263ffffffff1660e01b8152600401610a769190611d04565b60206040518083038186803b158015610a8e57600080fd5b505afa158015610aa2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ac691908101906117ea565b8152602001836001600160a01b0316639a109bc2876040518263ffffffff1660e01b8152600401610af79190611d04565b60206040518083038186803b158015610b0f57600080fd5b505afa158015610b23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b4791908101906117ea565b8152602001836001600160a01b03166336468b5a876040518263ffffffff1660e01b8152600401610b789190611d04565b60206040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bc891908101906117ea565b8152602001836001600160a01b0316634c4e75df876040518263ffffffff1660e01b8152600401610bf99190611d04565b60206040518083038186803b158015610c1157600080fd5b505afa158015610c25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c4991908101906117ea565b8152602001826001600160a01b031663698f15ca876040518263ffffffff1660e01b8152600401610c7a9190611d04565b60206040518083038186803b158015610c9257600080fd5b505afa158015610ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610cca91908101906117ea565b8152602001826001600160a01b031663402914f5876040518263ffffffff1660e01b8152600401610cfb9190611d04565b60206040518083038186803b158015610d1357600080fd5b505afa158015610d27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d4b91908101906117ea565b9052949350505050565b6034546001600160a01b031681565b60365460ff1681565b610d756116c6565b603654603754604080516101808101808352635c975abb60e01b905290516101009093046001600160a01b039081169392169181908490635c975abb9061018480850191602091818703018186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e0891908101906117cc565b15158152602001836001600160a01b0316637c17f6fc6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4857600080fd5b505afa158015610e5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e8091908101906117ea565b8152602001836001600160a01b031663200743546040518163ffffffff1660e01b815260040160206040518083038186803b158015610ebe57600080fd5b505afa158015610ed2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ef691908101906117ea565b8152602001836001600160a01b03166362139e0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f6c91908101906117ea565b8152602001836001600160a01b03166393eb2e666040518163ffffffff1660e01b815260040160206040518083038186803b158015610faa57600080fd5b505afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610fe291908101906117ea565b8152602001836001600160a01b03166315da50646040518163ffffffff1660e01b815260040160206040518083038186803b15801561102057600080fd5b505afa158015611034573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061105891908101906117ea565b8152602001836001600160a01b0316634ed25b436040518163ffffffff1660e01b815260040160206040518083038186803b15801561109657600080fd5b505afa1580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110ce91908101906117ea565b8152602001836001600160a01b031663567e98f96040518163ffffffff1660e01b815260040160206040518083038186803b15801561110c57600080fd5b505afa158015611120573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061114491908101906117ea565b8152602001836001600160a01b031663afac7fb16040518163ffffffff1660e01b815260040160206040518083038186803b15801561118257600080fd5b505afa158015611196573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111ba91908101906117cc565b15158152602001836001600160a01b031663c731a3d16040518163ffffffff1660e01b815260040160206040518083038186803b1580156111fa57600080fd5b505afa15801561120e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061123291908101906117cc565b15158152602001826001600160a01b0316638fa6d02e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561127257600080fd5b505afa158015611286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112aa91908101906117ea565b8152602001826001600160a01b031663b9d1c70b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112e857600080fd5b505afa1580156112fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061132091908101906117ea565b90529250505090565b6034546001600160a01b031633146113535760405162461bcd60e51b815260040161061e90611d6b565b6033546034546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92611396926001600160a01b0391821692911690611d34565b60405180910390a160348054603380546001600160a01b03199081166001600160a01b03841617909155169055565b6113cd6115e6565b60368054610100600160a81b0319166101006001600160a01b038416021790556040517f98744f498f8e1eb18db2b0234645b098f1b79154bef95dc68f2ebc4245e9f49d906106b4908390611d04565b6033546001600160a01b031681565b6114346115e6565b603780546001600160a01b0319166001600160a01b0383161790556040517f3eb2b20323f4f588be40f88adb8fb16a1beff75f815b08eabd9ccaebd4c38132906106b4908390611d04565b60355481565b61148d6115e6565b6001600160a01b0381166114b35760405162461bcd60e51b815260040161061e90611d7b565b603454600160a81b900460ff16156114dd5760405162461bcd60e51b815260040161061e90611dab565b603380546001600160a01b038084166001600160a01b031990921691909117918290556034805460ff60a81b1916600160a81b1790556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c926106b49216908490611d34565b600054610100900460ff168061155e575061155e611612565b8061156c575060005460ff16155b6115885760405162461bcd60e51b815260040161061e90611dbb565b600054610100900460ff161580156115b3576000805460ff1961ff0019909116610100171660011790555b6115bc826105f8565b80156115ce576000805461ff00191690555b5050565b60365461010090046001600160a01b031681565b6033546001600160a01b031633146116105760405162461bcd60e51b815260040161061e90611d9b565b565b303b1590565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001606081525090565b604051806040016040528060008152602001600081525090565b60405180610160016040528060008152602001600015158152602001600081526020016000815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518061018001604052806000151581526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160001515815260200160008152602001600081525090565b803561173881611e5b565b92915050565b805161173881611e5b565b803561173881611e6f565b805161173881611e6f565b805161173881611e78565b60006020828403121561177c57600080fd5b6000611788848461172d565b949350505050565b6000602082840312156117a257600080fd5b6000611788848461173e565b6000602082840312156117c057600080fd5b60006117888484611749565b6000602082840312156117de57600080fd5b60006117888484611754565b6000602082840312156117fc57600080fd5b6000611788848461175f565b6000806040838503121561181b57600080fd5b6000611827858561175f565b92505060206118388582860161175f565b9150509250929050565b600061184e8383611cdb565b505060400190565b61185f81611e4a565b82525050565b61185f81611e2b565b600061187982611e1e565b6118838185611e22565b935061188e83611e18565b8060005b838110156118bc5781516118a68882611842565b97506118b183611e18565b925050600101611892565b509495945050505050565b61185f81611e36565b60006118dd603583611e22565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6000611934600f83611e22565b6e496e76616c6964206164647265737360881b815260200192915050565b600061195f602983611e22565b7f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617481526832a732bba7bbb732b960b91b602082015260400192915050565b60006119aa602f83611e22565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b60006119fb601383611e22565b72105b1c9958591e481d1c985b9cd9995c9c9959606a1b815260200192915050565b6000611a2a602e83611e22565b7f436f6e747261637420696e7374616e63652068617320616c726561647920626581526d195b881a5b9a5d1a585b1a5e995960921b602082015260400192915050565b6000611a7a601983611e22565b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000815260200192915050565b8051610180830190611ab884826118c7565b506020820151611acb6020850182611cfb565b506040820151611ade6040850182611cfb565b506060820151611af16060850182611cfb565b506080820151611b046080850182611cfb565b5060a0820151611b1760a0850182611cfb565b5060c0820151611b2a60c0850182611cfb565b5060e0820151611b3d60e0850182611cfb565b50610100820151611b526101008501826118c7565b50610120820151611b676101208501826118c7565b50610140820151611b7c610140850182611cfb565b50610160820151611b91610160850182611cfb565b50505050565b8051610160830190611ba98482611cfb565b506020820151611bbc60208501826118c7565b506040820151611bcf6040850182611cfb565b506060820151611be26060850182611cfb565b506080820151611bf56080850182611865565b5060a0820151611c0860a0850182611cfb565b5060c0820151611c1b60c0850182611cfb565b5060e0820151611c2e60e0850182611cfb565b50610100820151611c43610100850182611cfb565b50610120820151611c58610120850182611cfb565b50610140820151611b91610140850182611cfb565b805160009060a0840190611c818582611cfb565b506020830151611c946020860182611cfb565b506040830151611ca76040860182611cfb565b506060830151611cba6060860182611cfb565b5060808301518482036080860152611cd2828261186e565b95945050505050565b80516040830190611cec8482611cfb565b506020820151611b9160208501825b61185f81611e47565b602081016117388284611865565b60408101611d208285611856565b611d2d6020830184611865565b9392505050565b60408101611d208285611865565b60408101611d508285611865565b611d2d6020830184611cfb565b6020810161173882846118c7565b60208082528101611738816118d0565b6020808252810161173881611927565b6020808252810161173881611952565b602080825281016117388161199d565b60208082528101611738816119ee565b6020808252810161173881611a1d565b6020808252810161173881611a6d565b61018081016117388284611aa6565b61016081016117388284611b97565b60208082528101611d2d8184611c6d565b602081016117388284611cfb565b60200190565b5190565b90815260200190565b600061173882611e3b565b151590565b6001600160a01b031690565b90565b600061173882600061173882611e2b565b611e6481611e2b565b811461078457600080fd5b611e6481611e36565b611e6481611e4756fea365627a7a72315820dab6c33fb23631ceb0124395a622ccaaa5299c7368188d250b7ce411554905916c6578706572696d656e74616cf564736f6c63430005100040
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806376e35d89116100a2578063909ece0511610071578063909ece05146101fe57806391b4ded914610211578063c3b83f5f14610226578063c4d66de814610239578063fd8a8cc61461024c5761010b565b806376e35d89146101c657806379ba5097146101db5780637f852582146101e35780638da5cb5b146101f65761010b565b806338d22110116100de57806338d2211014610174578063436ec6ef1461018957806353a47bb7146101a95780635c975abb146101b15761010b565b806304c475801461011057806313af4035146101395780631627540c1461014e57806316c38b3c14610161575b600080fd5b61012361011e36600461176a565b610254565b6040516101309190611df9565b60405180910390f35b61014c61014736600461176a565b6105f8565b005b61014c61015c36600461176a565b6106bf565b61014c61016f3660046117ae565b610712565b61017c610787565b6040516101309190611d04565b61019c61019736600461176a565b610796565b6040516101309190611dea565b61017c610d55565b6101b9610d64565b6040516101309190611d5d565b6101ce610d6d565b6040516101309190611ddb565b61014c611329565b61014c6101f136600461176a565b6113c5565b61017c61141d565b61014c61020c36600461176a565b61142c565b61021961147f565b6040516101309190611e0a565b61014c61023436600461176a565b611485565b61014c61024736600461176a565b611545565b61017c6115d2565b61025c611618565b60365460375460408051630faab8cf60e01b815290516101009093046001600160a01b03908116939216916000918391630faab8cf91600480820192602092909190829003018186803b1580156102b257600080fd5b505afa1580156102c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506102ea91908101906117ea565b905060608160405190808252806020026020018201604052801561032857816020015b610315611647565b81526020019060019003908161030d5790505b50905060005b828110156103fc57600080856001600160a01b031663ab6108508a856040518363ffffffff1660e01b8152600401610367929190611d42565b604080518083038186803b15801561037e57600080fd5b505afa158015610392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103b69190810190611808565b91509150818484815181106103c757fe5b60200260200101516000018181525050808484815181106103e457fe5b6020908102919091018101510152505060010161032e565b506040518060a00160405280846001600160a01b0316630faab8cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561044157600080fd5b505afa158015610455573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061047991908101906117ea565b8152602001846001600160a01b0316635d1385056040518163ffffffff1660e01b815260040160206040518083038186803b1580156104b757600080fd5b505afa1580156104cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104ef91908101906117ea565b8152602001856001600160a01b031663200743546040518163ffffffff1660e01b815260040160206040518083038186803b15801561052d57600080fd5b505afa158015610541573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061056591908101906117ea565b8152602001846001600160a01b031663402914f5896040518263ffffffff1660e01b81526004016105969190611d04565b60206040518083038186803b1580156105ae57600080fd5b505afa1580156105c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105e691908101906117ea565b81526020019190915295945050505050565b6001600160a01b0381166106275760405162461bcd60e51b815260040161061e90611dcb565b60405180910390fd5b603454600160a01b900460ff16156106515760405162461bcd60e51b815260040161061e90611d8b565b6034805460ff60a01b1916600160a01b179055603380546001600160a01b0383166001600160a01b03199091161790556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c906106b4906000908490611d12565b60405180910390a150565b6106c76115e6565b603480546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906106b4908390611d04565b61071a6115e6565b60365460ff161515811515141561073057610784565b6036805460ff1916821515179081905560ff161561074d57426035555b6036546040517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5916106b49160ff90911690611d5d565b50565b6037546001600160a01b031681565b61079e611661565b60365460375460408051610160810191829052631676539160e01b9091526101009092046001600160a01b0390811692911690808363167653916107e6886101648501611d04565b60206040518083038186803b1580156107fe57600080fd5b505afa158015610812573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061083691908101906117ea565b8152602001836001600160a01b031663cb8d751a876040518263ffffffff1660e01b81526004016108679190611d04565b60206040518083038186803b15801561087f57600080fd5b505afa158015610893573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108b791908101906117cc565b15158152602001836001600160a01b031663331e03a8876040518263ffffffff1660e01b81526004016108ea9190611d04565b60206040518083038186803b15801561090257600080fd5b505afa158015610916573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061093a91908101906117ea565b8152602001836001600160a01b0316632d287886876040518263ffffffff1660e01b815260040161096b9190611d04565b60206040518083038186803b15801561098357600080fd5b505afa158015610997573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109bb91908101906117ea565b8152602001836001600160a01b031663bd450062876040518263ffffffff1660e01b81526004016109ec9190611d04565b60206040518083038186803b158015610a0457600080fd5b505afa158015610a18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a3c9190810190611790565b6001600160a01b03168152602001836001600160a01b0316637a685677876040518263ffffffff1660e01b8152600401610a769190611d04565b60206040518083038186803b158015610a8e57600080fd5b505afa158015610aa2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ac691908101906117ea565b8152602001836001600160a01b0316639a109bc2876040518263ffffffff1660e01b8152600401610af79190611d04565b60206040518083038186803b158015610b0f57600080fd5b505afa158015610b23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b4791908101906117ea565b8152602001836001600160a01b03166336468b5a876040518263ffffffff1660e01b8152600401610b789190611d04565b60206040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bc891908101906117ea565b8152602001836001600160a01b0316634c4e75df876040518263ffffffff1660e01b8152600401610bf99190611d04565b60206040518083038186803b158015610c1157600080fd5b505afa158015610c25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c4991908101906117ea565b8152602001826001600160a01b031663698f15ca876040518263ffffffff1660e01b8152600401610c7a9190611d04565b60206040518083038186803b158015610c9257600080fd5b505afa158015610ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610cca91908101906117ea565b8152602001826001600160a01b031663402914f5876040518263ffffffff1660e01b8152600401610cfb9190611d04565b60206040518083038186803b158015610d1357600080fd5b505afa158015610d27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d4b91908101906117ea565b9052949350505050565b6034546001600160a01b031681565b60365460ff1681565b610d756116c6565b603654603754604080516101808101808352635c975abb60e01b905290516101009093046001600160a01b039081169392169181908490635c975abb9061018480850191602091818703018186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e0891908101906117cc565b15158152602001836001600160a01b0316637c17f6fc6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4857600080fd5b505afa158015610e5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e8091908101906117ea565b8152602001836001600160a01b031663200743546040518163ffffffff1660e01b815260040160206040518083038186803b158015610ebe57600080fd5b505afa158015610ed2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ef691908101906117ea565b8152602001836001600160a01b03166362139e0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f6c91908101906117ea565b8152602001836001600160a01b03166393eb2e666040518163ffffffff1660e01b815260040160206040518083038186803b158015610faa57600080fd5b505afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610fe291908101906117ea565b8152602001836001600160a01b03166315da50646040518163ffffffff1660e01b815260040160206040518083038186803b15801561102057600080fd5b505afa158015611034573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061105891908101906117ea565b8152602001836001600160a01b0316634ed25b436040518163ffffffff1660e01b815260040160206040518083038186803b15801561109657600080fd5b505afa1580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110ce91908101906117ea565b8152602001836001600160a01b031663567e98f96040518163ffffffff1660e01b815260040160206040518083038186803b15801561110c57600080fd5b505afa158015611120573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061114491908101906117ea565b8152602001836001600160a01b031663afac7fb16040518163ffffffff1660e01b815260040160206040518083038186803b15801561118257600080fd5b505afa158015611196573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111ba91908101906117cc565b15158152602001836001600160a01b031663c731a3d16040518163ffffffff1660e01b815260040160206040518083038186803b1580156111fa57600080fd5b505afa15801561120e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061123291908101906117cc565b15158152602001826001600160a01b0316638fa6d02e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561127257600080fd5b505afa158015611286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112aa91908101906117ea565b8152602001826001600160a01b031663b9d1c70b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112e857600080fd5b505afa1580156112fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061132091908101906117ea565b90529250505090565b6034546001600160a01b031633146113535760405162461bcd60e51b815260040161061e90611d6b565b6033546034546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c92611396926001600160a01b0391821692911690611d34565b60405180910390a160348054603380546001600160a01b03199081166001600160a01b03841617909155169055565b6113cd6115e6565b60368054610100600160a81b0319166101006001600160a01b038416021790556040517f98744f498f8e1eb18db2b0234645b098f1b79154bef95dc68f2ebc4245e9f49d906106b4908390611d04565b6033546001600160a01b031681565b6114346115e6565b603780546001600160a01b0319166001600160a01b0383161790556040517f3eb2b20323f4f588be40f88adb8fb16a1beff75f815b08eabd9ccaebd4c38132906106b4908390611d04565b60355481565b61148d6115e6565b6001600160a01b0381166114b35760405162461bcd60e51b815260040161061e90611d7b565b603454600160a81b900460ff16156114dd5760405162461bcd60e51b815260040161061e90611dab565b603380546001600160a01b038084166001600160a01b031990921691909117918290556034805460ff60a81b1916600160a81b1790556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c926106b49216908490611d34565b600054610100900460ff168061155e575061155e611612565b8061156c575060005460ff16155b6115885760405162461bcd60e51b815260040161061e90611dbb565b600054610100900460ff161580156115b3576000805460ff1961ff0019909116610100171660011790555b6115bc826105f8565b80156115ce576000805461ff00191690555b5050565b60365461010090046001600160a01b031681565b6033546001600160a01b031633146116105760405162461bcd60e51b815260040161061e90611d9b565b565b303b1590565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001606081525090565b604051806040016040528060008152602001600081525090565b60405180610160016040528060008152602001600015158152602001600081526020016000815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518061018001604052806000151581526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160001515815260200160008152602001600081525090565b803561173881611e5b565b92915050565b805161173881611e5b565b803561173881611e6f565b805161173881611e6f565b805161173881611e78565b60006020828403121561177c57600080fd5b6000611788848461172d565b949350505050565b6000602082840312156117a257600080fd5b6000611788848461173e565b6000602082840312156117c057600080fd5b60006117888484611749565b6000602082840312156117de57600080fd5b60006117888484611754565b6000602082840312156117fc57600080fd5b6000611788848461175f565b6000806040838503121561181b57600080fd5b6000611827858561175f565b92505060206118388582860161175f565b9150509250929050565b600061184e8383611cdb565b505060400190565b61185f81611e4a565b82525050565b61185f81611e2b565b600061187982611e1e565b6118838185611e22565b935061188e83611e18565b8060005b838110156118bc5781516118a68882611842565b97506118b183611e18565b925050600101611892565b509495945050505050565b61185f81611e36565b60006118dd603583611e22565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6000611934600f83611e22565b6e496e76616c6964206164647265737360881b815260200192915050565b600061195f602983611e22565b7f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617481526832a732bba7bbb732b960b91b602082015260400192915050565b60006119aa602f83611e22565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b60006119fb601383611e22565b72105b1c9958591e481d1c985b9cd9995c9c9959606a1b815260200192915050565b6000611a2a602e83611e22565b7f436f6e747261637420696e7374616e63652068617320616c726561647920626581526d195b881a5b9a5d1a585b1a5e995960921b602082015260400192915050565b6000611a7a601983611e22565b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000815260200192915050565b8051610180830190611ab884826118c7565b506020820151611acb6020850182611cfb565b506040820151611ade6040850182611cfb565b506060820151611af16060850182611cfb565b506080820151611b046080850182611cfb565b5060a0820151611b1760a0850182611cfb565b5060c0820151611b2a60c0850182611cfb565b5060e0820151611b3d60e0850182611cfb565b50610100820151611b526101008501826118c7565b50610120820151611b676101208501826118c7565b50610140820151611b7c610140850182611cfb565b50610160820151611b91610160850182611cfb565b50505050565b8051610160830190611ba98482611cfb565b506020820151611bbc60208501826118c7565b506040820151611bcf6040850182611cfb565b506060820151611be26060850182611cfb565b506080820151611bf56080850182611865565b5060a0820151611c0860a0850182611cfb565b5060c0820151611c1b60c0850182611cfb565b5060e0820151611c2e60e0850182611cfb565b50610100820151611c43610100850182611cfb565b50610120820151611c58610120850182611cfb565b50610140820151611b91610140850182611cfb565b805160009060a0840190611c818582611cfb565b506020830151611c946020860182611cfb565b506040830151611ca76040860182611cfb565b506060830151611cba6060860182611cfb565b5060808301518482036080860152611cd2828261186e565b95945050505050565b80516040830190611cec8482611cfb565b506020820151611b9160208501825b61185f81611e47565b602081016117388284611865565b60408101611d208285611856565b611d2d6020830184611865565b9392505050565b60408101611d208285611865565b60408101611d508285611865565b611d2d6020830184611cfb565b6020810161173882846118c7565b60208082528101611738816118d0565b6020808252810161173881611927565b6020808252810161173881611952565b602080825281016117388161199d565b60208082528101611738816119ee565b6020808252810161173881611a1d565b6020808252810161173881611a6d565b61018081016117388284611aa6565b61016081016117388284611b97565b60208082528101611d2d8184611c6d565b602081016117388284611cfb565b60200190565b5190565b90815260200190565b600061173882611e3b565b151590565b6001600160a01b031690565b90565b600061173882600061173882611e2b565b611e6481611e2b565b811461078457600080fd5b611e6481611e36565b611e6481611e4756fea365627a7a72315820dab6c33fb23631ceb0124395a622ccaaa5299c7368188d250b7ce411554905916c6578706572696d656e74616cf564736f6c63430005100040
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.