Source Code
Latest 25 from a total of 275 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Buy | 12314983 | 1790 days ago | IN | 0.05 ETH | 0.00818775 | ||||
| Buy | 12174482 | 1812 days ago | IN | 1.375 ETH | 0.00637145 | ||||
| Buy | 12174480 | 1812 days ago | IN | 1.375 ETH | 0.00728166 | ||||
| Buy | 12174479 | 1812 days ago | IN | 1.25 ETH | 0.00637145 | ||||
| Buy | 12174478 | 1812 days ago | IN | 0.75 ETH | 0.00637145 | ||||
| Buy | 12174478 | 1812 days ago | IN | 0.75 ETH | 0.00637145 | ||||
| Buy | 12159604 | 1814 days ago | IN | 0.125 ETH | 0.00804625 | ||||
| Buy | 12151277 | 1815 days ago | IN | 5 ETH | 0.00895986 | ||||
| Buy | 12148789 | 1816 days ago | IN | 0.21 ETH | 0.00897742 | ||||
| Buy | 12148665 | 1816 days ago | IN | 0.3 ETH | 0.00707045 | ||||
| Buy | 12148640 | 1816 days ago | IN | 0.15 ETH | 0.00844934 | ||||
| Set Is Frozen | 12148639 | 1816 days ago | IN | 0 ETH | 0.00820207 | ||||
| Buy | 12148638 | 1816 days ago | IN | 0.231 ETH | 0.01109536 | ||||
| Buy | 12148638 | 1816 days ago | IN | 0.231 ETH | 0.0104019 | ||||
| Buy | 12148638 | 1816 days ago | IN | 2.1 ETH | 0.01047487 | ||||
| Buy | 12148634 | 1816 days ago | IN | 0.006 ETH | 0.024622 | ||||
| Buy | 12148624 | 1816 days ago | IN | 0.9 ETH | 0.0182316 | ||||
| Buy | 12148623 | 1816 days ago | IN | 0.003 ETH | 0.02318256 | ||||
| Buy | 12148621 | 1816 days ago | IN | 1.5 ETH | 0.0182316 | ||||
| Buy | 12148621 | 1816 days ago | IN | 0.015 ETH | 0.02522808 | ||||
| Buy | 12148618 | 1816 days ago | IN | 2.997 ETH | 0.030386 | ||||
| Buy | 12148617 | 1816 days ago | IN | 2.997 ETH | 0.02114038 | ||||
| Buy | 12148616 | 1816 days ago | IN | 0.009 ETH | 0.022728 | ||||
| Buy | 12148614 | 1816 days ago | IN | 0.999 ETH | 0.02583825 | ||||
| Buy | 12148611 | 1816 days ago | IN | 6.993 ETH | 0.01944704 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| - | 12148634 | 1816 days ago | 0.006 ETH | ||||
| - | 12148624 | 1816 days ago | 0.9 ETH | ||||
| - | 12148623 | 1816 days ago | 0.003 ETH | ||||
| - | 12148621 | 1816 days ago | 1.5 ETH | ||||
| - | 12148621 | 1816 days ago | 0.015 ETH | ||||
| - | 12148618 | 1816 days ago | 2.997 ETH | ||||
| - | 12148617 | 1816 days ago | 2.997 ETH | ||||
| - | 12148616 | 1816 days ago | 0.009 ETH | ||||
| - | 12148614 | 1816 days ago | 0.999 ETH | ||||
| - | 12148611 | 1816 days ago | 6.993 ETH | ||||
| - | 12148608 | 1816 days ago | 6 ETH | ||||
| - | 12148607 | 1816 days ago | 0.45 ETH | ||||
| - | 12148606 | 1816 days ago | 1.8 ETH | ||||
| - | 12148605 | 1816 days ago | 0.009 ETH | ||||
| - | 12148590 | 1816 days ago | 0.024 ETH | ||||
| - | 12148576 | 1816 days ago | 1.8 ETH | ||||
| - | 12148575 | 1816 days ago | 0.24 ETH | ||||
| - | 12148541 | 1816 days ago | 1.635 ETH | ||||
| - | 12148538 | 1816 days ago | 0.999 ETH | ||||
| - | 12148537 | 1816 days ago | 0.999 ETH | ||||
| - | 12148530 | 1816 days ago | 0.3 ETH | ||||
| - | 12148525 | 1816 days ago | 0.003 ETH | ||||
| - | 12148516 | 1816 days ago | 1.89 ETH | ||||
| - | 12148510 | 1816 days ago | 0.45 ETH | ||||
| - | 12148472 | 1816 days ago | 4.995 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
PrivateSale
Compiler Version
v0.7.3+commit.9bfce1f6
Contract Source Code (Solidity Multiple files format)
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
import "./SafeMath.sol";
import "./IERC20.sol";
import "./Context.sol";
import "./ReentrancyGuard.sol";
import "./Ownable.sol";
contract PrivateSale is ReentrancyGuard, Context, Ownable {
using SafeMath for uint256;
constructor (address _gasToken , address payable _holdingAddress, uint256 _price) {
GAS_TOKEN = IERC20(_gasToken);
holdingAddress = _holdingAddress;
isFrozen = false;
price = _price;
}
IERC20 private GAS_TOKEN;
bool private isFrozen;
uint256 public price;
address payable private holdingAddress;
function buy(uint256 amount) public payable nonReentrant { // replaced total with msg.value
require(amount > 0, "Must buy an amount of tokens");
require(msg.value >= amount.mul(price), "insufficient payment");
require(!isFrozen, "contract is frozen");
GAS_TOKEN.transferFrom(holdingAddress, _msgSender(), amount.mul(1e18));
_safeTransfer(holdingAddress, msg.value);
}
function getIsFrozen() public view returns(bool) {
return isFrozen;
}
function setIsFrozen(bool _isFrozen) public onlyOwner {
isFrozen = _isFrozen;
}
function getPrice() public view returns(uint256) {
return price;
}
function setPrice(uint256 _price) public onlyOwner {
price = _price;
}
function _safeTransfer(address payable to, uint256 amount) internal {
uint256 balance;
balance = address(this).balance;
if (amount > balance) {
amount = balance;
}
Address.sendValue(to, amount);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
/**
* @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.7.3;
/*
* @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.7.3;
interface IERC1155 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data) external;
function mint(address to, uint256 id, uint256 amount) external;
}
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
import "./IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
interface IERC1155Receiver {
/**
@dev Handles the receipt of a single ERC1155 token type. This function is
called at the end of a `safeTransferFrom` after the balance has been updated.
To accept the transfer, this must return
`bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
(i.e. 0xf23a6e61, or its own function selector).
@param operator The address which initiated the transfer (i.e. msg.sender)
@param from The address which previously owned the token
@param id The ID of the token being transferred
@param value The amount of tokens being transferred
@param data Additional data with no specified format
@return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
)
external
returns(bytes4);
/**
@dev Handles the receipt of a multiple ERC1155 token types. This function
is called at the end of a `safeBatchTransferFrom` after the balances have
been updated. To accept the transfer(s), this must return
`bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
(i.e. 0xbc197c81, or its own function selector).
@param operator The address which initiated the batch transfer (i.e. msg.sender)
@param from The address which previously owned the token
@param ids An array containing ids of each token being transferred (order and length must match values array)
@param values An array containing amounts of each token being transferred (order and length must match ids array)
@param data Additional data with no specified format
@return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
)
external
returns(bytes4);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
import "./Address.sol";
/**
* @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);
function mint(address to, uint256 amount) external;
function burn(uint256 amount) external;
}
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
import "./Context.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 Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view 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 {
emit OwnershipTransferred(_owner, address(0));
_owner = 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");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
/**
* @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 ReentrancyGuard {
// 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;
constructor () {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
/**
* @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.7.3;
import "./Context.sol";
import "./IERC20.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
import "./ReentrancyGuard.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract StockToken is Context, ReentrancyGuard, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 public _totalSupply;
string public _name;
string public _symbol;
uint8 public _decimals;
address[] public minters;
// mapping (address => bool) public whitelist;
// bool public isWhitelistEnabled;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_decimals = 18;
}
function getMinters() public view returns(address[] memory) {
return minters;
}
function addMinter(address _minter) public onlyOwner {
require(!isMinter(_minter), "Address is already a minter");
minters.push(_minter);
}
function removeMinter(address _minter) public onlyOwner {
require(isMinter(_minter), "Address is not a minter") ;
for (uint i = 0; i < minters.length; i++) {
if (minters[i] == _minter) {
minters[i] = minters[minters.length - 1];
minters.pop();
return;
}
}
}
function isMinter(address _minter)public view returns (bool result) {
for (uint i = 0; i < minters.length; i++) {
if (minters[i] == _minter) {
return true;
}
}
return false;
}
// function getIsWhitelistEnabled() public view returns (bool) {
// return isWhitelistEnabled;
// }
// function setIsWhitelistEnabled(bool value) public onlyOwner nonReentrant {
// isWhitelistEnabled = value;
// }
// function isWhitelisted(address _addr) public view returns (bool) {
// return whitelist[_addr];
// }
// function addToWhitelist(address _addr) public onlyOwner nonReentrant {
// whitelist[_addr] = true;
// }
// function removeFromWhitelist(address _addr) public onlyOwner nonReentrant {
// if (whitelist[_addr]) {
// delete whitelist[_addr];
// }
// }
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override nonReentrant returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public override nonReentrant returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override nonReentrant returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual nonReentrant returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual nonReentrant returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function mint(address to, uint256 amount) public override nonReentrant {
require(isMinter(_msgSender()), "Only minter can mint");
_mint(to, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function burn(uint256 amount) public override nonReentrant {
require(amount <= balanceOf(_msgSender()), "Burn more than balance");
_burn(_msgSender(), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
// SPDX-License-Identifier: MIT
pragma solidity 0.7.3;
import "./SafeMath.sol";
import "./IERC20.sol";
import "./Context.sol";
import "./ReentrancyGuard.sol";
import "./Ownable.sol";
contract WStock3 is ReentrancyGuard, Context, Ownable {
using SafeMath for uint256;
constructor (address _gasToken ,address _authAddress, address payable _holdingAddress, uint256 _feeRate, uint256 _acceptableTolerance, uint256 _reserve) {
GAS_TOKEN = IERC20(_gasToken);
authAddress = _authAddress;
holdingAddress = _holdingAddress;
feeRate = _feeRate;
acceptableTolerance = _acceptableTolerance;
reserve = _reserve;
}
modifier onlyAuthorized() {
require(authAddress == _msgSender(), "Unauthorized usage");
_;
}
IERC20 private GAS_TOKEN;
mapping(bytes32 => IERC20) public stocks;
address private authAddress;
address payable private holdingAddress;
uint256 private feeRate;
uint256 private acceptableTolerance;
uint256 private reserve;
uint256 public totalTrades;
event Trade(uint256 indexed tradeId, address account, bytes32 ticker, bool isBuy, uint256 amount, uint256 total, uint256 fee);
event Reload(uint256 indexed amount, uint256 timestamp);
function buy(bytes32 ticker, uint256 amount, uint256 timestamp, uint8 v, bytes32 r, bytes32 s) public payable nonReentrant { // replaced total with msg.value
require(amount > 0, "Must buy an amount of tokens");
require(msg.value > 0, "total must be greater than zero");
bytes32 hash = keccak256(abi.encode(_msgSender(), ticker, amount, msg.value, timestamp));
address signer = ecrecover(hash, v, r, s);
require(signer == authAddress, "Invalid signature");
require(timestamp.add(acceptableTolerance) > block.timestamp, "Expired Order");
require(address(stocks[ticker]) != address(0), "unsupported asset");
uint256 fee = msg.value.mul(feeRate);
require(fee <= GAS_TOKEN.balanceOf(_msgSender()), 'insufficient gas token balance');
totalTrades++;
emit Trade(totalTrades, _msgSender(), ticker, true, amount, msg.value, fee);
stocks[ticker].mint(_msgSender(), amount);
GAS_TOKEN.transferFrom(_msgSender(), holdingAddress, fee);
if (address(this).balance >= reserve) {
_safeTransfer(holdingAddress, msg.value);
}
else {
emit Reload(reserve.sub(address(this).balance), block.timestamp);
}
}
function sell(bytes32 ticker, uint256 amount, uint256 total, uint256 timestamp, uint8 v, bytes32 r, bytes32 s) public nonReentrant {
require(amount > 0, "Must select an amount of tokens");
require(total > 0, "total must be greater than zero");
require(amount <= stocks[ticker].balanceOf(_msgSender()), "Cannot sell more than balance");
bytes32 hash = keccak256(abi.encode(_msgSender(), ticker, amount, total, timestamp));
address signer = ecrecover(hash, v, r, s);
require(signer == authAddress, "Invalid signature");
require(timestamp.add(acceptableTolerance) > block.timestamp, "Expired Order");
require(total <= address(this).balance, "insufficient funds, try again later");
require(address(stocks[ticker]) != address(0), "unsupported asset");
uint256 fee = total.mul(feeRate);
require(fee <= GAS_TOKEN.balanceOf(_msgSender()), 'insufficient gas token balance');
totalTrades++;
emit Trade(totalTrades, _msgSender(), ticker, false, amount, total, fee);
stocks[ticker].transferFrom(_msgSender(), address(this), amount);
stocks[ticker].burn(amount);
GAS_TOKEN.transferFrom(_msgSender(), holdingAddress, fee);
_safeTransfer(_msgSender(), total);
if (address(this).balance < reserve) {
emit Reload(reserve.sub(address(this).balance), block.timestamp);
}
}
function addStock(bytes32 _ticker, IERC20 _asset) public onlyAuthorized {
stocks[_ticker] = _asset;
}
function getReserve() public view returns(uint256) {
return reserve;
}
function setReserve(uint256 _reserve) public payable onlyAuthorized {
reserve = _reserve;
}
function getAuthAddress() public view returns (address) {
return authAddress;
}
function setAuthAddress(address payable _authAddress) public onlyAuthorized {
authAddress = _authAddress;
}
function getFeeRate() public view returns (uint256) {
return feeRate;
}
function setFeeRate(uint256 _feeRate) public onlyAuthorized {
feeRate = _feeRate;
}
function getAcceptableTolerance() public view returns(uint256) {
return acceptableTolerance;
}
function setAcceptableTolerance(uint256 _acceptableTolerance) public onlyAuthorized {
acceptableTolerance = _acceptableTolerance;
}
function _safeTransfer(address payable to, uint256 amount) internal {
uint256 balance;
balance = address(this).balance;
if (amount > balance) {
amount = balance;
}
Address.sendValue(to, amount);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_gasToken","type":"address"},{"internalType":"address payable","name":"_holdingAddress","type":"address"},{"internalType":"uint256","name":"_price","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getIsFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isFrozen","type":"bool"}],"name":"setIsFrozen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50604051610fe0380380610fe08339818101604052606081101561003357600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050600160008190555060006100706101bb60201b60201c565b905080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35082600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260146101000a81548160ff021916908315150217905550806003819055505050506101c3565b600033905090565b610e0e806101d26000396000f3fe6080604052600436106100865760003560e01c806391b7f5ed1161005957806391b7f5ed1461014d57806398d5fdca14610188578063a035b1fe146101b3578063d96a094a146101de578063f2fde38b1461020c57610086565b8063236fc8ad1461008b57806364eda74b146100b8578063715018a6146100f55780638da5cb5b1461010c575b600080fd5b34801561009757600080fd5b506100a061025d565b60405180821515815260200191505060405180910390f35b3480156100c457600080fd5b506100f3600480360360208110156100db57600080fd5b81019080803515159060200190929190505050610274565b005b34801561010157600080fd5b5061010a61035b565b005b34801561011857600080fd5b506101216104e6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561015957600080fd5b506101866004803603602081101561017057600080fd5b8101908080359060200190929190505050610510565b005b34801561019457600080fd5b5061019d6105e4565b6040518082815260200191505060405180910390f35b3480156101bf57600080fd5b506101c86105ee565b6040518082815260200191505060405180910390f35b61020a600480360360208110156101f457600080fd5b81019080803590602001909291905050506105f4565b005b34801561021857600080fd5b5061025b6004803603602081101561022f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061095f565b005b6000600260149054906101000a900460ff16905090565b61027c610b6f565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461033e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600260146101000a81548160ff02191690831515021790555050565b610363610b6f565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610425576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610518610b6f565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060038190555050565b6000600354905090565b60035481565b6002600054141561066d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002600081905550600081116106eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d7573742062757920616e20616d6f756e74206f6620746f6b656e730000000081525060200191505060405180910390fd5b61070060035482610b7790919063ffffffff16565b341015610775576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f696e73756666696369656e74207061796d656e7400000000000000000000000081525060200191505060405180910390fd5b600260149054906101000a900460ff16156107f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f636f6e74726163742069732066726f7a656e000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610861610b6f565b61087c670de0b6b3a764000086610b7790919063ffffffff16565b6040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156108ec57600080fd5b505af1158015610900573d6000803e3d6000fd5b505050506040513d602081101561091657600080fd5b810190808051906020019092919050505050610954600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1634610bfd565b600160008190555050565b610967610b6f565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a29576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610aaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610d586026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080831415610b8a5760009050610bf7565b6000828402905082848281610b9b57fe5b0414610bf2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610db86021913960400191505060405180910390fd5b809150505b92915050565b600047905080821115610c0e578091505b610c188383610c1d565b505050565b80471015610c93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a20696e73756666696369656e742062616c616e636500000081525060200191505060405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405180600001905060006040518083038185875af1925050503d8060008114610cf3576040519150601f19603f3d011682016040523d82523d6000602084013e610cf8565b606091505b5050905080610d52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180610d7e603a913960400191505060405180910390fd5b50505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220257cd5b64f280f963815c10eb6d3ea94e5d737ca4701a8309c591ea1be46218164736f6c6343000703003300000000000000000000000035b55c25731e9b05b1d8480ba39463d52c9d021100000000000000000000000099e12094c228f550809f20ba196dcc95e6b8faea0000000000000000000000000000000000000000000000000058d15e17628000
Deployed Bytecode
0x6080604052600436106100865760003560e01c806391b7f5ed1161005957806391b7f5ed1461014d57806398d5fdca14610188578063a035b1fe146101b3578063d96a094a146101de578063f2fde38b1461020c57610086565b8063236fc8ad1461008b57806364eda74b146100b8578063715018a6146100f55780638da5cb5b1461010c575b600080fd5b34801561009757600080fd5b506100a061025d565b60405180821515815260200191505060405180910390f35b3480156100c457600080fd5b506100f3600480360360208110156100db57600080fd5b81019080803515159060200190929190505050610274565b005b34801561010157600080fd5b5061010a61035b565b005b34801561011857600080fd5b506101216104e6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561015957600080fd5b506101866004803603602081101561017057600080fd5b8101908080359060200190929190505050610510565b005b34801561019457600080fd5b5061019d6105e4565b6040518082815260200191505060405180910390f35b3480156101bf57600080fd5b506101c86105ee565b6040518082815260200191505060405180910390f35b61020a600480360360208110156101f457600080fd5b81019080803590602001909291905050506105f4565b005b34801561021857600080fd5b5061025b6004803603602081101561022f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061095f565b005b6000600260149054906101000a900460ff16905090565b61027c610b6f565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461033e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600260146101000a81548160ff02191690831515021790555050565b610363610b6f565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610425576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610518610b6f565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060038190555050565b6000600354905090565b60035481565b6002600054141561066d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002600081905550600081116106eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d7573742062757920616e20616d6f756e74206f6620746f6b656e730000000081525060200191505060405180910390fd5b61070060035482610b7790919063ffffffff16565b341015610775576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f696e73756666696369656e74207061796d656e7400000000000000000000000081525060200191505060405180910390fd5b600260149054906101000a900460ff16156107f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f636f6e74726163742069732066726f7a656e000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610861610b6f565b61087c670de0b6b3a764000086610b7790919063ffffffff16565b6040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156108ec57600080fd5b505af1158015610900573d6000803e3d6000fd5b505050506040513d602081101561091657600080fd5b810190808051906020019092919050505050610954600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1634610bfd565b600160008190555050565b610967610b6f565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a29576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610aaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610d586026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080831415610b8a5760009050610bf7565b6000828402905082848281610b9b57fe5b0414610bf2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610db86021913960400191505060405180910390fd5b809150505b92915050565b600047905080821115610c0e578091505b610c188383610c1d565b505050565b80471015610c93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a20696e73756666696369656e742062616c616e636500000081525060200191505060405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405180600001905060006040518083038185875af1925050503d8060008114610cf3576040519150601f19603f3d011682016040523d82523d6000602084013e610cf8565b606091505b5050905080610d52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180610d7e603a913960400191505060405180910390fd5b50505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220257cd5b64f280f963815c10eb6d3ea94e5d737ca4701a8309c591ea1be46218164736f6c63430007030033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000035b55c25731e9b05b1d8480ba39463d52c9d021100000000000000000000000099e12094c228f550809f20ba196dcc95e6b8faea0000000000000000000000000000000000000000000000000058d15e17628000
-----Decoded View---------------
Arg [0] : _gasToken (address): 0x35b55c25731E9b05B1d8480ba39463d52C9D0211
Arg [1] : _holdingAddress (address): 0x99E12094c228F550809F20Ba196DCc95E6b8faeA
Arg [2] : _price (uint256): 25000000000000000
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000035b55c25731e9b05b1d8480ba39463d52c9d0211
Arg [1] : 00000000000000000000000099e12094c228f550809f20ba196dcc95e6b8faea
Arg [2] : 0000000000000000000000000000000000000000000000000058d15e17628000
Deployed Bytecode Sourcemap
186:1368:7:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1001:75;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;1080:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1683:145:6;;;;;;;;;;;;;:::i;:::-;;1060:77;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;1245:76:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1169:72;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;538:20;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;605:392;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1977:240:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1001:75:7;1044:4;1063:8;;;;;;;;;;;1056:15;;1001:75;:::o;1080:85::-;1274:12:6;:10;:12::i;:::-;1264:22;;:6;;;;;;;;;;;:22;;;1256:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1151:9:7::1;1140:8;;:20;;;;;;;;;;;;;;;;;;1080:85:::0;:::o;1683:145:6:-;1274:12;:10;:12::i;:::-;1264:22;;:6;;;;;;;;;;;:22;;;1256:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1789:1:::1;1752:40;;1773:6;;;;;;;;;;;1752:40;;;;;;;;;;;;1819:1;1802:6;;:19;;;;;;;;;;;;;;;;;;1683:145::o:0;1060:77::-;1098:7;1124:6;;;;;;;;;;;1117:13;;1060:77;:::o;1245:76:7:-;1274:12:6;:10;:12::i;:::-;1264:22;;:6;;;;;;;;;;;:22;;;1256:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1310:6:7::1;1302:5;:14;;;;1245:76:::0;:::o;1169:72::-;1209:7;1231:5;;1224:12;;1169:72;:::o;538:20::-;;;;:::o;605:392::-;1679:1:8;2259:7;;:19;;2251:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1679:1;2389:7;:18;;;;718:1:7::1;709:6;:10;701:51;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;779:17;790:5;;779:6;:10;;:17;;;;:::i;:::-;766:9;:30;;758:63;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;836:8;;;;;;;;;;;835:9;827:40;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;876:9;;;;;;;;;;;:22;;;899:14;;;;;;;;;;;915:12;:10;:12::i;:::-;929:16;940:4;929:6;:10;;:16;;;;:::i;:::-;876:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;952:40;966:14;;;;;;;;;;;982:9;952:13;:40::i;:::-;1636:1:8::0;2562:7;:22;;;;605:392:7;:::o;1977:240:6:-;1274:12;:10;:12::i;:::-;1264:22;;:6;;;;;;;;;;;:22;;;1256:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2085:1:::1;2065:22;;:8;:22;;;;2057:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2174:8;2145:38;;2166:6;;;;;;;;;;;2145:38;;;;;;;;;;;;2202:8;2193:6;;:17;;;;;;;;;;;;;;;;;;1977:240:::0;:::o;589:104:1:-;642:15;676:10;669:17;;589:104;:::o;2179:459:9:-;2237:7;2483:1;2478;:6;2474:45;;;2507:1;2500:8;;;;2474:45;2529:9;2545:1;2541;:5;2529:17;;2573:1;2568;2564;:5;;;;;;:10;2556:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2630:1;2623:8;;;2179:459;;;;;:::o;1325:226:7:-;1399:15;1430:21;1420:31;;1470:7;1461:6;:16;1457:55;;;1498:7;1489:16;;1457:55;1517:29;1535:2;1539:6;1517:17;:29::i;:::-;1325:226;;;:::o;2047:391:0:-;2161:6;2136:21;:31;;2128:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2290:12;2308:9;:14;;2331:6;2308:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2289:54;;;2361:7;2353:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2047:391;;;:::o
Swarm Source
ipfs://257cd5b64f280f963815c10eb6d3ea94e5d737ca4701a8309c591ea1be462181
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 ]
[ 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.