Contract Overview
Balance:
0 Ether
More Info
My Name Tag:
Not Available
Txn Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x63aceb859a58546b9dd4491d447c8a4551943f0839a62c00fc7eae19c5a112b8 | 0x60806040 | 12189677 | 81 days 5 hrs ago | 0x2eb1ac02d44841785cd4e5d5bf17414680ab08c2 | IN | Create: PhantasmaMigrator | 0 Ether | 0.00393445 |
[ Download CSV Export ]
Latest 5 internal transactions
Parent Txn Hash | Block | From | To | Value | |||
---|---|---|---|---|---|---|---|
0x13f0e7ac24bc15ea2a9f643d9fcb6ec64d6ffb802da89aa950bdb299b57ddbec | 12219961 | 67 days 11 hrs ago | 0x8066338625170e600ec272351e3b300571e4d9ad | 0xe84084d5f9cdf1d02a32c6bcc3d20a72c083efc6 | 0 Ether | ||
0xe4bca789b81699102c6c3babfd4c4cd3f95d4b71966fc1db30b4d38047e39e97 | 12219960 | 67 days 11 hrs ago | 0x8066338625170e600ec272351e3b300571e4d9ad | 0xe84084d5f9cdf1d02a32c6bcc3d20a72c083efc6 | 0 Ether | ||
0x1014d3da7a32e7714afde749381008228c8d49f811181a696165495b8d89c0ee | 12219959 | 67 days 12 hrs ago | 0x8066338625170e600ec272351e3b300571e4d9ad | 0xe84084d5f9cdf1d02a32c6bcc3d20a72c083efc6 | 0 Ether | ||
0xa2c756ea2c425a55a51af13d13962f5e04bba5c8864706096f6027d3b7c12e03 | 12219949 | 67 days 12 hrs ago | 0x8066338625170e600ec272351e3b300571e4d9ad | 0xe84084d5f9cdf1d02a32c6bcc3d20a72c083efc6 | 0 Ether | ||
0x0f9582679dfdefbf32f4370ddf8c6c8ed9210291fe2c3aa05fb8fc8fbf6af72d | 12189680 | 81 days 5 hrs ago | 0x8066338625170e600ec272351e3b300571e4d9ad | 0xe84084d5f9cdf1d02a32c6bcc3d20a72c083efc6 | 0 Ether |
[ Download CSV Export ]
Contract Name:
PhantasmaMigrator
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^ 0.8.4; //----Important Imports----// import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; //----End Important Imports----// //Create Contract That Is Ownable, Pausable, And Has ReentrancyGuard For Security Purposes contract PhantasmaMigrator is Initializable, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable { //----Initializers and Globals----// //Keeping That Math Safe using SafeMathUpgradeable for uint; //User Balance Storage Struct struct UserAccount{ uint soulBalance; uint kcalBalance; } //Mapping Between Address And User Balance Struct mapping(address => UserAccount) public claimableBalance; //Useful Metrics For Debt uint public totalUnclaimedSOUL; uint public totalUnclaimedKCAL; //Previous ERC20 Contracts IERC20Upgradeable public addressSOUL; IERC20Upgradeable public addressKCAL; //Easy Identifiers enum TokenType{ SOUL, KCAL } enum MathOperation{ Addition, Deduction} //Main Initializer function initialize() public initializer { __Ownable_init_unchained(); __Pausable_init_unchained(); __ReentrancyGuard_init_unchained(); } //----End Initializers and Globals----// //----Administrator Functions----// //Sets The Balance For A Single Token Using Address Arrays function batchUpload(TokenType _token, address[] calldata _addressList, uint[] calldata _tokenAmount) public onlyOwner returns (bool){ //Checks if Amount Array Length equals Address Array Length *Important require(_addressList.length == _tokenAmount.length, "Array Missmatch"); for (uint i = 0; i < _addressList.length; i++) { //Checks For Duplicate Additions require((claimableBalance[msg.sender].soulBalance == 0) || (claimableBalance[msg.sender].kcalBalance == 0), "Data Already Given For Address"); //Sets The Address Balance For Specified Token require(_modifyBalance(_token, MathOperation.Addition, _addressList[i], _tokenAmount[i]), "Math Failed"); } return true; } //Sets Global ERC20 Token Variables So Contract Can Transfer Tokens function setTokenContracts(IERC20Upgradeable _contractSOUL, IERC20Upgradeable _contractKCAL) public onlyOwner returns (bool){ addressSOUL = _contractSOUL; addressKCAL = _contractKCAL; return true; } //Allows Owner To Toggle Contract Pause function togglePause() public onlyOwner returns (bool){ if(paused() == false){ _pause(); }else{ _unpause(); } return true; } //----End Administrator Functions----// //----User Functions----// //Allows User To Claim Thier Rightful Balance function claimTokens() public whenNotPaused nonReentrant returns (bool){ //Require That There Is A Balance To Be Claimed require((claimableBalance[msg.sender].soulBalance > 0) || (claimableBalance[msg.sender].kcalBalance > 0), "No Balance To Claim"); //Claims Tokens require(_claimTokens(msg.sender) == true, "Token Claim Failed"); return true; } //----End User Functions----// //----Internal Helper Functions----// function _modifyBalance(TokenType _token, MathOperation _operation, address _userAddress, uint _tokenAmount) private returns (bool){ //Adding To Balance if(_operation == MathOperation.Addition){ //Adding To SOUL Balance if(_token == TokenType.SOUL){ //Increase Account Balance claimableBalance[_userAddress].soulBalance = claimableBalance[_userAddress].soulBalance.add(_tokenAmount); //Increase Unclaimed Debt Value totalUnclaimedSOUL = totalUnclaimedSOUL.add(_tokenAmount); return true; //Adding To KCAL Balance } else if(_token == TokenType.KCAL){ //Increase Account Balance claimableBalance[_userAddress].kcalBalance = claimableBalance[_userAddress].kcalBalance.add(_tokenAmount); //Increase Unclaimed Debt Value totalUnclaimedKCAL = totalUnclaimedKCAL.add(_tokenAmount); return true; } return false; //Subtracting From Balance } else if(_operation == MathOperation.Deduction){ //Subtracting SOUL Balance if(_token == TokenType.SOUL){ //Check If User has Enough Balance To Deduct Amount require(claimableBalance[_userAddress].soulBalance >= _tokenAmount, "Too much to Deduct"); //Check If This Makes Sense Compared To Unclaimed Metric require(totalUnclaimedSOUL >= _tokenAmount, "Not Enough Unclaimed"); //Subtract From Unclaimed Debt Value totalUnclaimedSOUL = totalUnclaimedSOUL.sub(_tokenAmount); //Safe Subtract From User Balance claimableBalance[_userAddress].soulBalance = claimableBalance[_userAddress].soulBalance.sub(_tokenAmount); return true; //Subtracting KCAL Balance } else if(_token == TokenType.KCAL){ //Check If User has Enough Balance To Deduct Amount require(claimableBalance[_userAddress].kcalBalance >= _tokenAmount, "Too much to Deduct"); //Check If This Makes Sense Compared To Unclaimed Metric require(totalUnclaimedKCAL >= _tokenAmount, "Not Enough Unclaimed"); //Subtract From Unclaimed Debt Value totalUnclaimedKCAL = totalUnclaimedKCAL.sub(_tokenAmount); //Safe Subtract From User Balance claimableBalance[_userAddress].kcalBalance = claimableBalance[_userAddress].kcalBalance.sub(_tokenAmount); return true; } return false; } return false; } function _claimTokens(address _userAddress) private returns (bool){ //If There Is Claimable SOUL if(claimableBalance[_userAddress].soulBalance > 0){ //Sets Temp Value uint tempBalance = claimableBalance[_userAddress].soulBalance; //Requires That There Is Enough SOUL ERC-20 Balance In Smart Contract require(addressSOUL.balanceOf(address(this)) >= totalUnclaimedSOUL, "Not Enough Balance"); //Requires That Transaction Makes Sense require(totalUnclaimedSOUL >= tempBalance, "Not Enough Unclaimed"); //Modifies User Balance require(_modifyBalance(TokenType.SOUL, MathOperation.Deduction, _userAddress, tempBalance), "Math Failed"); //Logs Transaction emit TokenClaim(msg.sender, "SOUL", tempBalance); //Transfers ERC-20 Safely SafeERC20Upgradeable.safeTransfer(addressSOUL, _userAddress, tempBalance); } //If There Is Claimable KCAL if(claimableBalance[_userAddress].kcalBalance > 0){ //Sets Temp Value uint tempBalance = claimableBalance[_userAddress].kcalBalance; //Requires That There Is Enough KCAL ERC-20 Balance In Smart Contract require(addressKCAL.balanceOf(address(this)) >= totalUnclaimedKCAL, "Not Enough Balance"); //Requires That Transaction Makes Sense require(totalUnclaimedKCAL >= tempBalance, "Not Enough Unclaimed"); //Modifies User Balance require(_modifyBalance(TokenType.KCAL, MathOperation.Deduction, _userAddress, tempBalance), "Math Failed"); //Logs Transaction emit TokenClaim(msg.sender, "KCAL", tempBalance); //Transfers ERC-20 Safely SafeERC20Upgradeable.safeTransfer(addressKCAL, _userAddress, tempBalance); } return true; } //----End Internal Helper Functions----// //----Custom Public Events----// event TokenClaim(address indexed _walletAddress, string indexed _tokenName, uint _amount); //----End Custom Public Events----// }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; import "../../../utils/AddressUpgradeable.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20Upgradeable { using AddressUpgradeable for address; function safeTransfer( IERC20Upgradeable token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20Upgradeable token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20Upgradeable token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMathUpgradeable { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); /** * @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); }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_walletAddress","type":"address"},{"indexed":true,"internalType":"string","name":"_tokenName","type":"string"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"TokenClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"addressKCAL","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addressSOUL","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum PhantasmaMigrator.TokenType","name":"_token","type":"uint8"},{"internalType":"address[]","name":"_addressList","type":"address[]"},{"internalType":"uint256[]","name":"_tokenAmount","type":"uint256[]"}],"name":"batchUpload","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimableBalance","outputs":[{"internalType":"uint256","name":"soulBalance","type":"uint256"},{"internalType":"uint256","name":"kcalBalance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Upgradeable","name":"_contractSOUL","type":"address"},{"internalType":"contract IERC20Upgradeable","name":"_contractKCAL","type":"address"}],"name":"setTokenContracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"togglePause","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalUnclaimedKCAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalUnclaimedSOUL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50612edb806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063a2ce230c11610066578063a2ce230c14610218578063c4ae316814610236578063e914b70c14610254578063f2fde38b14610284576100ea565b8063715018a6146101e65780638129fc1c146101f05780638da5cb5b146101fa576100ea565b806348c54b9d116100c857806348c54b9d146101495780635c975abb1461016757806360f3309b146101855780636552a080146101b6576100ea565b80630c06d99a146100ef5780631b879cb31461010d5780634874a4411461012b575b600080fd5b6100f76102a0565b6040516101049190612585565b60405180910390f35b6101156102c6565b6040516101229190612802565b60405180910390f35b6101336102cc565b6040516101409190612802565b60405180910390f35b6101516102d2565b60405161015e919061256a565b60405180910390f35b61016f61049a565b60405161017c919061256a565b60405180910390f35b61019f600480360381019061019a9190612043565b6104b1565b6040516101ad92919061281d565b60405180910390f35b6101d060048036038101906101cb91906120d1565b6104d5565b6040516101dd919061256a565b60405180910390f35b6101ee610774565b005b6101f86107fc565b005b6102026108f8565b60405161020f9190612526565b60405180910390f35b610220610922565b60405161022d9190612585565b60405180910390f35b61023e610948565b60405161024b919061256a565b60405180910390f35b61026e60048036038101906102699190612095565b6109f7565b60405161027b919061256a565b60405180910390f35b61029e60048036038101906102999190612043565b610b01565b005b60cd60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60ca5481565b60cb5481565b60006102dc61049a565b1561031c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610313906126a2565b60405180910390fd5b60026097541415610362576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610359906127e2565b60405180910390fd5b6002609781905550600060c960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015411806103fd5750600060c960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154115b61043c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610433906125e2565b60405180910390fd5b6001151561044933610bf9565b15151461048b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048290612662565b60405180910390fd5b60019050600160978190555090565b6000606560009054906101000a900460ff16905090565b60c96020528060005260406000206000915090508060000154908060010154905082565b60006104df61114a565b73ffffffffffffffffffffffffffffffffffffffff166104fd6108f8565b73ffffffffffffffffffffffffffffffffffffffff1614610553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054a90612742565b60405180910390fd5b82829050858590501461059b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059290612602565b60405180910390fd5b60005b8585905081101561076657600060c960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154148061063c5750600060c960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154145b61067b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067290612702565b60405180910390fd5b6107148760008888858181106106ba577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906106cf9190612043565b878786818110610708577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135611152565b610753576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074a906126e2565b60405180910390fd5b808061075e906129be565b91505061059e565b506001905095945050505050565b61077c61114a565b73ffffffffffffffffffffffffffffffffffffffff1661079a6108f8565b73ffffffffffffffffffffffffffffffffffffffff16146107f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e790612742565b60405180910390fd5b6107fa60006118d5565b565b600060019054906101000a900460ff166108245760008054906101000a900460ff161561082d565b61082c61199b565b5b61086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612722565b60405180910390fd5b60008060019054906101000a900460ff1615905080156108bc576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6108c46119ac565b6108cc611a0d565b6108d4611a79565b80156108f55760008060016101000a81548160ff0219169083151502179055505b50565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60cc60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061095261114a565b73ffffffffffffffffffffffffffffffffffffffff166109706108f8565b73ffffffffffffffffffffffffffffffffffffffff16146109c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109bd90612742565b60405180910390fd5b600015156109d261049a565b151514156109e7576109e2611ad2565b6109f0565b6109ef611b75565b5b6001905090565b6000610a0161114a565b73ffffffffffffffffffffffffffffffffffffffff16610a1f6108f8565b73ffffffffffffffffffffffffffffffffffffffff1614610a75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6c90612742565b60405180910390fd5b8260cc60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160cd60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001905092915050565b610b0961114a565b73ffffffffffffffffffffffffffffffffffffffff16610b276108f8565b73ffffffffffffffffffffffffffffffffffffffff1614610b7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7490612742565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610bed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be490612622565b60405180910390fd5b610bf6816118d5565b50565b60008060c960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541115610e9e57600060c960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154905060ca5460cc60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610cea9190612526565b60206040518083038186803b158015610d0257600080fd5b505afa158015610d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3a919061215a565b1015610d7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7290612642565b60405180910390fd5b8060ca541015610dc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db7906126c2565b60405180910390fd5b610dce600060018584611152565b610e0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e04906126e2565b60405180910390fd5b604051610e1990612511565b60405180910390203373ffffffffffffffffffffffffffffffffffffffff167f290812f98a3cd7434cb6441056b6a4b0d253c365579e91a1c1500c54343f812a83604051610e679190612802565b60405180910390a3610e9c60cc60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168483611c17565b505b600060c960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154111561114157600060c960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905060cb5460cd60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610f8e9190612526565b60206040518083038186803b158015610fa657600080fd5b505afa158015610fba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fde919061215a565b101561101f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101690612642565b60405180910390fd5b8060cb541015611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906126c2565b60405180910390fd5b6110716001808584611152565b6110b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a7906126e2565b60405180910390fd5b6040516110bc906124fc565b60405180910390203373ffffffffffffffffffffffffffffffffffffffff167f290812f98a3cd7434cb6441056b6a4b0d253c365579e91a1c1500c54343f812a8360405161110a9190612802565b60405180910390a361113f60cd60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168483611c17565b505b60019050919050565b600033905090565b600080600181111561118d577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8460018111156111c6577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14156114445760006001811115611206577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b85600181111561123f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14156113045761129a8260c960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611c9d90919063ffffffff16565b60c960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506112f58260ca54611c9d90919063ffffffff16565b60ca81905550600190506118cd565b60018081111561133d577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b856001811115611376577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b141561143b576113d18260c960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154611c9d90919063ffffffff16565b60c960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555061142c8260cb54611c9d90919063ffffffff16565b60cb81905550600190506118cd565b600090506118cd565b60018081111561147d577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8460018111156114b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14156118c857600060018111156114f6577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b85600181111561152f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14156116be578160c960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410156115ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b190612762565b60405180910390fd5b8160ca5410156115ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f6906126c2565b60405180910390fd5b6116148260ca54611cb390919063ffffffff16565b60ca8190555061166f8260c960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611cb390919063ffffffff16565b60c960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190506118cd565b6001808111156116f7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b856001811115611730577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b14156118bf578160c960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410156117bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b290612762565b60405180910390fd5b8160cb541015611800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f7906126c2565b60405180910390fd5b6118158260cb54611cb390919063ffffffff16565b60cb819055506118708260c960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154611cb390919063ffffffff16565b60c960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550600190506118cd565b600090506118cd565b600090505b949350505050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60006119a630611cc9565b15905090565b600060019054906101000a900460ff166119fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f2906127a2565b60405180910390fd5b611a0b611a0661114a565b6118d5565b565b600060019054906101000a900460ff16611a5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a53906127a2565b60405180910390fd5b6000606560006101000a81548160ff021916908315150217905550565b600060019054906101000a900460ff16611ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abf906127a2565b60405180910390fd5b6001609781905550565b611ada61049a565b15611b1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b11906126a2565b60405180910390fd5b6001606560006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611b5e61114a565b604051611b6b9190612526565b60405180910390a1565b611b7d61049a565b611bbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb3906125c2565b60405180910390fd5b6000606560006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611c0061114a565b604051611c0d9190612526565b60405180910390a1565b611c988363a9059cbb60e01b8484604051602401611c36929190612541565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611cec565b505050565b60008183611cab9190612883565b905092915050565b60008183611cc191906128d9565b905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000611d4e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611db39092919063ffffffff16565b9050600081511115611dae5780806020019051810190611d6e919061206c565b611dad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da4906127c2565b60405180910390fd5b5b505050565b6060611dc28484600085611dcb565b90509392505050565b606082471015611e10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0790612682565b60405180910390fd5b611e1985611cc9565b611e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4f90612782565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611e8191906124e5565b60006040518083038185875af1925050503d8060008114611ebe576040519150601f19603f3d011682016040523d82523d6000602084013e611ec3565b606091505b5091509150611ed3828286611edf565b92505050949350505050565b60608315611eef57829050611f3f565b600083511115611f025782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f3691906125a0565b60405180910390fd5b9392505050565b600081359050611f5581612e39565b92915050565b60008083601f840112611f6d57600080fd5b8235905067ffffffffffffffff811115611f8657600080fd5b602083019150836020820283011115611f9e57600080fd5b9250929050565b60008083601f840112611fb757600080fd5b8235905067ffffffffffffffff811115611fd057600080fd5b602083019150836020820283011115611fe857600080fd5b9250929050565b600081519050611ffe81612e50565b92915050565b60008135905061201381612e67565b92915050565b60008135905061202881612e7e565b92915050565b60008151905061203d81612e8e565b92915050565b60006020828403121561205557600080fd5b600061206384828501611f46565b91505092915050565b60006020828403121561207e57600080fd5b600061208c84828501611fef565b91505092915050565b600080604083850312156120a857600080fd5b60006120b685828601612004565b92505060206120c785828601612004565b9150509250929050565b6000806000806000606086880312156120e957600080fd5b60006120f788828901612019565b955050602086013567ffffffffffffffff81111561211457600080fd5b61212088828901611f5b565b9450945050604086013567ffffffffffffffff81111561213f57600080fd5b61214b88828901611fa5565b92509250509295509295909350565b60006020828403121561216c57600080fd5b600061217a8482850161202e565b91505092915050565b61218c8161290d565b82525050565b61219b8161291f565b82525050565b60006121ac82612846565b6121b6818561285c565b93506121c681856020860161298b565b80840191505092915050565b6121db81612967565b82525050565b60006121ec82612851565b6121f68185612867565b935061220681856020860161298b565b61220f81612a36565b840191505092915050565b6000612227601483612867565b915061223282612a47565b602082019050919050565b600061224a601383612867565b915061225582612a70565b602082019050919050565b600061226d600f83612867565b915061227882612a99565b602082019050919050565b6000612290602683612867565b915061229b82612ac2565b604082019050919050565b60006122b3601283612867565b91506122be82612b11565b602082019050919050565b60006122d6600483612878565b91506122e182612b3a565b600482019050919050565b60006122f9601283612867565b915061230482612b63565b602082019050919050565b600061231c602683612867565b915061232782612b8c565b604082019050919050565b600061233f601083612867565b915061234a82612bdb565b602082019050919050565b6000612362601483612867565b915061236d82612c04565b602082019050919050565b6000612385600b83612867565b915061239082612c2d565b602082019050919050565b60006123a8601e83612867565b91506123b382612c56565b602082019050919050565b60006123cb602e83612867565b91506123d682612c7f565b604082019050919050565b60006123ee602083612867565b91506123f982612cce565b602082019050919050565b6000612411601283612867565b915061241c82612cf7565b602082019050919050565b6000612434600483612878565b915061243f82612d20565b600482019050919050565b6000612457601d83612867565b915061246282612d49565b602082019050919050565b600061247a602b83612867565b915061248582612d72565b604082019050919050565b600061249d602a83612867565b91506124a882612dc1565b604082019050919050565b60006124c0601f83612867565b91506124cb82612e10565b602082019050919050565b6124df8161295d565b82525050565b60006124f182846121a1565b915081905092915050565b6000612507826122c9565b9150819050919050565b600061251c82612427565b9150819050919050565b600060208201905061253b6000830184612183565b92915050565b60006040820190506125566000830185612183565b61256360208301846124d6565b9392505050565b600060208201905061257f6000830184612192565b92915050565b600060208201905061259a60008301846121d2565b92915050565b600060208201905081810360008301526125ba81846121e1565b905092915050565b600060208201905081810360008301526125db8161221a565b9050919050565b600060208201905081810360008301526125fb8161223d565b9050919050565b6000602082019050818103600083015261261b81612260565b9050919050565b6000602082019050818103600083015261263b81612283565b9050919050565b6000602082019050818103600083015261265b816122a6565b9050919050565b6000602082019050818103600083015261267b816122ec565b9050919050565b6000602082019050818103600083015261269b8161230f565b9050919050565b600060208201905081810360008301526126bb81612332565b9050919050565b600060208201905081810360008301526126db81612355565b9050919050565b600060208201905081810360008301526126fb81612378565b9050919050565b6000602082019050818103600083015261271b8161239b565b9050919050565b6000602082019050818103600083015261273b816123be565b9050919050565b6000602082019050818103600083015261275b816123e1565b9050919050565b6000602082019050818103600083015261277b81612404565b9050919050565b6000602082019050818103600083015261279b8161244a565b9050919050565b600060208201905081810360008301526127bb8161246d565b9050919050565b600060208201905081810360008301526127db81612490565b9050919050565b600060208201905081810360008301526127fb816124b3565b9050919050565b600060208201905061281760008301846124d6565b92915050565b600060408201905061283260008301856124d6565b61283f60208301846124d6565b9392505050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061288e8261295d565b91506128998361295d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156128ce576128cd612a07565b5b828201905092915050565b60006128e48261295d565b91506128ef8361295d565b92508282101561290257612901612a07565b5b828203905092915050565b60006129188261293d565b9050919050565b60008115159050919050565b60006129368261290d565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061297282612979565b9050919050565b60006129848261293d565b9050919050565b60005b838110156129a957808201518184015260208101905061298e565b838111156129b8576000848401525b50505050565b60006129c98261295d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156129fc576129fb612a07565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b7f4e6f2042616c616e636520546f20436c61696d00000000000000000000000000600082015250565b7f4172726179204d6973736d617463680000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4e6f7420456e6f7567682042616c616e63650000000000000000000000000000600082015250565b7f4b43414c00000000000000000000000000000000000000000000000000000000600082015250565b7f546f6b656e20436c61696d204661696c65640000000000000000000000000000600082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b7f4e6f7420456e6f75676820556e636c61696d6564000000000000000000000000600082015250565b7f4d617468204661696c6564000000000000000000000000000000000000000000600082015250565b7f4461746120416c726561647920476976656e20466f7220416464726573730000600082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f546f6f206d75636820746f204465647563740000000000000000000000000000600082015250565b7f534f554c00000000000000000000000000000000000000000000000000000000600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b612e428161290d565b8114612e4d57600080fd5b50565b612e598161291f565b8114612e6457600080fd5b50565b612e708161292b565b8114612e7b57600080fd5b50565b60028110612e8b57600080fd5b50565b612e978161295d565b8114612ea257600080fd5b5056fea2646970667358221220b47617294637f10da33d9ff53cf39ce60371afeae0539a4a5191b8774fe8e5ca64736f6c63430008040033
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.