Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 22 from a total of 22 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Purchase | 20175169 | 17 days ago | IN | 0 ETH | 0.00123859 | ||||
Purchase | 20175168 | 17 days ago | IN | 0 ETH | 0.00123956 | ||||
Purchase | 20175157 | 17 days ago | IN | 0 ETH | 0.00130474 | ||||
Purchase | 20175153 | 17 days ago | IN | 0 ETH | 0.00128316 | ||||
Purchase | 20175153 | 17 days ago | IN | 0 ETH | 0.00127197 | ||||
Purchase | 20175148 | 17 days ago | IN | 0 ETH | 0.0012545 | ||||
Purchase | 20175146 | 17 days ago | IN | 0 ETH | 0.0012298 | ||||
Purchase | 20175142 | 17 days ago | IN | 0 ETH | 0.00137407 | ||||
Purchase | 20175141 | 17 days ago | IN | 0 ETH | 0.00215867 | ||||
Purchase | 20175141 | 17 days ago | IN | 0 ETH | 0.00133414 | ||||
Purchase | 20175137 | 17 days ago | IN | 0 ETH | 0.00133848 | ||||
Purchase | 20175135 | 17 days ago | IN | 0 ETH | 0.00113508 | ||||
Purchase | 20175135 | 17 days ago | IN | 0 ETH | 0.00113508 | ||||
Purchase | 20175135 | 17 days ago | IN | 0 ETH | 0.00113508 | ||||
Purchase | 20175134 | 17 days ago | IN | 0 ETH | 0.00119341 | ||||
Purchase | 20175133 | 17 days ago | IN | 0 ETH | 0.00122613 | ||||
Purchase | 20175131 | 17 days ago | IN | 0 ETH | 0.00116119 | ||||
Purchase | 20174081 | 17 days ago | IN | 0 ETH | 0.00054302 | ||||
Set Max Purchase... | 20173853 | 17 days ago | IN | 0 ETH | 0.00009421 | ||||
Update Price | 20173789 | 17 days ago | IN | 0 ETH | 0.00020477 | ||||
Update Price | 20173778 | 17 days ago | IN | 0 ETH | 0.00020189 | ||||
0x60806040 | 20173723 | 17 days ago | IN | Create: Adoption | 0 ETH | 0.00185549 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Adoption
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.23; pragma abicoder v2; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { IAdoption, SalesInfo } from "../interface/IAdoption.sol"; import { IRuno, SupplyInfo } from "../interface/IRuno.sol"; contract Adoption is IAdoption, AccessControl, ReentrancyGuard { bytes32 public constant OWNER_ROLE = keccak256("OWNER"); // addresses address private _owner; address private _beneficiary; address private _runoContract; IERC20 public ainContract; // Max Purchase Amount uint256 public maxPurchaseAmount; // price[i][j] : price of tier j of project i mapping(uint256 => mapping(uint256 => uint256)) public price; constructor( address beneficiary_, address runoContract_, address ainContract_ ) { require(beneficiary_ != address(0), "Adoption: invalid beneficiary address"); require(runoContract_ != address(0), "Adoption: invalid runoContract address"); require(ainContract_ != address(0), "Adoption: invalid ainContract"); _grantRole(OWNER_ROLE, _msgSender()); _beneficiary = beneficiary_; _runoContract = runoContract_; // ERC20 AIN token address ainContract = IERC20(ainContract_); maxPurchaseAmount = 5; } function supportsInterface( bytes4 interfaceId_ ) public view override returns (bool) { return interfaceId_ == type(IAdoption).interfaceId || super.supportsInterface(interfaceId_); } /** * @dev Get a node cap of token with specific tier * @param tier_ tier of token */ function availableNodeCapOf( uint256 projectId_, uint256 tier_ ) public view returns (uint256) { SupplyInfo memory SupplyInfo_ = IRuno(_runoContract).getSupplyInfo(projectId_, tier_); if (SupplyInfo_.supplyCap <= SupplyInfo_.currentSupply) { return 0; } return SupplyInfo_.supplyCap - SupplyInfo_.currentSupply; } /** * @dev Get whole sales info including price, caps, ... */ function getSalesInfo( uint256 projectId_ ) public view returns (SalesInfo memory) { IRuno runo = IRuno(_runoContract); require(0 <= projectId_ && projectId_ <= runo.maxProjectId(), "Adoption: invalid project"); SalesInfo memory _salesInfo; uint256 maxTier = runo.maxTier(); _salesInfo.tokenSupplyInfo = new SupplyInfo[](maxTier + 1); _salesInfo.priceInfo = new uint256[](maxTier + 1); for (uint256 j = 0; j <= maxTier; j += 1) { SupplyInfo memory _SupplyInfo = runo.getSupplyInfo(projectId_, j); _salesInfo.tokenSupplyInfo[j] = _SupplyInfo; _salesInfo.priceInfo[j] = price[projectId_][j]; } return _salesInfo; } /** * @dev Purchases a AIN node token * @param projectId_ project ID of token purchased * @param tier_ tier of token purchased * @param amount_ number of token purchased */ function purchase( uint256 projectId_, uint256 tier_, uint256 amount_ ) public override nonReentrant returns (uint256[] memory) { IRuno _runoNode = IRuno(_runoContract); require(0 <= tier_ && tier_ <= _runoNode.maxTier(), "Adoption: invalid tier"); require(price[projectId_][tier_] != 0, "Adoption: invalid price"); require(0 < amount_ && amount_ <= maxPurchaseAmount, "Adoption: amount out of range"); require(amount_ <= availableNodeCapOf(projectId_, tier_), "Adoption: not enough node capacity"); uint256 totalPrice_ = 0; uint256[] memory newTokenIds_ = new uint256[](amount_); for (uint256 i = 0; i < amount_; ++i) { uint256 price_ = price[projectId_][tier_]; uint256 newTokenId_ = _runoNode.mint(_msgSender(), projectId_, tier_); newTokenIds_[i] = newTokenId_; totalPrice_ = totalPrice_ + price_; } ainContract.transferFrom(_msgSender(), _beneficiary, totalPrice_); return newTokenIds_; } /** * @dev Update price of node * @param tier_ tier of node * @param price_ new run price for tokenAddress & tier */ function updatePrice( uint256 projectId_, uint256 tier_, uint256 price_ ) public onlyRole(OWNER_ROLE) { require(0 <= tier_ && tier_ <= IRuno(_runoContract).maxTier(), "Adoption: invalid tier"); price[projectId_][tier_] = price_; } /** * @dev set max purchase amount * @param amount_ max purchase amount */ function setMaxPurchaseAmount( uint256 amount_ ) public onlyRole(OWNER_ROLE) { require(0 <= amount_, "Adoption: invalid max purchase amount"); maxPurchaseAmount = amount_; } function updateBeneficiary( address beneficiary_ ) public onlyRole(OWNER_ROLE) { _beneficiary = beneficiary_; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.23; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; struct TokenInfo { uint256 tier; uint256 projectId; } struct SupplyInfo { uint256 supplyCap; uint256 currentSupply; } interface IRuno is IERC721Enumerable { // generate getter for maxTier variable function maxTier() external view returns (uint256); function maxProjectId() external view returns (uint256); function updateInfo( uint256 maxProjectId_, uint256 maxTier_ ) external; function tokensOf( address owner_, uint256 offset_, uint256 limit_ ) external view returns (uint256[] memory, uint256); function getTokenInfo( uint256 tokenId_ ) external view returns (TokenInfo memory); function getSupplyInfo( uint256 projectId_, uint256 tier_ ) external view returns (SupplyInfo memory); function mint( address to_, uint256 projectId_, uint256 tier_ ) external returns (uint256); function adminMint( address to_, uint256 projectId_, uint256 tier_, uint256 count_ ) external; function updateBaseUri( string memory baseUri_ ) external; function updateSupplyCap( uint256 projectId_, uint256 tier_, uint256 cap_ ) external; function setDefaultRoyalty( address beneficiary_, uint96 feeNumerator_ ) external; }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.23; pragma abicoder v2; import { SupplyInfo } from "./IRuno.sol"; struct SalesInfo { SupplyInfo[] tokenSupplyInfo; uint256[] priceInfo; } interface IAdoption { function availableNodeCapOf( uint256 projectId_, uint256 tier_ ) external view returns (uint256); function getSalesInfo( uint256 projectId_ ) external view returns (SalesInfo memory); function purchase( uint256 projectId_, uint256 tier_, uint256 amount_ ) external returns (uint256[] memory); function updatePrice( uint256 projectId_, uint256 tier_, uint256 price_ ) external; function setMaxPurchaseAmount( uint256 amount_ ) external; function updateBeneficiary( address beneficiary_ ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {IERC20Errors} from "../../interfaces/draft-IERC6093.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}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead 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. */ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual 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 default value returned by this function, unless * it's overridden. * * 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 virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, value); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); 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}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` amount of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` 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. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * ``` * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner` s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @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; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); 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 making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.20; import {IERC721} from "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"beneficiary_","type":"address"},{"internalType":"address","name":"runoContract_","type":"address"},{"internalType":"address","name":"ainContract_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OWNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ainContract","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId_","type":"uint256"},{"internalType":"uint256","name":"tier_","type":"uint256"}],"name":"availableNodeCapOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId_","type":"uint256"}],"name":"getSalesInfo","outputs":[{"components":[{"components":[{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint256","name":"currentSupply","type":"uint256"}],"internalType":"struct SupplyInfo[]","name":"tokenSupplyInfo","type":"tuple[]"},{"internalType":"uint256[]","name":"priceInfo","type":"uint256[]"}],"internalType":"struct SalesInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPurchaseAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId_","type":"uint256"},{"internalType":"uint256","name":"tier_","type":"uint256"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"purchase","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setMaxPurchaseAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId_","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary_","type":"address"}],"name":"updateBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"projectId_","type":"uint256"},{"internalType":"uint256","name":"tier_","type":"uint256"},{"internalType":"uint256","name":"price_","type":"uint256"}],"name":"updatePrice","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801562000010575f80fd5b50604051620013933803806200139383398101604081905262000033916200029b565b600180556001600160a01b038316620000a15760405162461bcd60e51b815260206004820152602560248201527f41646f7074696f6e3a20696e76616c69642062656e6566696369617279206164604482015264647265737360d81b60648201526084015b60405180910390fd5b6001600160a01b038216620001085760405162461bcd60e51b815260206004820152602660248201527f41646f7074696f6e3a20696e76616c69642072756e6f436f6e7472616374206160448201526564647265737360d01b606482015260840162000098565b6001600160a01b038116620001605760405162461bcd60e51b815260206004820152601d60248201527f41646f7074696f6e3a20696e76616c69642061696e436f6e7472616374000000604482015260640162000098565b6200018c7f6270edb7c868f86fda4adedba75108201087268ea345934db8bad688e1feb91b33620001d3565b50600380546001600160a01b039485166001600160a01b031991821617909155600480549385169382169390931790925560058054919093169116178155600655620002e2565b5f828152602081815260408083206001600160a01b038516845290915281205460ff1662000276575f838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556200022d3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000279565b505f5b92915050565b80516001600160a01b038116811462000296575f80fd5b919050565b5f805f60608486031215620002ae575f80fd5b620002b9846200027f565b9250620002c9602085016200027f565b9150620002d9604085016200027f565b90509250925092565b6110a380620002f05f395ff3fe608060405234801561000f575f80fd5b5060043610610106575f3560e01c80637a6f848a1161009e578063a5fa12f01161006e578063a5fa12f014610252578063d547741f14610265578063e58378bb14610278578063f687628e1461028c578063f952fcad146102ac575f80fd5b80637a6f848a1461020557806391d14854146102185780639b8b93051461022b578063a217fddf1461024b575f80fd5b80632f2ff15d116100d95780632f2ff15d1461018a57806336568abe1461019d578063487a2395146101b05780637388c203146101da575f80fd5b806301ffc9a71461010a5780630aaffd2a146101325780630f43612914610147578063248a9ca31461015a575b5f80fd5b61011d610118366004610da8565b6102b5565b60405190151581526020015b60405180910390f35b610145610140366004610dea565b6102df565b005b610145610155366004610e03565b610319565b61017c610168366004610e2c565b5f9081526020819052604090206001015490565b604051908152602001610129565b610145610198366004610e43565b610402565b6101456101ab366004610e43565b61042c565b61017c6101be366004610e6d565b600760209081525f928352604080842090915290825290205481565b6005546101ed906001600160a01b031681565b6040516001600160a01b039091168152602001610129565b61017c610213366004610e6d565b610464565b61011d610226366004610e43565b610509565b61023e610239366004610e03565b610531565b6040516101299190610e8d565b61017c5f81565b610145610260366004610e2c565b6108d3565b610145610273366004610e43565b6108f0565b61017c5f8051602061104e83398151915281565b61029f61029a366004610e2c565b610914565b6040516101299190610ed0565b61017c60065481565b5f6001600160e01b03198216635bbafdf960e11b14806102d957506102d982610c08565b92915050565b5f8051602061104e8339815191526102f681610c3c565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b5f8051602061104e83398151915261033081610c3c565b6004805460408051637bfbbacb60e01b815290516001600160a01b0390921692637bfbbacb9282820192602092908290030181865afa158015610375573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103999190610f5c565b8311156103e65760405162461bcd60e51b815260206004820152601660248201527520b237b83a34b7b71d1034b73b30b634b2103a34b2b960511b60448201526064015b60405180910390fd5b505f928352600760209081526040808520938552929052912055565b5f8281526020819052604090206001015461041c81610c3c565b6104268383610c49565b50505050565b6001600160a01b03811633146104555760405163334bd91960e11b815260040160405180910390fd5b61045f8282610cd8565b505050565b6004805460405163261fe34d60e11b8152918201849052602482018390525f9182916001600160a01b031690634c3fc69a906044016040805180830381865afa1580156104b3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104d79190610f87565b90508060200151815f0151116104f0575f9150506102d9565b602081015181516105019190610ff4565b949350505050565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b606061053b610d41565b6004546001600160a01b0316806001600160a01b0316637bfbbacb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610583573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105a79190610f5c565b8411156105ef5760405162461bcd60e51b815260206004820152601660248201527520b237b83a34b7b71d1034b73b30b634b2103a34b2b960511b60448201526064016103dd565b5f85815260076020908152604080832087845290915281205490036106565760405162461bcd60e51b815260206004820152601760248201527f41646f7074696f6e3a20696e76616c696420707269636500000000000000000060448201526064016103dd565b825f10801561066757506006548311155b6106b35760405162461bcd60e51b815260206004820152601d60248201527f41646f7074696f6e3a20616d6f756e74206f7574206f662072616e676500000060448201526064016103dd565b6106bd8585610464565b8311156107175760405162461bcd60e51b815260206004820152602260248201527f41646f7074696f6e3a206e6f7420656e6f756768206e6f646520636170616369604482015261747960f01b60648201526084016103dd565b5f808467ffffffffffffffff81111561073257610732610f73565b60405190808252806020026020018201604052801561075b578160200160208202803683370190505b5090505f5b85811015610833575f8881526007602090815260408083208a84528252808320548151630ab714fb60e11b8152336004820152602481018d9052604481018c905291519093926001600160a01b0389169263156e29f69260648083019392829003018187875af11580156107d6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107fa9190610f5c565b90508084848151811061080f5761080f611007565b6020908102919091010152610824828661101b565b94505050806001019050610760565b506005546001600160a01b03166323b872dd3360035460405160e084901b6001600160e01b03191681526001600160a01b03928316600482015291166024820152604481018590526064016020604051808303815f875af115801561089a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108be919061102e565b50925050506108cc60018055565b9392505050565b5f8051602061104e8339815191526108ea81610c3c565b50600655565b5f8281526020819052604090206001015461090a81610c3c565b6104268383610cd8565b60408051808201909152606080825260208201526004546001600160a01b0316806001600160a01b03166381642dfd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610970573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109949190610f5c565b8311156109e35760405162461bcd60e51b815260206004820152601960248201527f41646f7074696f6e3a20696e76616c69642070726f6a6563740000000000000060448201526064016103dd565b60408051808201909152606080825260208201525f826001600160a01b0316637bfbbacb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a34573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a589190610f5c565b9050610a6581600161101b565b67ffffffffffffffff811115610a7d57610a7d610f73565b604051908082528060200260200182016040528015610ac157816020015b604080518082019091525f8082526020820152815260200190600190039081610a9b5790505b508252610acf81600161101b565b67ffffffffffffffff811115610ae757610ae7610f73565b604051908082528060200260200182016040528015610b10578160200160208202803683370190505b5060208301525f5b818111610bfe5760405163261fe34d60e11b815260048101879052602481018290525f906001600160a01b03861690634c3fc69a906044016040805180830381865afa158015610b6a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8e9190610f87565b905080845f01518381518110610ba657610ba6611007565b6020908102919091018101919091525f888152600782526040808220858352835290205490850151805184908110610be057610be0611007565b602090810291909101015250610bf760018261101b565b9050610b18565b5090949350505050565b5f6001600160e01b03198216637965db0b60e01b14806102d957506301ffc9a760e01b6001600160e01b03198316146102d9565b610c468133610d6b565b50565b5f610c548383610509565b610cd1575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610c893390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016102d9565b505f6102d9565b5f610ce38383610509565b15610cd1575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016102d9565b600260015403610d6457604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b610d758282610509565b610da45760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016103dd565b5050565b5f60208284031215610db8575f80fd5b81356001600160e01b0319811681146108cc575f80fd5b80356001600160a01b0381168114610de5575f80fd5b919050565b5f60208284031215610dfa575f80fd5b6108cc82610dcf565b5f805f60608486031215610e15575f80fd5b505081359360208301359350604090920135919050565b5f60208284031215610e3c575f80fd5b5035919050565b5f8060408385031215610e54575f80fd5b82359150610e6460208401610dcf565b90509250929050565b5f8060408385031215610e7e575f80fd5b50508035926020909101359150565b602080825282518282018190525f9190848201906040850190845b81811015610ec457835183529284019291840191600101610ea8565b50909695505050505050565b6020808252825160408383018190528151606085018190525f9392830191849160808701905b80841015610f1f5784518051835286015186830152938501936001939093019290820190610ef6565b5084880151601f1988830301604089015280518083529086019450908501925090505f8115610ec457835183529284019291840191600101610ea8565b5f60208284031215610f6c575f80fd5b5051919050565b634e487b7160e01b5f52604160045260245ffd5b5f60408284031215610f97575f80fd5b6040516040810181811067ffffffffffffffff82111715610fc657634e487b7160e01b5f52604160045260245ffd5b604052825181526020928301519281019290925250919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156102d9576102d9610fe0565b634e487b7160e01b5f52603260045260245ffd5b808201808211156102d9576102d9610fe0565b5f6020828403121561103e575f80fd5b815180151581146108cc575f80fdfe6270edb7c868f86fda4adedba75108201087268ea345934db8bad688e1feb91ba26469706673582212201b500d44f21b7ee3630790b86959fdeb2a2732b46b5107707e7f17e3c6f894d764736f6c63430008170033000000000000000000000000976da6c3aed13c5aa0197b88473d9f497c8b51450000000000000000000000009cc465405b784ff0948587477cb7db5617755dda0000000000000000000000003a810ff7211b40c4fa76205a14efe161615d0385
Deployed Bytecode
0x608060405234801561000f575f80fd5b5060043610610106575f3560e01c80637a6f848a1161009e578063a5fa12f01161006e578063a5fa12f014610252578063d547741f14610265578063e58378bb14610278578063f687628e1461028c578063f952fcad146102ac575f80fd5b80637a6f848a1461020557806391d14854146102185780639b8b93051461022b578063a217fddf1461024b575f80fd5b80632f2ff15d116100d95780632f2ff15d1461018a57806336568abe1461019d578063487a2395146101b05780637388c203146101da575f80fd5b806301ffc9a71461010a5780630aaffd2a146101325780630f43612914610147578063248a9ca31461015a575b5f80fd5b61011d610118366004610da8565b6102b5565b60405190151581526020015b60405180910390f35b610145610140366004610dea565b6102df565b005b610145610155366004610e03565b610319565b61017c610168366004610e2c565b5f9081526020819052604090206001015490565b604051908152602001610129565b610145610198366004610e43565b610402565b6101456101ab366004610e43565b61042c565b61017c6101be366004610e6d565b600760209081525f928352604080842090915290825290205481565b6005546101ed906001600160a01b031681565b6040516001600160a01b039091168152602001610129565b61017c610213366004610e6d565b610464565b61011d610226366004610e43565b610509565b61023e610239366004610e03565b610531565b6040516101299190610e8d565b61017c5f81565b610145610260366004610e2c565b6108d3565b610145610273366004610e43565b6108f0565b61017c5f8051602061104e83398151915281565b61029f61029a366004610e2c565b610914565b6040516101299190610ed0565b61017c60065481565b5f6001600160e01b03198216635bbafdf960e11b14806102d957506102d982610c08565b92915050565b5f8051602061104e8339815191526102f681610c3c565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b5f8051602061104e83398151915261033081610c3c565b6004805460408051637bfbbacb60e01b815290516001600160a01b0390921692637bfbbacb9282820192602092908290030181865afa158015610375573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103999190610f5c565b8311156103e65760405162461bcd60e51b815260206004820152601660248201527520b237b83a34b7b71d1034b73b30b634b2103a34b2b960511b60448201526064015b60405180910390fd5b505f928352600760209081526040808520938552929052912055565b5f8281526020819052604090206001015461041c81610c3c565b6104268383610c49565b50505050565b6001600160a01b03811633146104555760405163334bd91960e11b815260040160405180910390fd5b61045f8282610cd8565b505050565b6004805460405163261fe34d60e11b8152918201849052602482018390525f9182916001600160a01b031690634c3fc69a906044016040805180830381865afa1580156104b3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104d79190610f87565b90508060200151815f0151116104f0575f9150506102d9565b602081015181516105019190610ff4565b949350505050565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b606061053b610d41565b6004546001600160a01b0316806001600160a01b0316637bfbbacb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610583573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105a79190610f5c565b8411156105ef5760405162461bcd60e51b815260206004820152601660248201527520b237b83a34b7b71d1034b73b30b634b2103a34b2b960511b60448201526064016103dd565b5f85815260076020908152604080832087845290915281205490036106565760405162461bcd60e51b815260206004820152601760248201527f41646f7074696f6e3a20696e76616c696420707269636500000000000000000060448201526064016103dd565b825f10801561066757506006548311155b6106b35760405162461bcd60e51b815260206004820152601d60248201527f41646f7074696f6e3a20616d6f756e74206f7574206f662072616e676500000060448201526064016103dd565b6106bd8585610464565b8311156107175760405162461bcd60e51b815260206004820152602260248201527f41646f7074696f6e3a206e6f7420656e6f756768206e6f646520636170616369604482015261747960f01b60648201526084016103dd565b5f808467ffffffffffffffff81111561073257610732610f73565b60405190808252806020026020018201604052801561075b578160200160208202803683370190505b5090505f5b85811015610833575f8881526007602090815260408083208a84528252808320548151630ab714fb60e11b8152336004820152602481018d9052604481018c905291519093926001600160a01b0389169263156e29f69260648083019392829003018187875af11580156107d6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107fa9190610f5c565b90508084848151811061080f5761080f611007565b6020908102919091010152610824828661101b565b94505050806001019050610760565b506005546001600160a01b03166323b872dd3360035460405160e084901b6001600160e01b03191681526001600160a01b03928316600482015291166024820152604481018590526064016020604051808303815f875af115801561089a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108be919061102e565b50925050506108cc60018055565b9392505050565b5f8051602061104e8339815191526108ea81610c3c565b50600655565b5f8281526020819052604090206001015461090a81610c3c565b6104268383610cd8565b60408051808201909152606080825260208201526004546001600160a01b0316806001600160a01b03166381642dfd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610970573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109949190610f5c565b8311156109e35760405162461bcd60e51b815260206004820152601960248201527f41646f7074696f6e3a20696e76616c69642070726f6a6563740000000000000060448201526064016103dd565b60408051808201909152606080825260208201525f826001600160a01b0316637bfbbacb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a34573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a589190610f5c565b9050610a6581600161101b565b67ffffffffffffffff811115610a7d57610a7d610f73565b604051908082528060200260200182016040528015610ac157816020015b604080518082019091525f8082526020820152815260200190600190039081610a9b5790505b508252610acf81600161101b565b67ffffffffffffffff811115610ae757610ae7610f73565b604051908082528060200260200182016040528015610b10578160200160208202803683370190505b5060208301525f5b818111610bfe5760405163261fe34d60e11b815260048101879052602481018290525f906001600160a01b03861690634c3fc69a906044016040805180830381865afa158015610b6a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8e9190610f87565b905080845f01518381518110610ba657610ba6611007565b6020908102919091018101919091525f888152600782526040808220858352835290205490850151805184908110610be057610be0611007565b602090810291909101015250610bf760018261101b565b9050610b18565b5090949350505050565b5f6001600160e01b03198216637965db0b60e01b14806102d957506301ffc9a760e01b6001600160e01b03198316146102d9565b610c468133610d6b565b50565b5f610c548383610509565b610cd1575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610c893390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016102d9565b505f6102d9565b5f610ce38383610509565b15610cd1575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016102d9565b600260015403610d6457604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b610d758282610509565b610da45760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016103dd565b5050565b5f60208284031215610db8575f80fd5b81356001600160e01b0319811681146108cc575f80fd5b80356001600160a01b0381168114610de5575f80fd5b919050565b5f60208284031215610dfa575f80fd5b6108cc82610dcf565b5f805f60608486031215610e15575f80fd5b505081359360208301359350604090920135919050565b5f60208284031215610e3c575f80fd5b5035919050565b5f8060408385031215610e54575f80fd5b82359150610e6460208401610dcf565b90509250929050565b5f8060408385031215610e7e575f80fd5b50508035926020909101359150565b602080825282518282018190525f9190848201906040850190845b81811015610ec457835183529284019291840191600101610ea8565b50909695505050505050565b6020808252825160408383018190528151606085018190525f9392830191849160808701905b80841015610f1f5784518051835286015186830152938501936001939093019290820190610ef6565b5084880151601f1988830301604089015280518083529086019450908501925090505f8115610ec457835183529284019291840191600101610ea8565b5f60208284031215610f6c575f80fd5b5051919050565b634e487b7160e01b5f52604160045260245ffd5b5f60408284031215610f97575f80fd5b6040516040810181811067ffffffffffffffff82111715610fc657634e487b7160e01b5f52604160045260245ffd5b604052825181526020928301519281019290925250919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156102d9576102d9610fe0565b634e487b7160e01b5f52603260045260245ffd5b808201808211156102d9576102d9610fe0565b5f6020828403121561103e575f80fd5b815180151581146108cc575f80fdfe6270edb7c868f86fda4adedba75108201087268ea345934db8bad688e1feb91ba26469706673582212201b500d44f21b7ee3630790b86959fdeb2a2732b46b5107707e7f17e3c6f894d764736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000976da6c3aed13c5aa0197b88473d9f497c8b51450000000000000000000000009cc465405b784ff0948587477cb7db5617755dda0000000000000000000000003a810ff7211b40c4fa76205a14efe161615d0385
-----Decoded View---------------
Arg [0] : beneficiary_ (address): 0x976da6C3aed13c5AA0197b88473d9f497c8b5145
Arg [1] : runoContract_ (address): 0x9cC465405B784ff0948587477cB7dB5617755Dda
Arg [2] : ainContract_ (address): 0x3A810ff7211b40c4fA76205a14efe161615d0385
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000976da6c3aed13c5aa0197b88473d9f497c8b5145
Arg [1] : 0000000000000000000000009cc465405b784ff0948587477cb7db5617755dda
Arg [2] : 0000000000000000000000003a810ff7211b40c4fa76205a14efe161615d0385
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.