Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 2,774 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Claim From Forei... | 12576802 | 1743 days ago | IN | 0 ETH | 0.00192217 | ||||
| Claim From Forei... | 12111187 | 1815 days ago | IN | 0 ETH | 0.0800295 | ||||
| Claim From Forei... | 12111178 | 1815 days ago | IN | 0 ETH | 0.07810635 | ||||
| Claim From Forei... | 12111172 | 1815 days ago | IN | 0 ETH | 0.07810635 | ||||
| Claim From Forei... | 12111168 | 1815 days ago | IN | 0 ETH | 0.08259044 | ||||
| Claim From Forei... | 12111162 | 1815 days ago | IN | 0 ETH | 0.08312811 | ||||
| Claim From Forei... | 11469890 | 1914 days ago | IN | 0 ETH | 0.07946755 | ||||
| Claim From Forei... | 11463133 | 1915 days ago | IN | 0 ETH | 0.02155425 | ||||
| Claim From Forei... | 11462080 | 1915 days ago | IN | 0 ETH | 0.01931391 | ||||
| Claim From Forei... | 11461266 | 1915 days ago | IN | 0 ETH | 0.03255962 | ||||
| Claim From Forei... | 11458668 | 1916 days ago | IN | 0 ETH | 0.00392 | ||||
| Claim From Forei... | 11458183 | 1916 days ago | IN | 0 ETH | 0.05516721 | ||||
| Claim From Forei... | 11453569 | 1916 days ago | IN | 0 ETH | 0.02428034 | ||||
| Claim From Forei... | 11448483 | 1917 days ago | IN | 0 ETH | 0.02648976 | ||||
| Claim From Forei... | 11448374 | 1917 days ago | IN | 0 ETH | 0.02428087 | ||||
| Claim From Forei... | 11445864 | 1918 days ago | IN | 0 ETH | 0.01103692 | ||||
| Claim From Forei... | 11444290 | 1918 days ago | IN | 0 ETH | 0.00827739 | ||||
| Claim From Forei... | 11444281 | 1918 days ago | IN | 0 ETH | 0.01031996 | ||||
| Claim From Forei... | 11444257 | 1918 days ago | IN | 0 ETH | 0.00833305 | ||||
| Claim From Forei... | 11444253 | 1918 days ago | IN | 0 ETH | 0.00882972 | ||||
| Claim From Forei... | 11443548 | 1918 days ago | IN | 0 ETH | 0.01360411 | ||||
| Claim From Forei... | 11441238 | 1918 days ago | IN | 0 ETH | 0.00910532 | ||||
| Claim From Forei... | 11440546 | 1918 days ago | IN | 0 ETH | 0.00882972 | ||||
| Claim From Forei... | 11439821 | 1919 days ago | IN | 0 ETH | 0.01042973 | ||||
| Claim From Forei... | 11439763 | 1919 days ago | IN | 0 ETH | 0.00938138 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ForeignSwap
Compiler Version
v0.6.6+commit.6c089d02
Optimization Enabled:
Yes with 0 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/cryptography/ECDSA.sol";
import "./interfaces/IToken.sol";
import "./interfaces/IAuction.sol";
import "./interfaces/IStaking.sol";
import "./interfaces/IBPD.sol";
import "./interfaces/IForeignSwap.sol";
contract ForeignSwap is IForeignSwap, AccessControl {
using SafeMath for uint256;
event TokensClaimed(
address indexed account,
uint256 indexed stepsFromStart,
uint256 userAmount,
uint256 penaltyuAmount
);
bytes32 public constant SETTER_ROLE = keccak256("SETTER_ROLE");
uint256 public start;
uint256 public stepTimestamp;
uint256 public stakePeriod;
uint256 public maxClaimAmount;
// uint256 public constant PERIOD = 350;
address public mainToken;
address public staking;
address public auction;
address public bigPayDayPool;
address public signerAddress;
mapping(address => uint256) public claimedBalanceOf;
uint256 internal claimedAmount;
uint256 internal totalSnapshotAmount;
uint256 internal claimedAddresses;
uint256 internal totalSnapshotAddresses;
modifier onlySetter() {
require(hasRole(SETTER_ROLE, _msgSender()), "Caller is not a setter");
_;
}
constructor(address _setter) public {
_setupRole(SETTER_ROLE, _setter);
}
function init(
address _signer,
uint256 _stepTimestamp,
uint256 _stakePeriod,
uint256 _maxClaimAmount,
address _mainToken,
address _auction,
address _staking,
address _bigPayDayPool,
uint256 _totalSnapshotAmount,
uint256 _totalSnapshotAddresses
) external onlySetter {
signerAddress = _signer;
start = now;
stepTimestamp = _stepTimestamp;
stakePeriod = _stakePeriod;
maxClaimAmount = _maxClaimAmount;
mainToken = _mainToken;
staking = _staking;
auction = _auction;
bigPayDayPool = _bigPayDayPool;
totalSnapshotAmount = _totalSnapshotAmount;
totalSnapshotAddresses = _totalSnapshotAddresses;
renounceRole(SETTER_ROLE, _msgSender());
}
function getCurrentClaimedAmount()
external
override
view
returns (uint256)
{
return claimedAmount;
}
function getTotalSnapshotAmount() external override view returns (uint256) {
return totalSnapshotAmount;
}
function getCurrentClaimedAddresses()
external
override
view
returns (uint256)
{
return claimedAddresses;
}
function getTotalSnapshotAddresses()
external
override
view
returns (uint256)
{
return totalSnapshotAddresses;
}
function getMessageHash(uint256 amount, address account)
public
pure
returns (bytes32)
{
return keccak256(abi.encode(amount, account));
}
function check(uint256 amount, bytes memory signature)
public
view
returns (bool)
{
bytes32 messageHash = getMessageHash(amount, address(msg.sender));
return ECDSA.recover(messageHash, signature) == signerAddress;
}
function getUserClaimableAmountFor(uint256 amount)
public
view
returns (uint256, uint256)
{
if (amount > 0) {
(
uint256 amountOut,
uint256 delta,
uint256 deltaAuctionWeekly
) = getClaimableAmount(amount);
uint256 deltaPenalized = delta.add(deltaAuctionWeekly);
return (amountOut, deltaPenalized);
} else {
return (0, 0);
}
}
function claimFromForeign(uint256 amount, bytes memory signature)
public
returns (bool)
{
require(amount > 0, "CLAIM: amount <= 0");
require(
check(amount, signature),
"CLAIM: cannot claim because signature is not correct"
);
require(claimedBalanceOf[msg.sender] == 0, "CLAIM: cannot claim twice");
(
uint256 amountOut,
uint256 delta,
uint256 deltaAuctionWeekly
) = getClaimableAmount(amount);
uint256 deltaPart = delta.div(stakePeriod);
uint256 deltaAuctionDaily = deltaPart.mul(stakePeriod.sub(uint256(1)));
IToken(mainToken).mint(auction, deltaAuctionDaily);
IAuction(auction).callIncomeDailyTokensTrigger(deltaAuctionDaily);
if (deltaAuctionWeekly > 0) {
IToken(mainToken).mint(auction, deltaAuctionWeekly);
IAuction(auction).callIncomeWeeklyTokensTrigger(deltaAuctionWeekly);
}
IToken(mainToken).mint(bigPayDayPool, deltaPart);
IBPD(bigPayDayPool).callIncomeTokensTrigger(deltaPart);
IStaking(staking).externalStake(amountOut, stakePeriod, msg.sender);
claimedBalanceOf[msg.sender] = amount;
claimedAmount = claimedAmount.add(amount);
claimedAddresses = claimedAddresses.add(uint256(1));
emit TokensClaimed(msg.sender, calculateStepsFromStart(), amountOut, deltaPart);
return true;
}
function calculateStepsFromStart() public view returns (uint256) {
return (now.sub(start)).div(stepTimestamp);
}
// function calculateStakeEndTime(uint256 startTime) internal view returns (uint256) {
// uint256 stakePeriod = stepTimestamp.mul(stakePeriod);
// return startTime.add(stakePeriod);
// }
function getClaimableAmount(uint256 amount)
internal
view
returns (
uint256,
uint256,
uint256
)
{
uint256 deltaAuctionWeekly = 0;
if (amount > maxClaimAmount) {
deltaAuctionWeekly = amount.sub(maxClaimAmount);
amount = maxClaimAmount;
}
uint256 stepsFromStart = calculateStepsFromStart();
uint256 daysPassed = stepsFromStart > stakePeriod ? stakePeriod : stepsFromStart;
uint256 delta = amount.mul(daysPassed).div(stakePeriod);
uint256 amountOut = amount.sub(delta);
return (amountOut, delta, deltaAuctionWeekly);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface IAuction {
function callIncomeDailyTokensTrigger(uint256 amount) external;
function callIncomeWeeklyTokensTrigger(uint256 amount) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface IBPD {
function callIncomeTokensTrigger(uint256 incomeAmountToken) external;
function transferYearlyPool(uint256 poolNumber) external returns (uint256);
function getPoolYearAmounts() external view returns (uint256[5] memory poolAmounts);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface IForeignSwap {
function getCurrentClaimedAmount() external view returns (uint256);
function getTotalSnapshotAmount() external view returns (uint256);
function getCurrentClaimedAddresses() external view returns (uint256);
function getTotalSnapshotAddresses() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface IStaking {
function externalStake(
uint256 amount,
uint256 stakingDays,
address staker
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface IToken {
function mint(address to, uint256 amount) external;
function burn(address from, uint256 amount) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../GSN/Context.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControl is Context {
using EnumerableSet for EnumerableSet.AddressSet;
using Address for address;
struct RoleData {
EnumerableSet.AddressSet members;
bytes32 adminRole;
}
mapping (bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view returns (bool) {
return _roles[role].members.contains(account);
}
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) public view returns (uint256) {
return _roles[role].members.length();
}
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
return _roles[role].members.at(index);
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual {
require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual {
require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
_roles[role].adminRole = adminRole;
}
function _grantRole(bytes32 role, address account) private {
if (_roles[role].members.add(account)) {
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) private {
if (_roles[role].members.remove(account)) {
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
// Check the signature length
if (signature.length != 65) {
revert("ECDSA: invalid signature length");
}
// Divide the signature in r, s and v variables
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
// solhint-disable-next-line no-inline-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
revert("ECDSA: invalid signature 's' value");
}
if (v != 27 && v != 28) {
revert("ECDSA: invalid signature 'v' value");
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
require(signer != address(0), "ECDSA: invalid signature");
return signer;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* replicates the behavior of the
* https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
* JSON-RPC method.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
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-contracts/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) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
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) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies 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;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}{
"remappings": [],
"optimizer": {
"enabled": true,
"runs": 0
},
"evmVersion": "istanbul",
"libraries": {
"": {}
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_setter","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"stepsFromStart","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"penaltyuAmount","type":"uint256"}],"name":"TokensClaimed","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auction","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bigPayDayPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateStepsFromStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"claimFromForeign","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimedBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentClaimedAddresses","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentClaimedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"getMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalSnapshotAddresses","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalSnapshotAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getUserClaimableAmountFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"},{"internalType":"uint256","name":"_stepTimestamp","type":"uint256"},{"internalType":"uint256","name":"_stakePeriod","type":"uint256"},{"internalType":"uint256","name":"_maxClaimAmount","type":"uint256"},{"internalType":"address","name":"_mainToken","type":"address"},{"internalType":"address","name":"_auction","type":"address"},{"internalType":"address","name":"_staking","type":"address"},{"internalType":"address","name":"_bigPayDayPool","type":"address"},{"internalType":"uint256","name":"_totalSnapshotAmount","type":"uint256"},{"internalType":"uint256","name":"_totalSnapshotAddresses","type":"uint256"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mainToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxClaimAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"staking","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"start","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stepTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b506040516200194238038062001942833981810160405260208110156200003757600080fd5b5051604080516a5345545445525f524f4c4560a81b8152905190819003600b0190206200006e90826001600160e01b036200007516565b50620001ad565b6200008a82826001600160e01b036200008e16565b5050565b600082815260208181526040909120620000b39183906200144c62000110821b17901c565b156200008a57620000cc6001600160e01b036200013916565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600062000130836001600160a01b0384166001600160e01b036200013d16565b90505b92915050565b3390565b60006200015483836001600160e01b036200019516565b6200018c5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000133565b50600062000133565b60009081526001919091016020526040902054151590565b61178580620001bd6000396000f3fe608060405234801561001057600080fd5b506004361061015f5760003560e01c806314eb55d414610164578063248a9ca3146102235780632f2ff15d1461025257806336568abe146102805780633fc15f15146102ac5780634bc2e48d146102d05780634cf088d9146102d857806353b67363146102e05780635b7633d0146102e857806368fc7f33146102f0578063745f6a00146103595780637531d1b2146103855780637d9f6db51461038d5780639010d07c1461039557806391d14854146103b85780639304b780146103e4578063a2011b3f1461041a578063a217fddf14610422578063a2e6f9bf1461042a578063ae73bc2614610432578063aeef64391461043a578063b93563a114610442578063be9a65551461044a578063c1699a9914610452578063c871a0921461045a578063c8de1d5614610462578063ca15c87314610488578063d547741f146104a5578063e57deb39146104d1575b600080fd5b61020f6004803603604081101561017a57600080fd5b81359190810190604081016020820135600160201b81111561019b57600080fd5b8201836020820111156101ad57600080fd5b803590602001918460018302840111600160201b831117156101ce57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061057c945050505050565b604080519115158252519081900360200190f35b6102406004803603602081101561023957600080fd5b5035610a50565b60408051918252519081900360200190f35b61027e6004803603604081101561026857600080fd5b50803590602001356001600160a01b0316610a65565b005b61027e6004803603604081101561029657600080fd5b50803590602001356001600160a01b0316610ad1565b6102b4610b32565b604080516001600160a01b039092168252519081900360200190f35b610240610b41565b6102b4610b6f565b6102b4610b7e565b6102b4610b8d565b61027e600480360361014081101561030757600080fd5b506001600160a01b038135811691602081013591604082013591606081013591608082013581169160a081013582169160c082013581169160e081013590911690610100810135906101200135610b9c565b6102406004803603604081101561036f57600080fd5b50803590602001356001600160a01b0316610cc3565b610240610cf8565b6102b4610cfe565b6102b4600480360360408110156103ab57600080fd5b5080359060200135610d0d565b61020f600480360360408110156103ce57600080fd5b50803590602001356001600160a01b0316610d32565b610401600480360360208110156103fa57600080fd5b5035610d50565b6040805192835260208301919091528051918290030190f35b610240610d9b565b610240610dbe565b610240610dc3565b610240610dc9565b610240610dcf565b610240610dd5565b610240610ddb565b610240610de1565b610240610de7565b6102406004803603602081101561047857600080fd5b50356001600160a01b0316610ded565b6102406004803603602081101561049e57600080fd5b5035610dff565b61027e600480360360408110156104bb57600080fd5b50803590602001356001600160a01b0316610e16565b61020f600480360360408110156104e757600080fd5b81359190810190604081016020820135600160201b81111561050857600080fd5b82018360208201111561051a57600080fd5b803590602001918460018302840111600160201b8311171561053b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610e6f945050505050565b60008083116105c7576040805162461bcd60e51b81526020600482015260126024820152710434c41494d3a20616d6f756e74203c3d20360741b604482015290519081900360640190fd5b6105d18383610e6f565b61060c5760405162461bcd60e51b81526004018080602001828103825260348152602001806116ed6034913960400191505060405180910390fd5b336000908152600a60205260409020541561066a576040805162461bcd60e51b8152602060048201526019602482015278434c41494d3a2063616e6e6f7420636c61696d20747769636560381b604482015290519081900360640190fd5b600080600061067886610ea7565b925092509250600061069560035484610f3890919063ffffffff16565b905060006106bf6106b26001600354610f7790919063ffffffff16565b839063ffffffff610fb916565b600554600754604080516340c10f1960e01b81526001600160a01b0392831660048201526024810185905290519394509116916340c10f199160448082019260009290919082900301818387803b15801561071957600080fd5b505af115801561072d573d6000803e3d6000fd5b50506007546040805163c22fd76f60e01b81526004810186905290516001600160a01b03909216935063c22fd76f925060248082019260009290919082900301818387803b15801561077e57600080fd5b505af1158015610792573d6000803e3d6000fd5b50505050600083111561087557600554600754604080516340c10f1960e01b81526001600160a01b03928316600482015260248101879052905191909216916340c10f1991604480830192600092919082900301818387803b1580156107f757600080fd5b505af115801561080b573d6000803e3d6000fd5b50506007546040805163335f050760e21b81526004810188905290516001600160a01b03909216935063cd7c141c925060248082019260009290919082900301818387803b15801561085c57600080fd5b505af1158015610870573d6000803e3d6000fd5b505050505b600554600854604080516340c10f1960e01b81526001600160a01b03928316600482015260248101869052905191909216916340c10f1991604480830192600092919082900301818387803b1580156108cd57600080fd5b505af11580156108e1573d6000803e3d6000fd5b505060085460408051632340ac4b60e21b81526004810187905290516001600160a01b039092169350638d02b12c925060248082019260009290919082900301818387803b15801561093257600080fd5b505af1158015610946573d6000803e3d6000fd5b5050600654600354604080516303eb4ad560e31b8152600481018b90526024810192909252336044830152516001600160a01b039092169350631f5a56a8925060648082019260009290919082900301818387803b1580156109a757600080fd5b505af11580156109bb573d6000803e3d6000fd5b5050336000908152600a602052604090208a90555050600b546109e4908963ffffffff61101216565b600b55600d546109fb90600163ffffffff61101216565b600d55610a06610b41565b6040805187815260208101859052815133927fe49649ad7d04a14b0d2a43dae89f207c0822143ff6f88a6480e88907e4e5c548928290030190a36001955050505050505b92915050565b60009081526020819052604090206002015490565b600082815260208190526040902060020154610a8890610a8361106a565b610d32565b610ac35760405162461bcd60e51b815260040180806020018281038252602f815260200180611629602f913960400191505060405180910390fd5b610acd828261106e565b5050565b610ad961106a565b6001600160a01b0316816001600160a01b031614610b285760405162461bcd60e51b815260040180806020018281038252602f815260200180611721602f913960400191505060405180910390fd5b610acd82826110dd565b6005546001600160a01b031681565b6000610b6a600254610b5e60015442610f7790919063ffffffff16565b9063ffffffff610f3816565b905090565b6006546001600160a01b031681565b6008546001600160a01b031681565b6009546001600160a01b031681565b604080516a5345545445525f524f4c4560a81b8152905190819003600b019020610bc890610a8361106a565b610c12576040805162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba10309039b2ba3a32b960511b604482015290519081900360640190fd5b600980546001600160a01b03808d166001600160a01b0319928316179092554260015560028b905560038a905560048990556005805489841690831617905560068054878416908316179055600780548884169083161790556008805492861692909116919091179055600c829055600e819055604080516a5345545445525f524f4c4560a81b8152905190819003600b019020610cb790610cb261106a565b610ad1565b50505050505050505050565b604080516020808201949094526001600160a01b03929092168282015280518083038201815260609092019052805191012090565b600d5490565b6007546001600160a01b031681565b6000828152602081905260408120610d2b908363ffffffff61114c16565b9392505050565b6000828152602081905260408120610d2b908363ffffffff61115816565b6000808215610d8f576000806000610d6786610ea7565b919450925090506000610d80838363ffffffff61101216565b939550929350610d9692505050565b5060009050805b915091565b604080516a5345545445525f524f4c4560a81b8152905190819003600b01902081565b600081565b60025481565b600c5490565b60045481565b600b5490565b60015481565b60035481565b600e5490565b600a6020526000908152604090205481565b6000818152602081905260408120610a4a9061116d565b600082815260208190526040902060020154610e3490610a8361106a565b610b285760405162461bcd60e51b815260040180806020018281038252603081526020018061167a6030913960400191505060405180910390fd5b600080610e7c8433610cc3565b6009549091506001600160a01b0316610e958285611178565b6001600160a01b031614949350505050565b60008060008060009050600454851115610ed757600454610ecf90869063ffffffff610f7716565b905060045494505b6000610ee1610b41565b905060006003548211610ef45781610ef8565b6003545b90506000610f15600354610b5e848b610fb990919063ffffffff16565b90506000610f29898363ffffffff610f7716565b99919850939650945050505050565b6000610d2b83836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b815250611350565b6000610d2b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113f2565b600082610fc857506000610a4a565b82820282848281610fd557fe5b0414610d2b5760405162461bcd60e51b81526004018080602001828103825260218152602001806116cc6021913960400191505060405180910390fd5b600082820183811015610d2b576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b3390565b600082815260208190526040902061108c908263ffffffff61144c16565b15610acd5761109961106a565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020819052604090206110fb908263ffffffff61146116565b15610acd5761110861106a565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000610d2b8383611476565b6000610d2b836001600160a01b0384166114da565b6000610a4a826114f2565b600081516041146111d0576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a6fa2a8918ca85bafe22016d0b997e4df60600160ff1b038211156112375760405162461bcd60e51b81526004018080602001828103825260228152602001806116586022913960400191505060405180910390fd5b8060ff16601b1415801561124f57508060ff16601c14155b1561128b5760405162461bcd60e51b81526004018080602001828103825260228152602001806116aa6022913960400191505060405180910390fd5b60408051600080825260208083018085528a905260ff85168385015260608301879052608083018690529251909260019260a080820193601f1981019281900390910190855afa1580156112e3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611346576040805162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015290519081900360640190fd5b9695505050505050565b600081836113dc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113a1578181015183820152602001611389565b50505050905090810190601f1680156113ce5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816113e857fe5b0495945050505050565b600081848411156114445760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156113a1578181015183820152602001611389565b505050900390565b6000610d2b836001600160a01b0384166114f6565b6000610d2b836001600160a01b038416611540565b815460009082106114b85760405162461bcd60e51b81526004018080602001828103825260228152602001806116076022913960400191505060405180910390fd5b8260000182815481106114c757fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b600061150283836114da565b61153857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a4a565b506000610a4a565b600081815260018301602052604081205480156115fc578354600019808301919081019060009087908390811061157357fe5b906000526020600020015490508087600001848154811061159057fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806115c057fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610a4a565b6000915050610a4a56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545434453413a20696e76616c6964207369676e6174757265202776272076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77434c41494d3a2063616e6e6f7420636c61696d2062656361757365207369676e6174757265206973206e6f7420636f7272656374416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220adbf32ac5b189044b557fe27edda7c40017a8d36e73ad8eba2d9e9c5840e9c7064736f6c63430006060033000000000000000000000000b9a69698a9f0e924d99337e9d7d6fdbe3151dbcf
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061015f5760003560e01c806314eb55d414610164578063248a9ca3146102235780632f2ff15d1461025257806336568abe146102805780633fc15f15146102ac5780634bc2e48d146102d05780634cf088d9146102d857806353b67363146102e05780635b7633d0146102e857806368fc7f33146102f0578063745f6a00146103595780637531d1b2146103855780637d9f6db51461038d5780639010d07c1461039557806391d14854146103b85780639304b780146103e4578063a2011b3f1461041a578063a217fddf14610422578063a2e6f9bf1461042a578063ae73bc2614610432578063aeef64391461043a578063b93563a114610442578063be9a65551461044a578063c1699a9914610452578063c871a0921461045a578063c8de1d5614610462578063ca15c87314610488578063d547741f146104a5578063e57deb39146104d1575b600080fd5b61020f6004803603604081101561017a57600080fd5b81359190810190604081016020820135600160201b81111561019b57600080fd5b8201836020820111156101ad57600080fd5b803590602001918460018302840111600160201b831117156101ce57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061057c945050505050565b604080519115158252519081900360200190f35b6102406004803603602081101561023957600080fd5b5035610a50565b60408051918252519081900360200190f35b61027e6004803603604081101561026857600080fd5b50803590602001356001600160a01b0316610a65565b005b61027e6004803603604081101561029657600080fd5b50803590602001356001600160a01b0316610ad1565b6102b4610b32565b604080516001600160a01b039092168252519081900360200190f35b610240610b41565b6102b4610b6f565b6102b4610b7e565b6102b4610b8d565b61027e600480360361014081101561030757600080fd5b506001600160a01b038135811691602081013591604082013591606081013591608082013581169160a081013582169160c082013581169160e081013590911690610100810135906101200135610b9c565b6102406004803603604081101561036f57600080fd5b50803590602001356001600160a01b0316610cc3565b610240610cf8565b6102b4610cfe565b6102b4600480360360408110156103ab57600080fd5b5080359060200135610d0d565b61020f600480360360408110156103ce57600080fd5b50803590602001356001600160a01b0316610d32565b610401600480360360208110156103fa57600080fd5b5035610d50565b6040805192835260208301919091528051918290030190f35b610240610d9b565b610240610dbe565b610240610dc3565b610240610dc9565b610240610dcf565b610240610dd5565b610240610ddb565b610240610de1565b610240610de7565b6102406004803603602081101561047857600080fd5b50356001600160a01b0316610ded565b6102406004803603602081101561049e57600080fd5b5035610dff565b61027e600480360360408110156104bb57600080fd5b50803590602001356001600160a01b0316610e16565b61020f600480360360408110156104e757600080fd5b81359190810190604081016020820135600160201b81111561050857600080fd5b82018360208201111561051a57600080fd5b803590602001918460018302840111600160201b8311171561053b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610e6f945050505050565b60008083116105c7576040805162461bcd60e51b81526020600482015260126024820152710434c41494d3a20616d6f756e74203c3d20360741b604482015290519081900360640190fd5b6105d18383610e6f565b61060c5760405162461bcd60e51b81526004018080602001828103825260348152602001806116ed6034913960400191505060405180910390fd5b336000908152600a60205260409020541561066a576040805162461bcd60e51b8152602060048201526019602482015278434c41494d3a2063616e6e6f7420636c61696d20747769636560381b604482015290519081900360640190fd5b600080600061067886610ea7565b925092509250600061069560035484610f3890919063ffffffff16565b905060006106bf6106b26001600354610f7790919063ffffffff16565b839063ffffffff610fb916565b600554600754604080516340c10f1960e01b81526001600160a01b0392831660048201526024810185905290519394509116916340c10f199160448082019260009290919082900301818387803b15801561071957600080fd5b505af115801561072d573d6000803e3d6000fd5b50506007546040805163c22fd76f60e01b81526004810186905290516001600160a01b03909216935063c22fd76f925060248082019260009290919082900301818387803b15801561077e57600080fd5b505af1158015610792573d6000803e3d6000fd5b50505050600083111561087557600554600754604080516340c10f1960e01b81526001600160a01b03928316600482015260248101879052905191909216916340c10f1991604480830192600092919082900301818387803b1580156107f757600080fd5b505af115801561080b573d6000803e3d6000fd5b50506007546040805163335f050760e21b81526004810188905290516001600160a01b03909216935063cd7c141c925060248082019260009290919082900301818387803b15801561085c57600080fd5b505af1158015610870573d6000803e3d6000fd5b505050505b600554600854604080516340c10f1960e01b81526001600160a01b03928316600482015260248101869052905191909216916340c10f1991604480830192600092919082900301818387803b1580156108cd57600080fd5b505af11580156108e1573d6000803e3d6000fd5b505060085460408051632340ac4b60e21b81526004810187905290516001600160a01b039092169350638d02b12c925060248082019260009290919082900301818387803b15801561093257600080fd5b505af1158015610946573d6000803e3d6000fd5b5050600654600354604080516303eb4ad560e31b8152600481018b90526024810192909252336044830152516001600160a01b039092169350631f5a56a8925060648082019260009290919082900301818387803b1580156109a757600080fd5b505af11580156109bb573d6000803e3d6000fd5b5050336000908152600a602052604090208a90555050600b546109e4908963ffffffff61101216565b600b55600d546109fb90600163ffffffff61101216565b600d55610a06610b41565b6040805187815260208101859052815133927fe49649ad7d04a14b0d2a43dae89f207c0822143ff6f88a6480e88907e4e5c548928290030190a36001955050505050505b92915050565b60009081526020819052604090206002015490565b600082815260208190526040902060020154610a8890610a8361106a565b610d32565b610ac35760405162461bcd60e51b815260040180806020018281038252602f815260200180611629602f913960400191505060405180910390fd5b610acd828261106e565b5050565b610ad961106a565b6001600160a01b0316816001600160a01b031614610b285760405162461bcd60e51b815260040180806020018281038252602f815260200180611721602f913960400191505060405180910390fd5b610acd82826110dd565b6005546001600160a01b031681565b6000610b6a600254610b5e60015442610f7790919063ffffffff16565b9063ffffffff610f3816565b905090565b6006546001600160a01b031681565b6008546001600160a01b031681565b6009546001600160a01b031681565b604080516a5345545445525f524f4c4560a81b8152905190819003600b019020610bc890610a8361106a565b610c12576040805162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba10309039b2ba3a32b960511b604482015290519081900360640190fd5b600980546001600160a01b03808d166001600160a01b0319928316179092554260015560028b905560038a905560048990556005805489841690831617905560068054878416908316179055600780548884169083161790556008805492861692909116919091179055600c829055600e819055604080516a5345545445525f524f4c4560a81b8152905190819003600b019020610cb790610cb261106a565b610ad1565b50505050505050505050565b604080516020808201949094526001600160a01b03929092168282015280518083038201815260609092019052805191012090565b600d5490565b6007546001600160a01b031681565b6000828152602081905260408120610d2b908363ffffffff61114c16565b9392505050565b6000828152602081905260408120610d2b908363ffffffff61115816565b6000808215610d8f576000806000610d6786610ea7565b919450925090506000610d80838363ffffffff61101216565b939550929350610d9692505050565b5060009050805b915091565b604080516a5345545445525f524f4c4560a81b8152905190819003600b01902081565b600081565b60025481565b600c5490565b60045481565b600b5490565b60015481565b60035481565b600e5490565b600a6020526000908152604090205481565b6000818152602081905260408120610a4a9061116d565b600082815260208190526040902060020154610e3490610a8361106a565b610b285760405162461bcd60e51b815260040180806020018281038252603081526020018061167a6030913960400191505060405180910390fd5b600080610e7c8433610cc3565b6009549091506001600160a01b0316610e958285611178565b6001600160a01b031614949350505050565b60008060008060009050600454851115610ed757600454610ecf90869063ffffffff610f7716565b905060045494505b6000610ee1610b41565b905060006003548211610ef45781610ef8565b6003545b90506000610f15600354610b5e848b610fb990919063ffffffff16565b90506000610f29898363ffffffff610f7716565b99919850939650945050505050565b6000610d2b83836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b815250611350565b6000610d2b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113f2565b600082610fc857506000610a4a565b82820282848281610fd557fe5b0414610d2b5760405162461bcd60e51b81526004018080602001828103825260218152602001806116cc6021913960400191505060405180910390fd5b600082820183811015610d2b576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b3390565b600082815260208190526040902061108c908263ffffffff61144c16565b15610acd5761109961106a565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020819052604090206110fb908263ffffffff61146116565b15610acd5761110861106a565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000610d2b8383611476565b6000610d2b836001600160a01b0384166114da565b6000610a4a826114f2565b600081516041146111d0576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a6fa2a8918ca85bafe22016d0b997e4df60600160ff1b038211156112375760405162461bcd60e51b81526004018080602001828103825260228152602001806116586022913960400191505060405180910390fd5b8060ff16601b1415801561124f57508060ff16601c14155b1561128b5760405162461bcd60e51b81526004018080602001828103825260228152602001806116aa6022913960400191505060405180910390fd5b60408051600080825260208083018085528a905260ff85168385015260608301879052608083018690529251909260019260a080820193601f1981019281900390910190855afa1580156112e3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611346576040805162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015290519081900360640190fd5b9695505050505050565b600081836113dc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113a1578181015183820152602001611389565b50505050905090810190601f1680156113ce5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816113e857fe5b0495945050505050565b600081848411156114445760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156113a1578181015183820152602001611389565b505050900390565b6000610d2b836001600160a01b0384166114f6565b6000610d2b836001600160a01b038416611540565b815460009082106114b85760405162461bcd60e51b81526004018080602001828103825260228152602001806116076022913960400191505060405180910390fd5b8260000182815481106114c757fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b600061150283836114da565b61153857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610a4a565b506000610a4a565b600081815260018301602052604081205480156115fc578354600019808301919081019060009087908390811061157357fe5b906000526020600020015490508087600001848154811061159057fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806115c057fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610a4a565b6000915050610a4a56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545434453413a20696e76616c6964207369676e6174757265202776272076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77434c41494d3a2063616e6e6f7420636c61696d2062656361757365207369676e6174757265206973206e6f7420636f7272656374416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a2646970667358221220adbf32ac5b189044b557fe27edda7c40017a8d36e73ad8eba2d9e9c5840e9c7064736f6c63430006060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b9a69698a9f0e924d99337e9d7d6fdbe3151dbcf
-----Decoded View---------------
Arg [0] : _setter (address): 0xB9a69698A9f0E924d99337E9d7D6fDbe3151DbCf
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b9a69698a9f0e924d99337e9d7d6fdbe3151dbcf
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.