diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a12cf8e..6f75a2a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,6 @@ jobs: with: node-version: "18.x" cache: "npm" - - run: rm foundry.toml - uses: crytic/slither-action@v0.3.0 with: node-version: 18 @@ -89,7 +88,7 @@ jobs: - name: solidity-coverage run: npx hardhat coverage - name: coveralls - uses: coverallsapp/github-action@1.1.3 + uses: coverallsapp/github-action@v2.1.2 with: github-token: ${{ secrets.GITHUB_TOKEN }} forge_coverage: @@ -109,4 +108,4 @@ jobs: cache: "npm" - run: npm ci - name: Print coverage - run: forge coverage + run: forge b; forge coverage diff --git a/README.md b/README.md index 84ec70a6..69cc8160 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,24 @@ This repository contains the smart contract suite used in Polygon's ecosystems. ## Contents -- [Repo Architecture](#repo-architecture) - - [Contracts](#contracts) - - [General Repo Layout](#general-repo-layout) -- [Using This Repo](#using-this-repo) - - [Requirements](#requirements) - - [Installation](#installation) - - [Compiling Contracts](#compiling-contracts) - - [Running Tests](#running-tests) - - [Check Test Coverage](#check-test-coverage) - - [Run Slither](#run-slither) - - [Continuous Integration](#continuous-integration) - - [Documentation](#documentation) +- [Core Contracts](#core-contracts) + - [Contents](#contents) + - [Repo Architecture](#repo-architecture) + - [Contracts](#contracts) + - [General Repo Layout](#general-repo-layout) + - [Using This Repo](#using-this-repo) + - [Requirements](#requirements) + - [General Repo Layout](#general-repo-layout-1) + - [Installation](#installation) + - [Deployment](#deployment) + - [Environment Setup](#environment-setup) + - [Compiling Contracts](#compiling-contracts) + - [Running tests](#running-tests) + - [Linting](#linting) + - [Check Test Coverage](#check-test-coverage) + - [Run Slither](#run-slither) + - [Continuous Integration](#continuous-integration) + - [Documentation](#documentation) ## Repo Architecture @@ -152,6 +158,12 @@ Install Foundry libs: forge install ``` +### Deployment + +Deploying these contracts in the context of a production blockchain is out of the scope of this repo, as it requires a client that has support of the Edge specification integrated. At current, Edge maintains its own client [here](https://github.com/0xPolygon/polygon-edge), which can be consulted. + +One point that is worth emphasizing in this context is that from the perspective of launching a Supernet is understanding genesis contracts. Another is that for at least the time being, the decision has been made to proxify all genesis contracts in order to facilitate upgrades/updates without necessitating a hardfork or regenesis. All deployment scripts in `script/deployment` use OpenZeppelin's `TransparentUpgradeableProxy`. + ### Environment Setup There are a few things that should be done to set up the repo once you've cloned it and installed the dependencies and libraries. An important step for various parts of the repo to work properly is to set up a `.env` file. There is an `.example.env` file provided, copy it and rename the copy `.env`. diff --git a/contracts/child/ChildERC1155.sol b/contracts/child/ChildERC1155.sol index 71ecc869..a3507cbf 100644 --- a/contracts/child/ChildERC1155.sol +++ b/contracts/child/ChildERC1155.sol @@ -102,4 +102,7 @@ contract ChildERC1155 is EIP712MetaTransaction, ERC1155Upgradeable, IChildERC115 function _msgSender() internal view virtual override(EIP712MetaTransaction, ContextUpgradeable) returns (address) { return EIP712MetaTransaction._msgSender(); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/ChildERC1155Predicate.sol b/contracts/child/ChildERC1155Predicate.sol index 7503fc3a..91188781 100644 --- a/contracts/child/ChildERC1155Predicate.sol +++ b/contracts/child/ChildERC1155Predicate.sol @@ -72,7 +72,7 @@ contract ChildERC1155Predicate is IChildERC1155Predicate, Initializable, System } /** - * @notice Initilization function for ChildERC1155Predicate + * @notice Initialization function for ChildERC1155Predicate * @param newL2StateSender Address of L2StateSender to send exit information to * @param newStateReceiver Address of StateReceiver to receive deposit information from * @param newRootERC1155Predicate Address of root ERC1155 predicate to communicate with @@ -157,7 +157,7 @@ contract ChildERC1155Predicate is IChildERC1155Predicate, Initializable, System } /** - * @notice Internal initilization function for ChildERC1155Predicate + * @notice Internal initialization function for ChildERC1155Predicate * @param newL2StateSender Address of L2StateSender to send exit information to * @param newStateReceiver Address of StateReceiver to receive deposit information from * @param newRootERC1155Predicate Address of root ERC1155 predicate to communicate with @@ -335,4 +335,7 @@ contract ChildERC1155Predicate is IChildERC1155Predicate, Initializable, System return false; } } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/ChildERC1155PredicateAccessList.sol b/contracts/child/ChildERC1155PredicateAccessList.sol index 1e6c1197..449ebc93 100644 --- a/contracts/child/ChildERC1155PredicateAccessList.sol +++ b/contracts/child/ChildERC1155PredicateAccessList.sol @@ -28,4 +28,7 @@ contract ChildERC1155PredicateAccessList is AccessList, ChildERC1155Predicate { function _beforeTokenWithdraw() internal virtual override { _checkAccessList(); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/ChildERC20.sol b/contracts/child/ChildERC20.sol index f745bdc0..d0513a73 100644 --- a/contracts/child/ChildERC20.sol +++ b/contracts/child/ChildERC20.sol @@ -88,4 +88,7 @@ contract ChildERC20 is EIP712MetaTransaction, ERC20Upgradeable, IChildERC20 { function _msgSender() internal view virtual override(EIP712MetaTransaction, ContextUpgradeable) returns (address) { return EIP712MetaTransaction._msgSender(); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/ChildERC20Predicate.sol b/contracts/child/ChildERC20Predicate.sol index 80becce4..ac1d515e 100644 --- a/contracts/child/ChildERC20Predicate.sol +++ b/contracts/child/ChildERC20Predicate.sol @@ -50,7 +50,7 @@ contract ChildERC20Predicate is IChildERC20Predicate, Initializable, System { event L2TokenMapped(address indexed rootToken, address indexed childToken); /** - * @notice Initilization function for ChildERC20Predicate + * @notice Initialization function for ChildERC20Predicate * @param newL2StateSender Address of L2StateSender to send exit information to * @param newStateReceiver Address of StateReceiver to receive deposit information from * @param newRootERC20Predicate Address of root ERC20 predicate to communicate with @@ -226,4 +226,7 @@ contract ChildERC20Predicate is IChildERC20Predicate, Initializable, System { // slither-disable-next-line reentrancy-events emit L2TokenMapped(rootToken, address(childToken)); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/ChildERC20PredicateAccessList.sol b/contracts/child/ChildERC20PredicateAccessList.sol index 6762b76e..cf927f84 100644 --- a/contracts/child/ChildERC20PredicateAccessList.sol +++ b/contracts/child/ChildERC20PredicateAccessList.sol @@ -35,4 +35,7 @@ contract ChildERC20PredicateAccessList is AccessList, ChildERC20Predicate { function _beforeTokenWithdraw() internal virtual override { _checkAccessList(); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/ChildERC721.sol b/contracts/child/ChildERC721.sol index 330144ab..3841066d 100644 --- a/contracts/child/ChildERC721.sol +++ b/contracts/child/ChildERC721.sol @@ -106,4 +106,7 @@ contract ChildERC721 is EIP712MetaTransaction, ERC721Upgradeable, IChildERC721 { function _msgSender() internal view virtual override(EIP712MetaTransaction, ContextUpgradeable) returns (address) { return EIP712MetaTransaction._msgSender(); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/ChildERC721Predicate.sol b/contracts/child/ChildERC721Predicate.sol index fab101ea..bf13fc3e 100644 --- a/contracts/child/ChildERC721Predicate.sol +++ b/contracts/child/ChildERC721Predicate.sol @@ -68,7 +68,7 @@ contract ChildERC721Predicate is IChildERC721Predicate, Initializable, System { } /** - * @notice Initilization function for ChildERC721Predicate + * @notice Initialization function for ChildERC721Predicate * @param newL2StateSender Address of L2StateSender to send exit information to * @param newStateReceiver Address of StateReceiver to receive deposit information from * @param newRootERC721Predicate Address of root ERC721 predicate to communicate with @@ -149,7 +149,7 @@ contract ChildERC721Predicate is IChildERC721Predicate, Initializable, System { } /** - * @notice Initilization function for ChildERC721Predicate + * @notice Initialization function for ChildERC721Predicate * @param newL2StateSender Address of L2StateSender to send exit information to * @param newStateReceiver Address of StateReceiver to receive deposit information from * @param newRootERC721Predicate Address of root ERC721 predicate to communicate with @@ -314,4 +314,7 @@ contract ChildERC721Predicate is IChildERC721Predicate, Initializable, System { return false; } } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/ChildERC721PredicateAccessList.sol b/contracts/child/ChildERC721PredicateAccessList.sol index 7cc24e99..69c4b014 100644 --- a/contracts/child/ChildERC721PredicateAccessList.sol +++ b/contracts/child/ChildERC721PredicateAccessList.sol @@ -28,4 +28,7 @@ contract ChildERC721PredicateAccessList is AccessList, ChildERC721Predicate { function _beforeTokenWithdraw() internal virtual override { _checkAccessList(); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/EIP1559Burn.sol b/contracts/child/EIP1559Burn.sol index 3989e9ea..8a4b8add 100644 --- a/contracts/child/EIP1559Burn.sol +++ b/contracts/child/EIP1559Burn.sol @@ -13,7 +13,7 @@ import "../interfaces/child/IChildERC20Predicate.sol"; contract EIP1559Burn is Initializable { IChildERC20Predicate public childERC20Predicate; address public burnDestination; - IChildERC20 private constant NATIVE_TOKEN = IChildERC20(0x0000000000000000000000000000000000001010); + IChildERC20 private constant _NATIVE_TOKEN = IChildERC20(0x0000000000000000000000000000000000001010); event NativeTokenBurnt(address indexed burner, uint256 amount); @@ -21,7 +21,7 @@ contract EIP1559Burn is Initializable { receive() external payable {} // solhint-disable-line no-empty-blocks /** - * @notice Initilization function for EIP1559 burn contract + * @notice Initialization function for EIP1559 burn contract * @param newChildERC20Predicate Address of the ERC20 predicate on child chain * @param newBurnDestination Address on the root chain to burn the tokens and send to * @dev Can only be called once @@ -42,7 +42,7 @@ contract EIP1559Burn is Initializable { uint256 balance = address(this).balance; - childERC20Predicate.withdrawTo(NATIVE_TOKEN, burnDestination, balance); + childERC20Predicate.withdrawTo(_NATIVE_TOKEN, burnDestination, balance); // slither-disable-next-line reentrancy-events emit NativeTokenBurnt(msg.sender, balance); } diff --git a/contracts/child/ForkParams.sol b/contracts/child/ForkParams.sol index 8768e9bd..b1c297dd 100644 --- a/contracts/child/ForkParams.sol +++ b/contracts/child/ForkParams.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.19; import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** @title ForkParams @@ -9,17 +10,17 @@ import "@openzeppelin/contracts/access/Ownable.sol"; @notice Configurable softfork features that are read by the client on each epoch @dev The contract allows for configurable softfork parameters without genesis updation */ -contract ForkParams is Ownable { +contract ForkParams is Ownable, Initializable { mapping(bytes32 => uint256) public featureToBlockNumber; // keccak256("FEATURE_NAME") -> blockNumber event NewFeature(bytes32 indexed feature, uint256 indexed block); event UpdatedFeature(bytes32 indexed feature, uint256 indexed block); /** - * @notice constructor function to set the owner + * @notice initialize function to set the owner * @param newOwner address to transfer the ownership to */ - constructor(address newOwner) { + function initialize(address newOwner) public initializer { _transferOwnership(newOwner); } diff --git a/contracts/child/L2StateSender.sol b/contracts/child/L2StateSender.sol index 602f0fbb..fa6805cf 100644 --- a/contracts/child/L2StateSender.sol +++ b/contracts/child/L2StateSender.sol @@ -29,4 +29,7 @@ contract L2StateSender is IStateSender { emit L2StateSynced(++counter, msg.sender, receiver, data); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/NativeERC20.sol b/contracts/child/NativeERC20.sol index 07ede623..543d80ac 100644 --- a/contracts/child/NativeERC20.sol +++ b/contracts/child/NativeERC20.sol @@ -43,8 +43,9 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { address rootToken_, string calldata name_, string calldata symbol_, - uint8 decimals_ - ) external initializer onlySystemCall { + uint8 decimals_, + uint256 tokenSupply_ + ) external virtual initializer onlySystemCall { // slither-disable-next-line missing-zero-check,events-access _predicate = predicate_; // slither-disable-next-line missing-zero-check @@ -53,6 +54,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { _symbol = symbol_; // slither-disable-next-line events-maths _decimals = decimals_; + _totalSupply = tokenSupply_; } /** @@ -63,7 +65,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ - function transfer(address to, uint256 amount) external returns (bool) { + function transfer(address to, uint256 amount) external virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; @@ -79,7 +81,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { * * - `spender` cannot be the zero address. */ - function approve(address spender, uint256 amount) external returns (bool) { + function approve(address spender, uint256 amount) external virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; @@ -101,7 +103,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ - function transferFrom(address from, address to, uint256 amount) external returns (bool) { + function transferFrom(address from, address to, uint256 amount) external virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); @@ -120,7 +122,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { * * - `spender` cannot be the zero address. */ - function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { + function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; @@ -140,7 +142,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ - function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { + function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); @@ -154,7 +156,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { /** * @inheritdoc INativeERC20 */ - function mint(address account, uint256 amount) external onlyPredicate returns (bool) { + function mint(address account, uint256 amount) external virtual onlyPredicate returns (bool) { _mint(account, amount); return true; @@ -163,7 +165,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { /** * @inheritdoc INativeERC20 */ - function burn(address account, uint256 amount) external onlyPredicate returns (bool) { + function burn(address account, uint256 amount) external virtual onlyPredicate returns (bool) { _burn(account, amount); return true; @@ -218,7 +220,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { /** * @dev See {IERC20-allowance}. */ - function allowance(address owner, address spender) public view returns (uint256) { + function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } @@ -250,7 +252,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ - function _transfer(address from, address to, uint256 amount) internal { + function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); @@ -270,7 +272,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { * * - `account` cannot be the zero address. */ - function _mint(address account, uint256 amount) internal { + function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; @@ -293,7 +295,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ - function _burn(address account, uint256 amount) internal { + function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply -= amount; @@ -318,7 +320,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ - function _approve(address owner, address spender, uint256 amount) internal { + 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"); @@ -334,7 +336,7 @@ contract NativeERC20 is Context, Initializable, System, INativeERC20 { * * Might emit an {Approval} event. */ - function _spendAllowance(address owner, address spender, uint256 amount) internal { + function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); diff --git a/contracts/child/NativeERC20Mintable.sol b/contracts/child/NativeERC20Mintable.sol index 45337e58..0d84fb0c 100644 --- a/contracts/child/NativeERC20Mintable.sol +++ b/contracts/child/NativeERC20Mintable.sol @@ -45,8 +45,9 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE address rootToken_, string calldata name_, string calldata symbol_, - uint8 decimals_ - ) external initializer onlySystemCall { + uint8 decimals_, + uint256 tokenSupply_ + ) external virtual initializer onlySystemCall { require(owner_ != address(0), "NativeERC20: Invalid owner address"); // slither-disable-next-line missing-zero-check,events-access _predicate = predicate_; @@ -56,6 +57,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE _symbol = symbol_; // slither-disable-next-line events-maths _decimals = decimals_; + _totalSupply = tokenSupply_; _transferOwnership(owner_); } @@ -67,7 +69,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ - function transfer(address to, uint256 amount) external returns (bool) { + function transfer(address to, uint256 amount) external virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; @@ -83,7 +85,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * * - `spender` cannot be the zero address. */ - function approve(address spender, uint256 amount) external returns (bool) { + function approve(address spender, uint256 amount) external virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; @@ -105,7 +107,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ - function transferFrom(address from, address to, uint256 amount) external returns (bool) { + function transferFrom(address from, address to, uint256 amount) external virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); @@ -124,7 +126,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * * - `spender` cannot be the zero address. */ - function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { + function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; @@ -144,7 +146,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ - function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { + function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); @@ -160,9 +162,9 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * @dev Can only be called by the predicate address * @param account Account of the user to mint the tokens to * @param amount Amount of tokens to mint to the account - * @return bool Returns true if function call is succesful + * @return bool Returns true if function call is successful */ - function mint(address account, uint256 amount) external onlyPredicateOrMinter returns (bool) { + function mint(address account, uint256 amount) external virtual onlyPredicateOrMinter returns (bool) { _mint(account, amount); return true; @@ -173,9 +175,9 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * @dev Can only be called by the predicate address * @param account Account of the user to burn the tokens from * @param amount Amount of tokens to burn from the account - * @return bool Returns true if function call is succesful + * @return bool Returns true if function call is successful */ - function burn(address account, uint256 amount) external onlyPredicateOrMinter returns (bool) { + function burn(address account, uint256 amount) external virtual onlyPredicateOrMinter returns (bool) { _burn(account, amount); return true; @@ -230,7 +232,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE /** * @dev See {IERC20-allowance}. */ - function allowance(address owner, address spender) public view returns (uint256) { + function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } @@ -243,8 +245,8 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE } /** - * @notice Returns predicate address controlling the child token - * @return address Returns the address of the predicate + * @notice Returns corresponding root token address for the child native token + * @return address Returns the root token address */ function rootToken() public view virtual returns (address) { return _rootToken; @@ -264,7 +266,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ - function _transfer(address from, address to, uint256 amount) internal { + function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); @@ -284,7 +286,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * * - `account` cannot be the zero address. */ - function _mint(address account, uint256 amount) internal { + function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; @@ -307,7 +309,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ - function _burn(address account, uint256 amount) internal { + function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply -= amount; @@ -332,7 +334,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ - function _approve(address owner, address spender, uint256 amount) internal { + 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"); @@ -348,7 +350,7 @@ contract NativeERC20Mintable is Context, Initializable, System, Ownable2Step, IE * * Might emit an {Approval} event. */ - function _spendAllowance(address owner, address spender, uint256 amount) internal { + function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); diff --git a/contracts/child/NetworkParams.sol b/contracts/child/NetworkParams.sol index 68b654ab..f167ebde 100644 --- a/contracts/child/NetworkParams.sol +++ b/contracts/child/NetworkParams.sol @@ -1,7 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts/access/Ownable2Step.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** @title NetworkParams @@ -9,82 +10,146 @@ import "@openzeppelin/contracts/access/Ownable.sol"; @notice Configurable network parameters that are read by the client on each epoch @dev The contract allows for configurable network parameters without the need for a hardfork */ -contract NetworkParams is Ownable { - uint256 public blockGasLimit; +contract NetworkParams is Ownable2Step, Initializable { + struct InitParams { + address newOwner; + uint256 newCheckpointBlockInterval; // in blocks + uint256 newEpochSize; // in blocks + uint256 newEpochReward; // in wei + uint256 newSprintSize; // in blocks + uint256 newMinValidatorSetSize; + uint256 newMaxValidatorSetSize; + uint256 newWithdrawalWaitPeriod; // in blocks + uint256 newBlockTime; // in seconds + uint256 newBlockTimeDrift; // in seconds + uint256 newVotingDelay; // in blocks + uint256 newVotingPeriod; // in blocks + uint256 newProposalThreshold; // in percent + uint256 newBaseFeeChangeDenom; // in wei + } + uint256 public checkpointBlockInterval; // in blocks - uint256 public minStake; // in wei + uint256 public epochSize; // in blocks + uint256 public epochReward; // in wei + uint256 public sprintSize; // in blocks + uint256 public minValidatorSetSize; uint256 public maxValidatorSetSize; + uint256 public withdrawalWaitPeriod; // in blocks + uint256 public blockTime; // in seconds + uint256 public blockTimeDrift; // in seconds + uint256 public votingDelay; // in blocks + uint256 public votingPeriod; // in blocks + uint256 public proposalThreshold; // in percent + uint256 public baseFeeChangeDenom; // in wei - event NewBlockGasLimit(uint256 indexed value); - event NewCheckpointBlockInterval(uint256 indexed value); - event NewMinStake(uint256 indexed value); - event NewMaxValdidatorSetSize(uint256 indexed value); + event NewCheckpointBlockInterval(uint256 indexed checkpointInterval); + event NewEpochSize(uint256 indexed size); + event NewEpochReward(uint256 indexed reward); + event NewSprintSize(uint256 indexed size); + event NewMinValidatorSetSize(uint256 indexed minValidatorSet); + event NewMaxValidatorSetSize(uint256 indexed maxValidatorSet); + event NewWithdrawalWaitPeriod(uint256 indexed withdrawalPeriod); + event NewBlockTime(uint256 indexed blockTime); + event NewBlockTimeDrift(uint256 indexed blockTimeDrift); + event NewVotingDelay(uint256 indexed votingDelay); + event NewVotingPeriod(uint256 indexed votingPeriod); + event NewProposalThreshold(uint256 indexed proposalThreshold); + event NewBaseFeeChangeDenom(uint256 indexed baseFeeChangeDenom); /** * @notice initializer for NetworkParams, sets the initial set of values for the network * @dev disallows setting of zero values for sanity check purposes - * @param newOwner address of the contract controller to be set at deployment - * @param newBlockGasLimit initial block gas limit - * @param newCheckpointBlockInterval initial checkpoint interval - * @param newMinStake initial minimum stake - * @param newMaxValidatorSetSize initial max validator set size + * @param initParams initial set of values for the network */ - constructor( - address newOwner, - uint256 newBlockGasLimit, - uint256 newCheckpointBlockInterval, - uint256 newMinStake, - uint256 newMaxValidatorSetSize - ) { + function initialize(InitParams memory initParams) public initializer { require( - newOwner != address(0) && - newBlockGasLimit != 0 && - newMinStake != 0 && - newCheckpointBlockInterval != 0 && - newMaxValidatorSetSize != 0, + initParams.newOwner != address(0) && + initParams.newCheckpointBlockInterval != 0 && + initParams.newEpochSize != 0 && + initParams.newSprintSize != 0 && + initParams.newMinValidatorSetSize != 0 && + initParams.newMaxValidatorSetSize != 0 && + initParams.newWithdrawalWaitPeriod != 0 && + initParams.newBlockTime != 0 && + initParams.newBlockTimeDrift != 0 && + initParams.newVotingPeriod != 0 && + initParams.newBaseFeeChangeDenom != 0, "NetworkParams: INVALID_INPUT" ); - blockGasLimit = newBlockGasLimit; + checkpointBlockInterval = initParams.newCheckpointBlockInterval; + epochSize = initParams.newEpochSize; + epochReward = initParams.newEpochReward; + sprintSize = initParams.newSprintSize; + minValidatorSetSize = initParams.newMinValidatorSetSize; + maxValidatorSetSize = initParams.newMaxValidatorSetSize; + withdrawalWaitPeriod = initParams.newWithdrawalWaitPeriod; + blockTime = initParams.newBlockTime; + blockTimeDrift = initParams.newBlockTimeDrift; + votingDelay = initParams.newVotingDelay; + votingPeriod = initParams.newVotingPeriod; + proposalThreshold = initParams.newProposalThreshold; + baseFeeChangeDenom = initParams.newBaseFeeChangeDenom; + _transferOwnership(initParams.newOwner); + } + + /** + * @notice function to set new checkpoint block interval + * @dev disallows setting of a zero value for sanity check purposes + * @param newCheckpointBlockInterval new checkpoint block interval + */ + function setNewCheckpointBlockInterval(uint256 newCheckpointBlockInterval) external onlyOwner { + require(newCheckpointBlockInterval != 0, "NetworkParams: INVALID_CHECKPOINT_INTERVAL"); checkpointBlockInterval = newCheckpointBlockInterval; - minStake = newMinStake; - maxValidatorSetSize = newMaxValidatorSetSize; - _transferOwnership(newOwner); + + emit NewCheckpointBlockInterval(newCheckpointBlockInterval); } /** - * @notice function to set new block gas limit + * @notice function to set new epoch size * @dev disallows setting of a zero value for sanity check purposes - * @param newBlockGasLimit new block gas limit + * @param newEpochSize new epoch reward */ - function setNewBlockGasLimit(uint256 newBlockGasLimit) external onlyOwner { - require(newBlockGasLimit != 0, "NetworkParams: INVALID_BLOCK_GAS_LIMIT"); - blockGasLimit = newBlockGasLimit; + function setNewEpochSize(uint256 newEpochSize) external onlyOwner { + require(newEpochSize != 0, "NetworkParams: INVALID_EPOCH_SIZE"); + epochSize = newEpochSize; - emit NewBlockGasLimit(newBlockGasLimit); + emit NewEpochSize(newEpochSize); } /** - * @notice function to set new checkpoint block interval + * @notice function to set new epoch reward * @dev disallows setting of a zero value for sanity check purposes - * @param newCheckpointBlockInterval new checkpoint block interval + * @param newEpochReward new epoch reward */ - function setNewCheckpointBlockInterval(uint256 newCheckpointBlockInterval) external onlyOwner { - require(newCheckpointBlockInterval != 0, "NetworkParams: INVALID_CHECKPOINT_INTERVAL"); - checkpointBlockInterval = newCheckpointBlockInterval; + function setNewEpochReward(uint256 newEpochReward) external onlyOwner { + epochReward = newEpochReward; - emit NewCheckpointBlockInterval(newCheckpointBlockInterval); + emit NewEpochReward(newEpochReward); + } + + /** + * @notice function to set new sprint size + * @dev disallows setting of a zero value for sanity check purposes + * @param newSprintSize new sprint size + */ + function setNewSprintSize(uint256 newSprintSize) external onlyOwner { + require(newSprintSize != 0, "NetworkParams: INVALID_SPRINT_SIZE"); + sprintSize = newSprintSize; + + emit NewSprintSize(newSprintSize); } /** - * @notice function to set new minimum stake + * @notice function to set new minimum validator set size * @dev disallows setting of a zero value for sanity check purposes - * @param newMinStake new minimum stake + * @param newMinValidatorSetSize new minimum validator set size */ - function setNewMinStake(uint256 newMinStake) external onlyOwner { - require(newMinStake != 0, "NetworkParams: INVALID_MIN_STAKE"); - minStake = newMinStake; + // slither-disable-next-line similar-names + function setNewMinValidatorSetSize(uint256 newMinValidatorSetSize) external onlyOwner { + require(newMinValidatorSetSize != 0, "NetworkParams: INVALID_MIN_VALIDATOR_SET_SIZE"); + minValidatorSetSize = newMinValidatorSetSize; - emit NewMinStake(newMinStake); + emit NewMinValidatorSetSize(newMinValidatorSetSize); } /** @@ -92,10 +157,93 @@ contract NetworkParams is Ownable { * @dev disallows setting of a zero value for sanity check purposes * @param newMaxValidatorSetSize new maximum validator set size */ + // slither-disable-next-line similar-names function setNewMaxValidatorSetSize(uint256 newMaxValidatorSetSize) external onlyOwner { require(newMaxValidatorSetSize != 0, "NetworkParams: INVALID_MAX_VALIDATOR_SET_SIZE"); maxValidatorSetSize = newMaxValidatorSetSize; - emit NewMaxValdidatorSetSize(newMaxValidatorSetSize); + emit NewMaxValidatorSetSize(newMaxValidatorSetSize); + } + + /** + * @notice function to set new withdrawal wait period + * @dev disallows setting of a zero value for sanity check purposes + * @param newWithdrawalWaitPeriod new withdrawal wait period + */ + function setNewWithdrawalWaitPeriod(uint256 newWithdrawalWaitPeriod) external onlyOwner { + require(newWithdrawalWaitPeriod != 0, "NetworkParams: INVALID_WITHDRAWAL_WAIT_PERIOD"); + withdrawalWaitPeriod = newWithdrawalWaitPeriod; + + emit NewWithdrawalWaitPeriod(newWithdrawalWaitPeriod); + } + + /** + * @notice function to set new block time + * @dev disallows setting of a zero value for sanity check purposes + * @param newBlockTime new block time + */ + function setNewBlockTime(uint256 newBlockTime) external onlyOwner { + require(newBlockTime != 0, "NetworkParams: INVALID_BLOCK_TIME"); + blockTime = newBlockTime; + + emit NewBlockTime(newBlockTime); + } + + /** + * @notice function to set new block time drift + * @dev disallows setting of a zero value for sanity check purposes + * @param newBlockTimeDrift new block time drift + */ + function setNewBlockTimeDrift(uint256 newBlockTimeDrift) external onlyOwner { + require(newBlockTimeDrift != 0, "NetworkParams: INVALID_BLOCK_TIME_DRIFT"); + blockTimeDrift = newBlockTimeDrift; + + emit NewBlockTimeDrift(newBlockTimeDrift); + } + + /** + * @notice function to set new voting delay + * @dev disallows setting of a zero value for sanity check purposes + * @param newVotingDelay new voting delay + */ + function setNewVotingDelay(uint256 newVotingDelay) external onlyOwner { + votingDelay = newVotingDelay; + + emit NewVotingDelay(newVotingDelay); + } + + /** + * @notice function to set new voting period + * @dev disallows setting of a zero value for sanity check purposes + * @param newVotingPeriod new voting period + */ + function setNewVotingPeriod(uint256 newVotingPeriod) external onlyOwner { + require(newVotingPeriod != 0, "NetworkParams: INVALID_VOTING_PERIOD"); + votingPeriod = newVotingPeriod; + + emit NewVotingPeriod(newVotingPeriod); + } + + /** + * @notice function to set new proposal threshold + * @dev disallows setting of a zero value for sanity check purposes + * @param newProposalThreshold new proposal threshold + */ + function setNewProposalThreshold(uint256 newProposalThreshold) external onlyOwner { + proposalThreshold = newProposalThreshold; + + emit NewProposalThreshold(newProposalThreshold); + } + + /** + * @notice function to set new base fee change denominator + * @dev disallows setting of a zero value for sanity check purposes + * @param newBaseFeeChangeDenom new base fee change denominator + */ + function setNewBaseFeeChangeDenom(uint256 newBaseFeeChangeDenom) external onlyOwner { + require(newBaseFeeChangeDenom != 0, "NetworkParams: INVALID_BASE_FEE_CHANGE_DENOM"); + baseFeeChangeDenom = newBaseFeeChangeDenom; + + emit NewBaseFeeChangeDenom(newBaseFeeChangeDenom); } } diff --git a/contracts/child/RootMintableERC1155Predicate.sol b/contracts/child/RootMintableERC1155Predicate.sol index e1a203c8..e5e625e0 100644 --- a/contracts/child/RootMintableERC1155Predicate.sol +++ b/contracts/child/RootMintableERC1155Predicate.sol @@ -21,7 +21,7 @@ contract RootMintableERC1155Predicate is Initializable, ERC1155Holder, IRootMint mapping(address => address) public rootTokenToChildToken; /** - * @notice Initilization function for RootMintableERC1155Predicate + * @notice Initialization function for RootMintableERC1155Predicate * @param newL2StateSender Address of L2StateSender to send deposit information to * @param newStateReceiver Address of StateReceiver to receive withdrawal information from * @param newChildERC1155Predicate Address of child ERC1155 predicate to communicate with @@ -33,17 +33,7 @@ contract RootMintableERC1155Predicate is Initializable, ERC1155Holder, IRootMint address newChildERC1155Predicate, address newChildTokenTemplate ) external initializer { - require( - newL2StateSender != address(0) && - newStateReceiver != address(0) && - newChildERC1155Predicate != address(0) && - newChildTokenTemplate != address(0), - "RootMintableERC1155Predicate: BAD_INITIALIZATION" - ); - l2StateSender = IStateSender(newL2StateSender); - stateReceiver = newStateReceiver; - childERC1155Predicate = newChildERC1155Predicate; - childTokenTemplate = newChildTokenTemplate; + _initialize(newL2StateSender, newStateReceiver, newChildERC1155Predicate, newChildTokenTemplate); } /** @@ -56,9 +46,13 @@ contract RootMintableERC1155Predicate is Initializable, ERC1155Holder, IRootMint require(sender == childERC1155Predicate, "RootMintableERC1155Predicate: ONLY_CHILD_PREDICATE"); if (bytes32(data[:32]) == WITHDRAW_SIG) { + _beforeTokenWithdraw(); _withdraw(data[32:]); + _afterTokenWithdraw(); } else if (bytes32(data[:32]) == WITHDRAW_BATCH_SIG) { + _beforeTokenWithdraw(); _withdrawBatch(data); + _afterTokenWithdraw(); } else { revert("RootMintableERC1155Predicate: INVALID_SIGNATURE"); } @@ -104,10 +98,12 @@ contract RootMintableERC1155Predicate is Initializable, ERC1155Holder, IRootMint "RootMintableERC1155Predicate: ALREADY_MAPPED" ); + address childPredicate = childERC1155Predicate; + childToken = Clones.predictDeterministicAddress( childTokenTemplate, keccak256(abi.encodePacked(rootToken)), - childERC1155Predicate + childPredicate ); rootTokenToChildToken[address(rootToken)] = childToken; @@ -119,12 +115,44 @@ contract RootMintableERC1155Predicate is Initializable, ERC1155Holder, IRootMint uri = tokenUri; } catch {} - l2StateSender.syncState(childERC1155Predicate, abi.encode(MAP_TOKEN_SIG, rootToken, uri)); + l2StateSender.syncState(childPredicate, abi.encode(MAP_TOKEN_SIG, rootToken, uri)); // slither-disable-next-line reentrancy-events emit L2MintableTokenMapped(address(rootToken), childToken); } + function _initialize( + address newL2StateSender, + address newStateReceiver, + address newChildERC1155Predicate, + address newChildTokenTemplate + ) internal { + require( + newL2StateSender != address(0) && + newStateReceiver != address(0) && + newChildERC1155Predicate != address(0) && + newChildTokenTemplate != address(0), + "RootMintableERC1155Predicate: BAD_INITIALIZATION" + ); + l2StateSender = IStateSender(newL2StateSender); + stateReceiver = newStateReceiver; + childERC1155Predicate = newChildERC1155Predicate; + childTokenTemplate = newChildTokenTemplate; + } + + // solhint-disable no-empty-blocks + // slither-disable-start dead-code + function _beforeTokenDeposit() internal virtual {} + + function _beforeTokenWithdraw() internal virtual {} + + function _afterTokenDeposit() internal virtual {} + + function _afterTokenWithdraw() internal virtual {} + + // slither-disable-end dead-code + function _deposit(IERC1155MetadataURI rootToken, address receiver, uint256 tokenId, uint256 amount) private { + _beforeTokenDeposit(); address childToken = _getChildToken(rootToken); rootToken.safeTransferFrom(msg.sender, address(this), tokenId, amount, ""); @@ -135,6 +163,7 @@ contract RootMintableERC1155Predicate is Initializable, ERC1155Holder, IRootMint ); // slither-disable-next-line reentrancy-events emit L2MintableERC1155Deposit(address(rootToken), childToken, msg.sender, receiver, tokenId, amount); + _afterTokenDeposit(); } function _depositBatch( @@ -143,6 +172,7 @@ contract RootMintableERC1155Predicate is Initializable, ERC1155Holder, IRootMint uint256[] calldata tokenIds, uint256[] calldata amounts ) private { + _beforeTokenDeposit(); address childToken = _getChildToken(rootToken); for (uint256 i = 0; i < tokenIds.length; ) { @@ -158,6 +188,7 @@ contract RootMintableERC1155Predicate is Initializable, ERC1155Holder, IRootMint ); // slither-disable-next-line reentrancy-events emit L2MintableERC1155DepositBatch(address(rootToken), childToken, msg.sender, receivers, tokenIds, amounts); + _afterTokenDeposit(); } function _withdraw(bytes calldata data) private { @@ -199,4 +230,7 @@ contract RootMintableERC1155Predicate is Initializable, ERC1155Holder, IRootMint if (childToken == address(0)) childToken = mapToken(IERC1155MetadataURI(rootToken)); assert(childToken != address(0)); // invariant because we map the token if mapping does not exist } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/RootMintableERC1155PredicateAccessList.sol b/contracts/child/RootMintableERC1155PredicateAccessList.sol new file mode 100644 index 00000000..c4b79740 --- /dev/null +++ b/contracts/child/RootMintableERC1155PredicateAccessList.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {RootMintableERC1155Predicate} from "./RootMintableERC1155Predicate.sol"; +import {AccessList} from "../lib/AccessList.sol"; + +/** + @title RootMintableERC1155PredicateAccessList + @author Polygon Technology (@QEDK) + @notice Enables child-chain origin ERC1155 token deposits and withdrawals (only from allowlisted address, and not from blocklisted addresses) across an arbitrary root chain and child chain + */ +// solhint-disable reason-string +contract RootMintableERC1155PredicateAccessList is AccessList, RootMintableERC1155Predicate { + function initialize( + address newL2StateSender, + address newStateReceiver, + address newChildERC1155Predicate, + address newChildTokenTemplate, + bool newUseAllowList, + bool newUseBlockList, + address newOwner + ) public virtual onlySystemCall initializer { + _initialize(newL2StateSender, newStateReceiver, newChildERC1155Predicate, newChildTokenTemplate); + _initializeAccessList(newUseAllowList, newUseBlockList); + _transferOwnership(newOwner); + } + + function _beforeTokenDeposit() internal virtual override { + _checkAccessList(); + } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; +} diff --git a/contracts/child/RootMintableERC20Predicate.sol b/contracts/child/RootMintableERC20Predicate.sol index eda0a349..1d9e8314 100644 --- a/contracts/child/RootMintableERC20Predicate.sol +++ b/contracts/child/RootMintableERC20Predicate.sol @@ -27,7 +27,7 @@ contract RootMintableERC20Predicate is IRootMintableERC20Predicate, Initializabl mapping(address => address) public rootTokenToChildToken; /** - * @notice Initilization function for RootMintableERC20Predicate + * @notice Initialization function for RootMintableERC20Predicate * @param newL2StateSender Address of L2StateSender to send exit information to * @param newStateReceiver Address of StateReceiver to receive deposit information from * @param newChildERC20Predicate Address of child ERC20 predicate to communicate with @@ -172,4 +172,7 @@ contract RootMintableERC20Predicate is IRootMintableERC20Predicate, Initializabl // slither-disable-next-line reentrancy-events emit L2MintableERC20Withdraw(address(rootToken), childToken, withdrawer, receiver, amount); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/RootMintableERC20PredicateAccessList.sol b/contracts/child/RootMintableERC20PredicateAccessList.sol new file mode 100644 index 00000000..97dee441 --- /dev/null +++ b/contracts/child/RootMintableERC20PredicateAccessList.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {RootMintableERC20Predicate} from "./RootMintableERC20Predicate.sol"; +import {AccessList} from "../lib/AccessList.sol"; + +/** + @title RootMintableERC20PredicateAccessList + @author Polygon Technology (@QEDK) + @notice Enables child-chain origin ERC20 token deposits and withdrawals (only from allowlisted address, and not from blocklisted addresses) across an arbitrary root chain and child chain + */ +// solhint-disable reason-string +contract RootMintableERC20PredicateAccessList is AccessList, RootMintableERC20Predicate { + function initialize( + address newL2StateSender, + address newStateReceiver, + address newChildERC20Predicate, + address newChildTokenTemplate, + bool newUseAllowList, + bool newUseBlockList, + address newOwner + ) public virtual onlySystemCall initializer { + _initialize(newL2StateSender, newStateReceiver, newChildERC20Predicate, newChildTokenTemplate); + _initializeAccessList(newUseAllowList, newUseBlockList); + _transferOwnership(newOwner); + } + + function _beforeTokenDeposit() internal virtual override { + _checkAccessList(); + } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; +} diff --git a/contracts/child/RootMintableERC721Predicate.sol b/contracts/child/RootMintableERC721Predicate.sol index 168ee574..8524122a 100644 --- a/contracts/child/RootMintableERC721Predicate.sol +++ b/contracts/child/RootMintableERC721Predicate.sol @@ -22,7 +22,7 @@ contract RootMintableERC721Predicate is Initializable, ERC721Holder, System, IRo mapping(address => address) public rootTokenToChildToken; /** - * @notice Initilization function for RootMintableERC721Predicate + * @notice Initialization function for RootMintableERC721Predicate * @param newL2StateSender Address of L2StateSender to send deposit information to * @param newStateReceiver Address of StateReceiver to receive withdrawal information from * @param newChildERC721Predicate Address of child ERC721 predicate to communicate with @@ -48,9 +48,13 @@ contract RootMintableERC721Predicate is Initializable, ERC721Holder, System, IRo require(sender == childERC721Predicate, "RootMintableERC721Predicate: ONLY_CHILD_PREDICATE"); if (bytes32(data[:32]) == WITHDRAW_SIG) { + _beforeTokenWithdraw(); _withdraw(data[32:]); + _afterTokenWithdraw(); } else if (bytes32(data[:32]) == WITHDRAW_BATCH_SIG) { + _beforeTokenWithdraw(); _withdrawBatch(data); + _afterTokenWithdraw(); } else { revert("RootMintableERC721Predicate: INVALID_SIGNATURE"); } @@ -89,16 +93,18 @@ contract RootMintableERC721Predicate is Initializable, ERC721Holder, System, IRo require(address(rootToken) != address(0), "RootMintableERC721Predicate: INVALID_TOKEN"); require(rootTokenToChildToken[address(rootToken)] == address(0), "RootMintableERC721Predicate: ALREADY_MAPPED"); + address childPredicate = childERC721Predicate; + address childToken = Clones.predictDeterministicAddress( childTokenTemplate, keccak256(abi.encodePacked(rootToken)), - childERC721Predicate + childPredicate ); rootTokenToChildToken[address(rootToken)] = childToken; l2StateSender.syncState( - childERC721Predicate, + childPredicate, abi.encode(MAP_TOKEN_SIG, rootToken, rootToken.name(), rootToken.symbol()) ); // slither-disable-next-line reentrancy-events @@ -106,6 +112,18 @@ contract RootMintableERC721Predicate is Initializable, ERC721Holder, System, IRo return childToken; } + // solhint-disable no-empty-blocks + // slither-disable-start dead-code + function _beforeTokenDeposit() internal virtual {} + + function _beforeTokenWithdraw() internal virtual {} + + function _afterTokenDeposit() internal virtual {} + + function _afterTokenWithdraw() internal virtual {} + + // slither-disable-end dead-code + function _initialize( address newL2StateSender, address newStateReceiver, @@ -126,6 +144,7 @@ contract RootMintableERC721Predicate is Initializable, ERC721Holder, System, IRo } function _deposit(IERC721Metadata rootToken, address receiver, uint256 tokenId) private { + _beforeTokenDeposit(); address childToken = _getChildToken(rootToken); rootToken.safeTransferFrom(msg.sender, address(this), tokenId); @@ -136,6 +155,7 @@ contract RootMintableERC721Predicate is Initializable, ERC721Holder, System, IRo ); // slither-disable-next-line reentrancy-events emit L2MintableERC721Deposit(address(rootToken), childToken, msg.sender, receiver, tokenId); + _afterTokenDeposit(); } function _depositBatch( @@ -143,6 +163,7 @@ contract RootMintableERC721Predicate is Initializable, ERC721Holder, System, IRo address[] calldata receivers, uint256[] calldata tokenIds ) private { + _beforeTokenDeposit(); address childToken = _getChildToken(rootToken); for (uint256 i = 0; i < tokenIds.length; ) { @@ -158,6 +179,7 @@ contract RootMintableERC721Predicate is Initializable, ERC721Holder, System, IRo ); // slither-disable-next-line reentrancy-events emit L2MintableERC721DepositBatch(address(rootToken), childToken, msg.sender, receivers, tokenIds); + _afterTokenDeposit(); } function _withdraw(bytes calldata data) private { @@ -195,4 +217,7 @@ contract RootMintableERC721Predicate is Initializable, ERC721Holder, System, IRo if (childToken == address(0)) childToken = mapToken(IERC721Metadata(rootToken)); assert(childToken != address(0)); // invariant because we map the token if mapping does not exist } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/child/RootMintableERC721PredicateAccessList.sol b/contracts/child/RootMintableERC721PredicateAccessList.sol new file mode 100644 index 00000000..9064bc99 --- /dev/null +++ b/contracts/child/RootMintableERC721PredicateAccessList.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import {RootMintableERC721Predicate} from "./RootMintableERC721Predicate.sol"; +import {AccessList} from "../lib/AccessList.sol"; + +/** + @title RootMintableERC721PredicateAccessList + @author Polygon Technology (@QEDK) + @notice Enables child-chain origin ERC721 token deposits and withdrawals (only from allowlisted address, and not from blocklisted addresses) across an arbitrary root chain and child chain + */ +// solhint-disable reason-string +contract RootMintableERC721PredicateAccessList is AccessList, RootMintableERC721Predicate { + function initialize( + address newL2StateSender, + address newStateReceiver, + address newChildERC721Predicate, + address newChildTokenTemplate, + bool newUseAllowList, + bool newUseBlockList, + address newOwner + ) public virtual onlySystemCall initializer { + _initialize(newL2StateSender, newStateReceiver, newChildERC721Predicate, newChildTokenTemplate); + _initializeAccessList(newUseAllowList, newUseBlockList); + _transferOwnership(newOwner); + } + + function _beforeTokenDeposit() internal virtual override { + _checkAccessList(); + } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; +} diff --git a/contracts/child/governance/ChildGovernor.sol b/contracts/child/governance/ChildGovernor.sol new file mode 100644 index 00000000..6f8828dc --- /dev/null +++ b/contracts/child/governance/ChildGovernor.sol @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "@openzeppelin/contracts-upgradeable/governance/GovernorUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/governance/compatibility/GovernorCompatibilityBravoUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorVotesUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorVotesQuorumFractionUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorTimelockControlUpgradeable.sol"; + +import {NetworkParams} from "contracts/child/NetworkParams.sol"; + +contract ChildGovernor is + GovernorUpgradeable, + GovernorCompatibilityBravoUpgradeable, + GovernorVotesUpgradeable, + GovernorVotesQuorumFractionUpgradeable, + GovernorTimelockControlUpgradeable +{ + NetworkParams private _networkParams; + + function initialize( + IVotesUpgradeable token_, + TimelockControllerUpgradeable timelock_, + uint256 quorumNumerator_, + address networkParams + ) public initializer { + __Governor_init("ChildGovernor"); + __GovernorTimelockControl_init(timelock_); + __GovernorVotes_init(token_); + __GovernorVotesQuorumFraction_init(quorumNumerator_); + + _networkParams = NetworkParams(networkParams); + } + + // TODO: adjust values for block time of child chain + + function votingDelay() public view override returns (uint256) { + return _networkParams.votingDelay(); + } + + function votingPeriod() public view override returns (uint256) { + return _networkParams.votingPeriod(); + } + + // END TODO + + function proposalThreshold() public view override returns (uint256) { + return _networkParams.proposalThreshold(); + } + + // The functions below are overrides required by Solidity. + + function state( + uint256 proposalId + ) + public + view + override(GovernorUpgradeable, IGovernorUpgradeable, GovernorTimelockControlUpgradeable) + returns (ProposalState) + { + return super.state(proposalId); + } + + function propose( + address[] memory targets, + uint256[] memory values, + bytes[] memory calldatas, + string memory description + ) + public + override(GovernorUpgradeable, GovernorCompatibilityBravoUpgradeable, IGovernorUpgradeable) + returns (uint256) + { + return super.propose(targets, values, calldatas, description); + } + + function _execute( + uint256 proposalId, + address[] memory targets, + uint256[] memory values, + bytes[] memory calldatas, + bytes32 descriptionHash + ) internal override(GovernorUpgradeable, GovernorTimelockControlUpgradeable) { + super._execute(proposalId, targets, values, calldatas, descriptionHash); + } + + function _cancel( + address[] memory targets, + uint256[] memory values, + bytes[] memory calldatas, + bytes32 descriptionHash + ) internal override(GovernorUpgradeable, GovernorTimelockControlUpgradeable) returns (uint256) { + return super._cancel(targets, values, calldatas, descriptionHash); + } + + function _executor() + internal + view + override(GovernorUpgradeable, GovernorTimelockControlUpgradeable) + returns (address) + { + return super._executor(); + } + + function supportsInterface( + bytes4 interfaceId + ) public view override(GovernorUpgradeable, IERC165Upgradeable, GovernorTimelockControlUpgradeable) returns (bool) { + return super.supportsInterface(interfaceId); + } + + function cancel( + address[] memory targets, + uint256[] memory values, + bytes[] memory calldatas, + bytes32 descriptionHash + ) + public + override(IGovernorUpgradeable, GovernorUpgradeable, GovernorCompatibilityBravoUpgradeable) + returns (uint256) + { + return super.cancel(targets, values, calldatas, descriptionHash); + } +} diff --git a/contracts/child/governance/ChildTimelock.sol b/contracts/child/governance/ChildTimelock.sol new file mode 100644 index 00000000..adc826b4 --- /dev/null +++ b/contracts/child/governance/ChildTimelock.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "@openzeppelin/contracts-upgradeable/governance/TimelockControllerUpgradeable.sol"; + +contract ChildTimelock is TimelockControllerUpgradeable { + function initialize( + uint256 minDelay, + address[] memory proposers, + address[] memory executors, + address admin + ) public initializer { + __TimelockController_init(minDelay, proposers, executors, admin); + } +} diff --git a/contracts/child/governance/README.md b/contracts/child/governance/README.md new file mode 100644 index 00000000..0900ba82 --- /dev/null +++ b/contracts/child/governance/README.md @@ -0,0 +1,11 @@ +# Governance + +This directory contains contracts used in the governance of specific Supernets, and live on the Supernet itself. + +## ChildGovernor + +An implementation of OpenZeppelin's Governor Bravo (from the upgradeable version). + +## ChildTimelock + +A timelock in order to create a set delay between the initiation of a proposal and its execution. (An implementation of a base contract from OpenZeppelin which does the same.) diff --git a/contracts/child/validator/RewardPool.sol b/contracts/child/validator/RewardPool.sol index 775507a1..72b7fa95 100644 --- a/contracts/child/validator/RewardPool.sol +++ b/contracts/child/validator/RewardPool.sol @@ -7,22 +7,25 @@ import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeab import "../System.sol"; import "../../interfaces/child/validator/IRewardPool.sol"; +import {NetworkParams} from "contracts/child/NetworkParams.sol"; + contract RewardPool is IRewardPool, System, Initializable { using SafeERC20Upgradeable for IERC20Upgradeable; IERC20Upgradeable public rewardToken; address public rewardWallet; IValidatorSet public validatorSet; - uint256 public baseReward; mapping(uint256 => uint256) public paidRewardPerEpoch; mapping(address => uint256) public pendingRewards; + NetworkParams private _networkParams; + function initialize( address newRewardToken, address newRewardWallet, address newValidatorSet, - uint256 newBaseReward + address networkParamsAddr ) public initializer { require( newRewardToken != address(0) && newRewardWallet != address(0) && newValidatorSet != address(0), @@ -32,19 +35,20 @@ contract RewardPool is IRewardPool, System, Initializable { rewardToken = IERC20Upgradeable(newRewardToken); rewardWallet = newRewardWallet; validatorSet = IValidatorSet(newValidatorSet); - baseReward = newBaseReward; + + _networkParams = NetworkParams(networkParamsAddr); } /** * @inheritdoc IRewardPool */ - function distributeRewardFor(uint256 epochId, Uptime[] calldata uptime) external onlySystemCall { + function distributeRewardFor(uint256 epochId, Uptime[] calldata uptime, uint256 epochSize) external onlySystemCall { require(paidRewardPerEpoch[epochId] == 0, "REWARD_ALREADY_DISTRIBUTED"); uint256 totalBlocks = validatorSet.totalBlocks(epochId); require(totalBlocks != 0, "EPOCH_NOT_COMMITTED"); - uint256 epochSize = validatorSet.EPOCH_SIZE(); // slither-disable-next-line divide-before-multiply - uint256 reward = (baseReward * totalBlocks) / epochSize; + uint256 reward = (_networkParams.epochReward() * totalBlocks) / epochSize; + // TODO disincentivize long epoch times uint256 totalSupply = validatorSet.totalSupplyAt(epochId); uint256 length = uptime.length; diff --git a/contracts/child/validator/ValidatorSet.sol b/contracts/child/validator/ValidatorSet.sol index 320238ff..e6a0dfb8 100644 --- a/contracts/child/validator/ValidatorSet.sol +++ b/contracts/child/validator/ValidatorSet.sol @@ -1,53 +1,57 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpgradeable.sol"; import "../../lib/WithdrawalQueue.sol"; import "../../interfaces/child/validator/IValidatorSet.sol"; import "../../interfaces/IStateSender.sol"; +import "../../child/NetworkParams.sol"; import "../System.sol"; -contract ValidatorSet is IValidatorSet, ERC20SnapshotUpgradeable, System { +///@dev Inherits a modified version of `ERC20VotesUpgradeable` with a shifted storage layout. +contract ValidatorSet is IValidatorSet, ERC20VotesUpgradeable, System { using WithdrawalQueueLib for WithdrawalQueue; - bytes32 private constant STAKE_SIG = keccak256("STAKE"); - bytes32 private constant UNSTAKE_SIG = keccak256("UNSTAKE"); - bytes32 private constant SLASH_SIG = keccak256("SLASH"); - uint256 public constant WITHDRAWAL_WAIT_PERIOD = 1; + bytes32 private constant _STAKE_SIG = keccak256("STAKE"); + bytes32 private constant _UNSTAKE_SIG = keccak256("UNSTAKE"); + bytes32 private constant _SLASH_SIG = keccak256("SLASH"); + uint256 public constant SLASHING_PERCENTAGE = 50; // to be read through NetworkParams later + uint256 public constant SLASH_INCENTIVE_PERCENTAGE = 30; // exitor reward, to be read through NetworkParams later - IStateSender private stateSender; - address private stateReceiver; - address private rootChainManager; - // slither-disable-next-line naming-convention - uint256 public EPOCH_SIZE; + IStateSender private _stateSender; + address private _stateReceiver; + address private _rootChainManager; uint256 public currentEpochId; mapping(uint256 => Epoch) public epochs; uint256[] public epochEndBlocks; - mapping(address => WithdrawalQueue) internal withdrawals; + mapping(address => WithdrawalQueue) private _withdrawals; + + NetworkParams private _networkParams; + mapping(uint256 => uint256) private _commitBlockNumbers; + + mapping(uint256 => bool) public slashProcessed; function initialize( address newStateSender, address newStateReceiver, address newRootChainManager, - uint256 newEpochSize, - ValidatorInit[] memory initalValidators + address newNetworkParams, + ValidatorInit[] memory initialValidators ) public initializer { require( - newStateSender != address(0) && - newStateReceiver != address(0) && - newRootChainManager != address(0) && - newEpochSize != 0, + newStateSender != address(0) && newStateReceiver != address(0) && newRootChainManager != address(0), "INVALID_INPUT" ); + __ERC20Permit_init("ValidatorSet"); __ERC20_init("ValidatorSet", "VSET"); - stateSender = IStateSender(newStateSender); - stateReceiver = newStateReceiver; - rootChainManager = newRootChainManager; - EPOCH_SIZE = newEpochSize; - for (uint256 i = 0; i < initalValidators.length; ) { - _stake(initalValidators[i].addr, initalValidators[i].stake); + _stateSender = IStateSender(newStateSender); + _stateReceiver = newStateReceiver; + _rootChainManager = newRootChainManager; + _networkParams = NetworkParams(newNetworkParams); + for (uint256 i = 0; i < initialValidators.length; ) { + _stake(initialValidators[i].addr, initialValidators[i].stake); unchecked { ++i; } @@ -59,22 +63,39 @@ contract ValidatorSet is IValidatorSet, ERC20SnapshotUpgradeable, System { /** * @inheritdoc IValidatorSet */ - function commitEpoch(uint256 id, Epoch calldata epoch) external onlySystemCall { + function commitEpoch(uint256 id, Epoch calldata epoch, uint256 epochSize) external onlySystemCall { uint256 newEpochId = currentEpochId++; require(id == newEpochId, "UNEXPECTED_EPOCH_ID"); require(epoch.endBlock > epoch.startBlock, "NO_BLOCKS_COMMITTED"); - require((epoch.endBlock - epoch.startBlock + 1) % EPOCH_SIZE == 0, "EPOCH_MUST_BE_DIVISIBLE_BY_EPOCH_SIZE"); + require((epoch.endBlock - epoch.startBlock + 1) % epochSize == 0, "EPOCH_MUST_BE_DIVISIBLE_BY_EPOCH_SIZE"); require(epochs[newEpochId - 1].endBlock + 1 == epoch.startBlock, "INVALID_START_BLOCK"); epochs[newEpochId] = epoch; + _commitBlockNumbers[newEpochId] = block.number; epochEndBlocks.push(epoch.endBlock); emit NewEpoch(id, epoch.startBlock, epoch.endBlock, epoch.epochRoot); } + /** + * @inheritdoc IValidatorSet + */ + function slash(address[] calldata validators) external onlySystemCall { + _stateSender.syncState( + _rootChainManager, + abi.encode(_SLASH_SIG, validators, SLASHING_PERCENTAGE, SLASH_INCENTIVE_PERCENTAGE) + ); + } + function onStateReceive(uint256 /*counter*/, address sender, bytes calldata data) external override { - require(msg.sender == stateReceiver && sender == rootChainManager, "INVALID_SENDER"); - if (bytes32(data[:32]) == STAKE_SIG) { + require(msg.sender == _stateReceiver && sender == _rootChainManager, "INVALID_SENDER"); + if (bytes32(data[:32]) == _STAKE_SIG) { (address validator, uint256 amount) = abi.decode(data[32:], (address, uint256)); _stake(validator, amount); + } else if (bytes32(data[:32]) == _SLASH_SIG) { + (, uint256 exitEventId, address[] memory validatorsToSlash, ) = abi.decode( + data, + (bytes32, uint256, address[], uint256) + ); + _slash(exitEventId, validatorsToSlash); } } @@ -90,25 +111,26 @@ contract ValidatorSet is IValidatorSet, ERC20SnapshotUpgradeable, System { * @inheritdoc IValidatorSet */ function withdraw() external { - WithdrawalQueue storage queue = withdrawals[msg.sender]; + WithdrawalQueue storage queue = _withdrawals[msg.sender]; (uint256 amount, uint256 newHead) = queue.withdrawable(currentEpochId); queue.head = newHead; emit Withdrawal(msg.sender, amount); - stateSender.syncState(rootChainManager, abi.encode(UNSTAKE_SIG, msg.sender, amount)); + _stateSender.syncState(_rootChainManager, abi.encode(_UNSTAKE_SIG, msg.sender, amount)); } /** * @inheritdoc IValidatorSet */ + // slither-disable-next-line unused-return function withdrawable(address account) external view returns (uint256 amount) { - (amount, ) = withdrawals[account].withdrawable(currentEpochId); + (amount, ) = _withdrawals[account].withdrawable(currentEpochId); } /** * @inheritdoc IValidatorSet */ function pendingWithdrawals(address account) external view returns (uint256) { - return withdrawals[account].pending(currentEpochId); + return _withdrawals[account].pending(currentEpochId); } /** @@ -119,30 +141,38 @@ contract ValidatorSet is IValidatorSet, ERC20SnapshotUpgradeable, System { length = endBlock == 0 ? 0 : endBlock - epochs[epochId].startBlock + 1; } + function balanceOfAt(address account, uint256 epochNumber) external view returns (uint256) { + return super.getPastVotes(account, _commitBlockNumbers[epochNumber]); + } + + function totalSupplyAt(uint256 epochNumber) external view returns (uint256) { + return super.getPastTotalSupply(_commitBlockNumbers[epochNumber]); + } + function _registerWithdrawal(address account, uint256 amount) internal { - withdrawals[account].append(amount, currentEpochId + WITHDRAWAL_WAIT_PERIOD); + _withdrawals[account].append(amount, currentEpochId + _networkParams.withdrawalWaitPeriod()); emit WithdrawalRegistered(account, amount); } - /// @dev no public facing slashing function implemented yet - // slither-disable-next-line dead-code - function _slash(address validator) internal { - // unstake validator - _burn(validator, balanceOf(validator)); - // remove pending withdrawals - // slither-disable-next-line mapping-deletion - delete withdrawals[validator]; - // slash validator - stateSender.syncState(rootChainManager, abi.encode(SLASH_SIG, validator)); + function _slash(uint256 exitEventId, address[] memory validatorsToSlash) internal { + require(!slashProcessed[exitEventId], "SLASH_ALREADY_PROCESSED"); // sanity check + slashProcessed[exitEventId] = true; + uint256 length = validatorsToSlash.length; + for (uint256 i = 0; i < length; ) { + _burn(validatorsToSlash[i], balanceOf(validatorsToSlash[i])); // unstake validator + // slither-disable-next-line mapping-deletion + delete _withdrawals[validatorsToSlash[i]]; // remove pending withdrawals + unchecked { + ++i; + } + } + emit Slashed(exitEventId, validatorsToSlash); } function _stake(address validator, uint256 amount) internal { + assert(balanceOf(validator) + amount <= _maxSupply()); _mint(validator, amount); - } - - /// @dev the epoch number is also the snapshot id - function _getCurrentSnapshotId() internal view override returns (uint256) { - return currentEpochId; + _delegate(validator, validator); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal override { @@ -150,16 +180,8 @@ contract ValidatorSet is IValidatorSet, ERC20SnapshotUpgradeable, System { super._beforeTokenTransfer(from, to, amount); } - function balanceOfAt( - address account, - uint256 epochNumber - ) public view override(ERC20SnapshotUpgradeable, IValidatorSet) returns (uint256) { - return super.balanceOfAt(account, epochNumber); - } - - function totalSupplyAt( - uint256 epochNumber - ) public view override(ERC20SnapshotUpgradeable, IValidatorSet) returns (uint256) { - return super.totalSupplyAt(epochNumber); + function _delegate(address delegator, address delegatee) internal override { + if (delegator != delegatee) revert("DELEGATION_FORBIDDEN"); + super._delegate(delegator, delegatee); } } diff --git a/contracts/common/BN256G2.sol b/contracts/common/BN256G2.sol index e9da2a9c..0885f712 100644 --- a/contracts/common/BN256G2.sol +++ b/contracts/common/BN256G2.sol @@ -161,7 +161,7 @@ contract BN256G2 is IBN256G2 { // } /** - * @notice FQ2-FQ2 substraction operation + * @notice FQ2-FQ2 subtraction operation * @param xx First FQ2 operands first coordinate * @param xy First FQ2 operands second coordinate * @param yx Second FQ2 operands first coordinate @@ -227,7 +227,7 @@ contract BN256G2 is IBN256G2 { /** * @notice Calculates the modular inverse of a over n - * @param a The operand to calcualte the inverse of + * @param a The operand to calculate the inverse of * @param n The modulus * @return result Inv(a)modn **/ diff --git a/contracts/common/Merkle.sol b/contracts/common/Merkle.sol index 25eaa132..f9fbfc7f 100644 --- a/contracts/common/Merkle.sol +++ b/contracts/common/Merkle.sol @@ -1,62 +1,70 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import "@openzeppelin/contracts/utils/math/Math.sol"; - /** * @title Merkle - * @author Polygon Technology (similar to ENS, but written from scratch) - * @notice library for checking membership in a merkle tree + * @author QEDK + * @notice Gas optimized verification of proof of inclusion for a leaf in an ordered Merkle tree */ library Merkle { - using Math for uint256; - /** * @notice checks membership of a leaf in a merkle tree * @param leaf keccak256 hash to check the membership of * @param index position of the hash in the tree * @param rootHash root hash of the merkle tree * @param proof an array of hashes needed to prove the membership of the leaf - * @return a boolean value indicating if the leaf is in the tree or not + * @return isMember boolean value indicating if the leaf is in the tree or not */ function checkMembership( bytes32 leaf, uint256 index, bytes32 rootHash, bytes32[] calldata proof - ) internal pure returns (bool) { - uint256 proofHeight = proof.length; - // if the proof is of size n, the tree height will be n+1 - // in a tree of height n+1, max possible leaves are 2^n - require(index < 2 ** proofHeight, "INVALID_LEAF_INDEX"); - // refuse to accept padded leaves as proof - require(leaf != bytes32(0), "INVALID_LEAF"); - - bytes32 computedHash = leaf; - - for (uint256 i = 0; i < proofHeight; ++i) { - bytes32 proofElement = proof[i]; - - if (index % 2 == 0) { - // if index is even, proof must be to the right - computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); - } else { - // if index is odd, proof is to the left - computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); + ) internal pure returns (bool isMember) { + // solhint-disable-next-line no-inline-assembly + // slither-disable-next-line assembly + assembly ("memory-safe") { + // if proof is empty, check if the leaf is the root + if proof.length { + // set end to be the end of the proof array, shl(5, proof.length) is equivalent to proof.length * 32 + let end := add(proof.offset, shl(5, proof.length)) + // set iterator to the start of the proof array + let i := proof.offset + // prettier-ignore + // solhint-disable-next-line no-empty-blocks + for {} 1 {} { + // if index is odd, leaf slot is at 0x20, else 0x0 + let leafSlot := shl(5, and(0x1, index)) + // store the leaf at the calculated slot + mstore(leafSlot, leaf) + // store proof element in whichever slot is not occupied by the leaf + mstore(xor(leafSlot, 32), calldataload(i)) + // hash the first 64 bytes in memory + leaf := keccak256(0, 64) + // shift index right by 1 bit to divide by 2 + index := shr(1, index) + // increment iterator by 32 bytes + i := add(i, 32) + // break if iterator is at the end of the proof array + if iszero(lt(i, end)) { + break + } + } } - index /= 2; + // checks if the calculated root matches the expected root + // then, check if index was zeroed while calculating proof, else an invalid index was provided + isMember := and(eq(leaf, rootHash), iszero(index)) } - return computedHash == rootHash; } /** * @notice checks membership of a leaf in a merkle tree with expected height * @param leaf keccak256 hash to check the membership of * @param index position of the hash in the tree - * @param numLeaves number of leaves in the merkle tree (used to calculate the proof length) + * @param numLeaves number of leaves in the merkle tree (used to check the proof length) * @param rootHash root hash of the merkle tree * @param proof an array of hashes needed to prove the membership of the leaf - * @return bool a boolean value indicating if the leaf is in the tree or not + * @return isMember a boolean value indicating if the leaf is in the tree or not */ function checkMembershipWithHeight( bytes32 leaf, @@ -64,29 +72,45 @@ library Merkle { uint256 numLeaves, bytes32 rootHash, bytes32[] calldata proof - ) internal pure returns (bool) { - uint256 proofHeight = proof.length; - require(proofHeight == numLeaves.log2(Math.Rounding.Up), "INVALID_PROOF_LENGTH"); - // if the proof is of size n, the tree height will be n+1 - // in a tree of height n+1, max possible leaves are 2^n - require(index < numLeaves, "INVALID_LEAF_INDEX"); - // refuse to accept padded leaves as proof - require(leaf != bytes32(0), "INVALID_LEAF"); - - bytes32 computedHash = leaf; - - for (uint256 i = 0; i < proofHeight; ++i) { - bytes32 proofElement = proof[i]; - - if (index % 2 == 0) { - // if index is even, proof must be to the right - computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); - } else { - // if index is odd, proof is to the left - computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); + ) internal pure returns (bool isMember) { + // solhint-disable-next-line no-inline-assembly + // slither-disable-next-line assembly + assembly ("memory-safe") { + // if proof is empty, check if the leaf is the root + if proof.length { + // set end to be the end of the proof array, shl(5, proof.length) is equivalent to proof.length * 32 + let end := add(proof.offset, shl(5, proof.length)) + // set iterator to the start of the proof array + let i := proof.offset + // prettier-ignore + // solhint-disable-next-line no-empty-blocks + for {} 1 {} { + // if index is odd, leaf slot is at 0x20, else 0x0 + let leafSlot := shl(5, and(0x1, index)) + // store the leaf at the calculated slot + mstore(leafSlot, leaf) + // store proof element in whichever slot is not occupied by the leaf + mstore(xor(leafSlot, 32), calldataload(i)) + // hash the first 64 bytes in memory + leaf := keccak256(0, 64) + // shift index right by 1 bit to divide by 2 + index := shr(1, index) + // increment iterator by 32 bytes + i := add(i, 32) + // break if iterator is at the end of the proof array + if iszero(lt(i, end)) { + break + } + } } - index /= 2; + // check if log2(numLeaves) is an integer, or else rounds up to the next integer + // then, checks if the calculated root matches the expected root + // finally, checks if index was zeroed while calculating proof, else an invalid index was provided + // slither-disable-next-line incorrect-shift + isMember := and( + and(lt(numLeaves, add(shl(proof.length, 0x1), 1)), gt(numLeaves, shl(sub(proof.length, 1), 0x1))), + and(eq(leaf, rootHash), iszero(index)) + ) } - return computedHash == rootHash; } } diff --git a/contracts/interfaces/child/IChildERC1155.sol b/contracts/interfaces/child/IChildERC1155.sol index 36c96379..a062460c 100644 --- a/contracts/interfaces/child/IChildERC1155.sol +++ b/contracts/interfaces/child/IChildERC1155.sol @@ -35,7 +35,7 @@ interface IChildERC1155 is IERC1155MetadataURIUpgradeable { * @param account Account of the user to mint the tokens to * @param id Index of NFT to mint to the account * @param amount Amount of NFT to mint - * @return bool Returns true if function call is succesful + * @return bool Returns true if function call is successful */ function mint(address account, uint256 id, uint256 amount) external returns (bool); @@ -59,7 +59,7 @@ interface IChildERC1155 is IERC1155MetadataURIUpgradeable { * @param from Address to burn the NFTs from * @param id Index of NFT to burn from the account * @param amount Amount of NFT to burn - * @return bool Returns true if function call is succesful + * @return bool Returns true if function call is successful */ function burn(address from, uint256 id, uint256 amount) external returns (bool); diff --git a/contracts/interfaces/child/IChildERC20.sol b/contracts/interfaces/child/IChildERC20.sol index 9042518e..91ffa390 100644 --- a/contracts/interfaces/child/IChildERC20.sol +++ b/contracts/interfaces/child/IChildERC20.sol @@ -34,7 +34,7 @@ interface IChildERC20 is IERC20MetadataUpgradeable { * @dev Can only be called by the predicate address * @param account Account of the user to mint the tokens to * @param amount Amount of tokens to mint to the account - * @return bool Returns true if function call is succesful + * @return bool Returns true if function call is successful */ function mint(address account, uint256 amount) external returns (bool); @@ -43,7 +43,7 @@ interface IChildERC20 is IERC20MetadataUpgradeable { * @dev Can only be called by the predicate address * @param account Account of the user to burn the tokens from * @param amount Amount of tokens to burn from the account - * @return bool Returns true if function call is succesful + * @return bool Returns true if function call is successful */ function burn(address account, uint256 amount) external returns (bool); } diff --git a/contracts/interfaces/child/IChildERC721.sol b/contracts/interfaces/child/IChildERC721.sol index f43e1d5a..a91f250c 100644 --- a/contracts/interfaces/child/IChildERC721.sol +++ b/contracts/interfaces/child/IChildERC721.sol @@ -34,7 +34,7 @@ interface IChildERC721 is IERC721MetadataUpgradeable { * @dev Can only be called by the predicate address * @param account Account of the user to mint the tokens to * @param tokenId Index of NFT to mint to the account - * @return bool Returns true if function call is succesful + * @return bool Returns true if function call is successful */ function mint(address account, uint256 tokenId) external returns (bool); @@ -52,7 +52,7 @@ interface IChildERC721 is IERC721MetadataUpgradeable { * @dev Can only be called by the predicate address * @param account Address to burn the NFTs from * @param tokenId Index of NFT to burn - * @return bool Returns true if function call is succesful + * @return bool Returns true if function call is successful */ function burn(address account, uint256 tokenId) external returns (bool); diff --git a/contracts/interfaces/child/INativeERC20.sol b/contracts/interfaces/child/INativeERC20.sol index 376d2dfe..7e252789 100644 --- a/contracts/interfaces/child/INativeERC20.sol +++ b/contracts/interfaces/child/INativeERC20.sol @@ -20,7 +20,8 @@ interface INativeERC20 is IERC20MetadataUpgradeable { address rootToken_, string calldata name_, string calldata symbol_, - uint8 decimals_ + uint8 decimals_, + uint256 tokenSupply_ ) external; /** @@ -30,8 +31,8 @@ interface INativeERC20 is IERC20MetadataUpgradeable { function predicate() external view returns (address); /** - * @notice Returns predicate address controlling the child token - * @return address Returns the address of the predicate + * @notice Returns corresponding root token address for the child native token + * @return address Returns the root token address */ function rootToken() external view returns (address); @@ -40,7 +41,7 @@ interface INativeERC20 is IERC20MetadataUpgradeable { * @dev Can only be called by the predicate address * @param account Account of the user to mint the tokens to * @param amount Amount of tokens to mint to the account - * @return bool Returns true if function call is succesful + * @return bool Returns true if function call is successful */ function mint(address account, uint256 amount) external returns (bool); @@ -49,7 +50,7 @@ interface INativeERC20 is IERC20MetadataUpgradeable { * @dev Can only be called by the predicate address * @param account Account of the user to burn the tokens from * @param amount Amount of tokens to burn from the account - * @return bool Returns true if function call is succesful + * @return bool Returns true if function call is successful */ function burn(address account, uint256 amount) external returns (bool); } diff --git a/contracts/interfaces/child/validator/IRewardPool.sol b/contracts/interfaces/child/validator/IRewardPool.sol index 376059b1..5479e5eb 100644 --- a/contracts/interfaces/child/validator/IRewardPool.sol +++ b/contracts/interfaces/child/validator/IRewardPool.sol @@ -20,7 +20,7 @@ interface IRewardPool { /// @notice distributes reward for the given epoch /// @dev transfers funds from sender to this contract /// @param uptime uptime data for every validator - function distributeRewardFor(uint256 epochId, Uptime[] calldata uptime) external; + function distributeRewardFor(uint256 epochId, Uptime[] calldata uptime, uint256 epochSize) external; /// @notice withdraws pending rewards for the sender (validator) function withdrawReward() external; diff --git a/contracts/interfaces/child/validator/IValidatorSet.sol b/contracts/interfaces/child/validator/IValidatorSet.sol index 58619b46..1eacb4fe 100644 --- a/contracts/interfaces/child/validator/IValidatorSet.sol +++ b/contracts/interfaces/child/validator/IValidatorSet.sol @@ -22,13 +22,20 @@ struct Epoch { */ interface IValidatorSet is IStateReceiver { event NewEpoch(uint256 indexed id, uint256 indexed startBlock, uint256 indexed endBlock, bytes32 epochRoot); - event Slashed(uint256 indexed validator, uint256 amount); + event Slashed(uint256 indexed exitId, address[] validators); event WithdrawalRegistered(address indexed account, uint256 amount); event Withdrawal(address indexed account, uint256 amount); /// @notice commits a new epoch /// @dev system call - function commitEpoch(uint256 id, Epoch calldata epoch) external; + function commitEpoch(uint256 id, Epoch calldata epoch, uint256 epochSize) external; + + /// @notice initialises slashing process + /// @dev system call, + /// @dev given list of validators are slashed on L2 + /// subsequently after their stake is slashed on L1 + /// @param validators list of validators to be slashed + function slash(address[] calldata validators) external; /// @notice allows a validator to announce their intention to withdraw a given amount of tokens /// @dev initializes a waiting period before the tokens can be withdrawn @@ -38,11 +45,6 @@ interface IValidatorSet is IStateReceiver { /// @dev calls the bridge to release the funds on root function withdraw() external; - /// @notice amount of blocks in an epoch - /// @dev when an epoch is committed a multiple of this number of blocks must be committed - // slither-disable-next-line naming-convention - function EPOCH_SIZE() external view returns (uint256); - /// @notice total amount of blocks in a given epoch function totalBlocks(uint256 epochId) external view returns (uint256 length); diff --git a/contracts/interfaces/root/IExitHelper.sol b/contracts/interfaces/root/IExitHelper.sol index 64fdbf12..92a8c047 100644 --- a/contracts/interfaces/root/IExitHelper.sol +++ b/contracts/interfaces/root/IExitHelper.sol @@ -14,6 +14,13 @@ interface IExitHelper { bytes32[] proof; } + /** + * @notice Returns the address that called the exit function + * @dev only available in the context of the exit function + * @return address of the caller + */ + function caller() external view returns (address); + /** * @notice Perform an exit for one event * @param blockNumber Block number of the exit event on L2 diff --git a/contracts/interfaces/root/staking/ICustomSupernetManager.sol b/contracts/interfaces/root/staking/ICustomSupernetManager.sol index 7b822d4d..d5b529c7 100644 --- a/contracts/interfaces/root/staking/ICustomSupernetManager.sol +++ b/contracts/interfaces/root/staking/ICustomSupernetManager.sol @@ -20,7 +20,7 @@ interface ICustomSupernetManager { event AddedToWhitelist(address indexed validator); event RemovedFromWhitelist(address indexed validator); event ValidatorRegistered(address indexed validator, uint256[4] blsKey); - event ValidatorDeactivated(address validator); + event ValidatorDeactivated(address indexed validator); event GenesisFinalized(uint256 amountValidators); event StakingEnabled(); diff --git a/contracts/lib/AccessList.sol b/contracts/lib/AccessList.sol index b6ae7a30..f465c9d0 100644 --- a/contracts/lib/AccessList.sol +++ b/contracts/lib/AccessList.sol @@ -11,24 +11,24 @@ import {System} from "../child/System.sol"; @notice Checks the access lists to see if an address is allowed and not blocked */ contract AccessList is Ownable2StepUpgradeable, System { - bool private useAllowList; - bool private useBlockList; + bool private _useAllowList; + bool private _useBlockList; event AllowListUsageSet(uint256 indexed block, bool indexed status); event BlockListUsageSet(uint256 indexed block, bool indexed status); function setAllowList(bool newUseAllowList) external onlyOwner { - useAllowList = newUseAllowList; + _useAllowList = newUseAllowList; emit AllowListUsageSet(block.number, newUseAllowList); } function setBlockList(bool newUseBlockList) external onlyOwner { - useBlockList = newUseBlockList; + _useBlockList = newUseBlockList; emit BlockListUsageSet(block.number, newUseBlockList); } function _checkAccessList() internal view { - if (useAllowList) { + if (_useAllowList) { // solhint-disable avoid-low-level-calls // slither-disable-next-line low-level-calls (bool allowSuccess, bytes memory allowlistRes) = ALLOWLIST_PRECOMPILE.staticcall{gas: READ_ADDRESSLIST_GAS}( @@ -36,7 +36,7 @@ contract AccessList is Ownable2StepUpgradeable, System { ); require(allowSuccess && abi.decode(allowlistRes, (uint256)) > 0, "DISALLOWED_SENDER"); } - if (useBlockList) { + if (_useBlockList) { // slither-disable-next-line low-level-calls (bool blockSuccess, bytes memory blocklistRes) = BLOCKLIST_PRECOMPILE.staticcall{gas: READ_ADDRESSLIST_GAS}( abi.encodeWithSelector(IAddressList.readAddressList.selector, msg.sender) @@ -45,8 +45,11 @@ contract AccessList is Ownable2StepUpgradeable, System { } } - function _initializeAccessList(bool _useAllowList, bool _useBlockList) internal { - useAllowList = _useAllowList; - useBlockList = _useBlockList; + function _initializeAccessList(bool __useAllowList, bool __useBlockList) internal { + _useAllowList = __useAllowList; + _useBlockList = __useBlockList; } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/lib/ChildManagerLib.sol b/contracts/lib/ChildManagerLib.sol deleted file mode 100644 index 4f5e7c08..00000000 --- a/contracts/lib/ChildManagerLib.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -struct ChildChains { - uint256 counter; - mapping(uint256 => address) managers; - mapping(address => uint256) ids; -} - -library ChildManagerLib { - function registerChild(ChildChains storage self, address manager) internal returns (uint256 id) { - assert(manager != address(0)); - id = ++self.counter; - self.managers[id] = manager; - self.ids[manager] = id; - } - - function managerOf(ChildChains storage self, uint256 id) internal view returns (address manager) { - manager = self.managers[id]; - require(manager != address(0), "Invalid id"); - } - - function idFor(ChildChains storage self, address manager) internal view returns (uint256 id) { - id = self.ids[manager]; - require(id != 0, "Invalid manager"); - } -} diff --git a/contracts/lib/EIP712MetaTransaction.sol b/contracts/lib/EIP712MetaTransaction.sol index e6433482..b88da50b 100644 --- a/contracts/lib/EIP712MetaTransaction.sol +++ b/contracts/lib/EIP712MetaTransaction.sol @@ -5,7 +5,7 @@ import "./EIP712Upgradeable.sol"; // solhint-disable reason-string contract EIP712MetaTransaction is EIP712Upgradeable { - bytes32 private constant META_TRANSACTION_TYPEHASH = + bytes32 private constant _META_TRANSACTION_TYPEHASH = keccak256(bytes("MetaTransaction(uint256 nonce,address from,bytes functionSignature)")); event MetaTransactionExecuted(address userAddress, address relayerAddress, bytes functionSignature); @@ -96,7 +96,7 @@ contract EIP712MetaTransaction is EIP712Upgradeable { function _hashMetaTransaction(MetaTransaction memory metaTx) private pure returns (bytes32) { return keccak256( - abi.encode(META_TRANSACTION_TYPEHASH, metaTx.nonce, metaTx.from, keccak256(metaTx.functionSignature)) + abi.encode(_META_TRANSACTION_TYPEHASH, metaTx.nonce, metaTx.from, keccak256(metaTx.functionSignature)) ); } @@ -110,4 +110,7 @@ contract EIP712MetaTransaction is EIP712Upgradeable { outBytes4 := mload(add(inBytes, 32)) } } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/lib/EIP712Upgradeable.sol b/contracts/lib/EIP712Upgradeable.sol index 494df76d..adc5d14e 100644 --- a/contracts/lib/EIP712Upgradeable.sol +++ b/contracts/lib/EIP712Upgradeable.sol @@ -102,5 +102,8 @@ abstract contract EIP712Upgradeable { function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } // slither-disable-end naming-convention diff --git a/contracts/lib/ModExp.sol b/contracts/lib/ModExp.sol index 9f9cb9f3..fd7298d5 100644 --- a/contracts/lib/ModExp.sol +++ b/contracts/lib/ModExp.sol @@ -365,7 +365,7 @@ library ModexpInverse { */ library ModexpSqrt { /** - * @notice computes square root by modular exponentation + * @notice computes square root by modular exponentiation * @dev Compute $input^{(N + 1) / 4} mod N$ using Addition Chain method * @param t6 the number to derive the square root of * @return t0 the square root diff --git a/contracts/lib/StakeManagerLib.sol b/contracts/lib/StakeManagerLib.sol deleted file mode 100644 index 6148274c..00000000 --- a/contracts/lib/StakeManagerLib.sol +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import "../interfaces/root/staking/IStakeManager.sol"; - -struct Stakes { - uint256 totalStake; - // validator => child => amount - mapping(address => mapping(uint256 => uint256)) stakes; - // child chain => total stake - mapping(uint256 => uint256) totalStakePerChild; - mapping(address => uint256) totalStakes; - mapping(address => uint256) withdrawableStakes; -} - -library StakeManagerLib { - function addStake(Stakes storage self, address validator, uint256 id, uint256 amount) internal { - self.stakes[validator][id] += amount; - self.totalStakePerChild[id] += amount; - self.totalStakes[validator] += amount; - self.totalStake += amount; - } - - function removeStake(Stakes storage self, address validator, uint256 id, uint256 amount) internal { - self.stakes[validator][id] -= amount; - self.totalStakePerChild[id] -= amount; - self.totalStakes[validator] -= amount; - self.totalStake -= amount; - self.withdrawableStakes[validator] += amount; - } - - function withdrawStake(Stakes storage self, address validator, uint256 amount) internal { - self.withdrawableStakes[validator] -= amount; - } - - function withdrawableStakeOf(Stakes storage self, address validator) internal view returns (uint256 amount) { - amount = self.withdrawableStakes[validator]; - } - - function totalStakeOfChild(Stakes storage self, uint256 id) internal view returns (uint256 amount) { - amount = self.totalStakePerChild[id]; - } - - function stakeOf(Stakes storage self, address validator, uint256 id) internal view returns (uint256 amount) { - amount = self.stakes[validator][id]; - } - - function totalStakeOf(Stakes storage self, address validator) internal view returns (uint256 amount) { - amount = self.totalStakes[validator]; - } -} diff --git a/contracts/lib/WithdrawalQueue.sol b/contracts/lib/WithdrawalQueue.sol index 5cb10abc..fe2225d0 100644 --- a/contracts/lib/WithdrawalQueue.sol +++ b/contracts/lib/WithdrawalQueue.sol @@ -19,7 +19,7 @@ library WithdrawalQueueLib { * @param epoch the epoch to withdraw */ function append(WithdrawalQueue storage self, uint256 amount, uint256 epoch) internal { - assert(amount != 0); + require(amount != 0, "WithdrawalQueueLib: INVALID_AMOUNT"); uint256 head = self.head; uint256 tail = self.tail; diff --git a/contracts/root/CheckpointManager.sol b/contracts/root/CheckpointManager.sol index a17dd151..6968ed48 100644 --- a/contracts/root/CheckpointManager.sol +++ b/contracts/root/CheckpointManager.sol @@ -12,12 +12,13 @@ contract CheckpointManager is ICheckpointManager, Initializable { using ArraysUpgradeable for uint256[]; using Merkle for bytes32; + bytes32 public constant DOMAIN = keccak256("DOMAIN_CHECKPOINT_MANAGER"); + uint256 public chainId; uint256 public currentEpoch; uint256 public currentValidatorSetLength; uint256 public currentCheckpointBlockNumber; uint256 public totalVotingPower; - bytes32 public constant DOMAIN = keccak256("DOMAIN_CHECKPOINT_MANAGER"); IBLS public bls; IBN256G2 public bn256G2; @@ -226,4 +227,7 @@ contract CheckpointManager is ICheckpointManager, Initializable { // Get the value of the bit at the given 'index' in a byte. return uint8(bitmap[byteNumber]) & (1 << bitNumber) > 0; } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/ChildMintableERC1155Predicate.sol b/contracts/root/ChildMintableERC1155Predicate.sol index 80342e43..1675b8dd 100644 --- a/contracts/root/ChildMintableERC1155Predicate.sol +++ b/contracts/root/ChildMintableERC1155Predicate.sol @@ -33,7 +33,7 @@ contract ChildMintableERC1155Predicate is Initializable, IChildMintableERC1155Pr } /** - * @notice Initilization function for ChildMintableERC1155Predicate + * @notice Initialization function for ChildMintableERC1155Predicate * @param newStateSender Address of StateSender to send exit information to * @param newExitHelper Address of ExitHelper to receive deposit information from * @param newRootERC1155Predicate Address of root ERC1155 predicate to communicate with @@ -118,7 +118,7 @@ contract ChildMintableERC1155Predicate is Initializable, IChildMintableERC1155Pr } /** - * @notice Internal initilization function for ChildMintableERC1155Predicate + * @notice Internal initialization function for ChildMintableERC1155Predicate * @param newStateSender Address of StateSender to send exit information to * @param newExitHelper Address of ExitHelper to receive deposit information from * @param newRootERC1155Predicate Address of root ERC1155 predicate to communicate with @@ -305,4 +305,7 @@ contract ChildMintableERC1155Predicate is Initializable, IChildMintableERC1155Pr return false; } } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/ChildMintableERC20Predicate.sol b/contracts/root/ChildMintableERC20Predicate.sol index 0630a70a..c3096045 100644 --- a/contracts/root/ChildMintableERC20Predicate.sol +++ b/contracts/root/ChildMintableERC20Predicate.sol @@ -29,7 +29,7 @@ contract ChildMintableERC20Predicate is Initializable, IChildMintableERC20Predic mapping(address => address) public rootTokenToChildToken; /** - * @notice Initilization function for ChildMintableERC20Predicate + * @notice Initialization function for ChildMintableERC20Predicate * @param newStateSender Address of StateSender to send deposit information to * @param newExitHelper Address of ExitHelper to receive withdrawal information from * @param newRootERC20Predicate Address of root ERC20 predicate to communicate with @@ -189,4 +189,7 @@ contract ChildMintableERC20Predicate is Initializable, IChildMintableERC20Predic // slither-disable-next-line reentrancy-events emit MintableTokenMapped(rootToken, address(childToken)); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/ChildMintableERC721Predicate.sol b/contracts/root/ChildMintableERC721Predicate.sol index e1e6065d..ac476c81 100644 --- a/contracts/root/ChildMintableERC721Predicate.sol +++ b/contracts/root/ChildMintableERC721Predicate.sol @@ -33,7 +33,7 @@ contract ChildMintableERC721Predicate is Initializable, IChildMintableERC721Pred } /** - * @notice Initilization function for ChildMintableERC721Predicate + * @notice Initialization function for ChildMintableERC721Predicate * @param newStateSender Address of StateSender to send exit information to * @param newExitHelper Address of ExitHelper to receive deposit information from * @param newRootERC721Predicate Address of root ERC721 predicate to communicate with @@ -114,7 +114,7 @@ contract ChildMintableERC721Predicate is Initializable, IChildMintableERC721Pred } /** - * @notice Initilization function for ChildMintableERC721Predicate + * @notice Initialization function for ChildMintableERC721Predicate * @param newStateSender Address of StateSender to send exit information to * @param newExitHelper Address of ExitHelper to receive deposit information from * @param newRootERC721Predicate Address of root ERC721 predicate to communicate with @@ -282,4 +282,7 @@ contract ChildMintableERC721Predicate is Initializable, IChildMintableERC721Pred return false; } } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/ExitHelper.sol b/contracts/root/ExitHelper.sol index 204a0b09..dd0bd630 100644 --- a/contracts/root/ExitHelper.sol +++ b/contracts/root/ExitHelper.sol @@ -8,6 +8,7 @@ import "../interfaces/root/IExitHelper.sol"; contract ExitHelper is IExitHelper, Initializable { mapping(uint256 => bool) public processedExits; ICheckpointManager public checkpointManager; + address public caller; event ExitProcessed(uint256 indexed id, bool indexed success, bytes returnData); @@ -83,14 +84,21 @@ contract ExitHelper is IExitHelper, Initializable { processedExits[id] = true; - // slither-disable-next-line calls-loop,low-level-calls,reentrancy-events,reentrancy-no-eth + // slither-disable-next-line costly-loop + caller = msg.sender; + // slither-disable-next-line calls-loop,low-level-calls,reentrancy-events,reentrancy-no-eth,reentrancy-benign (bool success, bytes memory returnData) = receiver.call( abi.encodeWithSignature("onL2StateReceive(uint256,address,bytes)", id, sender, data) ); + // slither-disable-next-line costly-loop + caller = address(0); // if state sync fails, revert flag if (!success) processedExits[id] = false; emit ExitProcessed(id, success, returnData); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/RootERC1155Predicate.sol b/contracts/root/RootERC1155Predicate.sol index 99eadcb1..3f25f24f 100644 --- a/contracts/root/RootERC1155Predicate.sol +++ b/contracts/root/RootERC1155Predicate.sol @@ -21,7 +21,7 @@ contract RootERC1155Predicate is Initializable, ERC1155Holder, IRootERC1155Predi mapping(address => address) public rootTokenToChildToken; /** - * @notice Initilization function for RootERC1155Predicate + * @notice Initialization function for RootERC1155Predicate * @param newStateSender Address of StateSender to send deposit information to * @param newExitHelper Address of ExitHelper to receive withdrawal information from * @param newChildERC1155Predicate Address of child ERC1155 predicate to communicate with @@ -101,10 +101,12 @@ contract RootERC1155Predicate is Initializable, ERC1155Holder, IRootERC1155Predi require(address(rootToken) != address(0), "RootERC1155Predicate: INVALID_TOKEN"); require(rootTokenToChildToken[address(rootToken)] == address(0), "RootERC1155Predicate: ALREADY_MAPPED"); + address childPredicate = childERC1155Predicate; + childToken = Clones.predictDeterministicAddress( childTokenTemplate, keccak256(abi.encodePacked(rootToken)), - childERC1155Predicate + childPredicate ); rootTokenToChildToken[address(rootToken)] = childToken; @@ -116,7 +118,7 @@ contract RootERC1155Predicate is Initializable, ERC1155Holder, IRootERC1155Predi uri = tokenUri; } catch {} - stateSender.syncState(childERC1155Predicate, abi.encode(MAP_TOKEN_SIG, rootToken, uri)); + stateSender.syncState(childPredicate, abi.encode(MAP_TOKEN_SIG, rootToken, uri)); // slither-disable-next-line reentrancy-events emit TokenMapped(address(rootToken), childToken); } @@ -196,4 +198,7 @@ contract RootERC1155Predicate is Initializable, ERC1155Holder, IRootERC1155Predi if (childToken == address(0)) childToken = mapToken(IERC1155MetadataURI(rootToken)); assert(childToken != address(0)); // invariant because we map the token if mapping does not exist } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/RootERC20Predicate.sol b/contracts/root/RootERC20Predicate.sol index fe1bc533..b9ab0ba1 100644 --- a/contracts/root/RootERC20Predicate.sol +++ b/contracts/root/RootERC20Predicate.sol @@ -21,7 +21,7 @@ contract RootERC20Predicate is Initializable, IRootERC20Predicate { mapping(address => address) public rootTokenToChildToken; /** - * @notice Initilization function for RootERC20Predicate + * @notice Initialization function for RootERC20Predicate * @param newStateSender Address of StateSender to send deposit information to * @param newExitHelper Address of ExitHelper to receive withdrawal information from * @param newChildERC20Predicate Address of child ERC20 predicate to communicate with @@ -136,4 +136,7 @@ contract RootERC20Predicate is Initializable, IRootERC20Predicate { // slither-disable-next-line reentrancy-events emit ERC20Withdraw(address(rootToken), childToken, withdrawer, receiver, amount); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/RootERC721Predicate.sol b/contracts/root/RootERC721Predicate.sol index 714e1116..7103a682 100644 --- a/contracts/root/RootERC721Predicate.sol +++ b/contracts/root/RootERC721Predicate.sol @@ -21,7 +21,7 @@ contract RootERC721Predicate is Initializable, ERC721Holder, IRootERC721Predicat mapping(address => address) public rootTokenToChildToken; /** - * @notice Initilization function for RootERC721Predicate + * @notice Initialization function for RootERC721Predicate * @param newStateSender Address of StateSender to send deposit information to * @param newExitHelper Address of ExitHelper to receive withdrawal information from * @param newChildERC721Predicate Address of child ERC721 predicate to communicate with @@ -97,16 +97,18 @@ contract RootERC721Predicate is Initializable, ERC721Holder, IRootERC721Predicat require(address(rootToken) != address(0), "RootERC721Predicate: INVALID_TOKEN"); require(rootTokenToChildToken[address(rootToken)] == address(0), "RootERC721Predicate: ALREADY_MAPPED"); + address childPredicate = childERC721Predicate; + address childToken = Clones.predictDeterministicAddress( childTokenTemplate, keccak256(abi.encodePacked(rootToken)), - childERC721Predicate + childPredicate ); rootTokenToChildToken[address(rootToken)] = childToken; stateSender.syncState( - childERC721Predicate, + childPredicate, abi.encode(MAP_TOKEN_SIG, rootToken, rootToken.name(), rootToken.symbol()) ); // slither-disable-next-line reentrancy-events @@ -181,4 +183,7 @@ contract RootERC721Predicate is Initializable, ERC721Holder, IRootERC721Predicat if (childToken == address(0)) childToken = mapToken(IERC721Metadata(rootToken)); assert(childToken != address(0)); // invariant because we map the token if mapping does not exist } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/StateSender.sol b/contracts/root/StateSender.sol index ef3fa01f..77ed3c72 100644 --- a/contracts/root/StateSender.sol +++ b/contracts/root/StateSender.sol @@ -27,4 +27,7 @@ contract StateSender is IStateSender { // State sync id will start with 1 emit StateSynced(++counter, msg.sender, receiver, data); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/staking/CustomSupernetManager.sol b/contracts/root/staking/CustomSupernetManager.sol index 1fcb6e1e..528a0de0 100644 --- a/contracts/root/staking/CustomSupernetManager.sol +++ b/contracts/root/staking/CustomSupernetManager.sol @@ -8,21 +8,21 @@ import "./SupernetManager.sol"; import "../../interfaces/common/IBLS.sol"; import "../../interfaces/IStateSender.sol"; import "../../interfaces/root/staking/ICustomSupernetManager.sol"; +import "../../interfaces/root/IExitHelper.sol"; contract CustomSupernetManager is ICustomSupernetManager, Ownable2StepUpgradeable, SupernetManager { using SafeERC20 for IERC20; using GenesisLib for GenesisSet; - bytes32 private constant STAKE_SIG = keccak256("STAKE"); - bytes32 private constant UNSTAKE_SIG = keccak256("UNSTAKE"); - bytes32 private constant SLASH_SIG = keccak256("SLASH"); - uint256 public constant SLASHING_PERCENTAGE = 50; + bytes32 private constant _STAKE_SIG = keccak256("STAKE"); + bytes32 private constant _UNSTAKE_SIG = keccak256("UNSTAKE"); + bytes32 private constant _SLASH_SIG = keccak256("SLASH"); - IBLS private bls; - IStateSender private stateSender; - IERC20 private matic; - address private childValidatorSet; - address private exitHelper; + IBLS private _bls; + IStateSender private _stateSender; + IERC20 private _matic; + address private _childValidatorSet; + address private _exitHelper; bytes32 public domain; @@ -54,11 +54,11 @@ contract CustomSupernetManager is ICustomSupernetManager, Ownable2StepUpgradeabl "INVALID_INPUT" ); __SupernetManager_init(newStakeManager); - bls = IBLS(newBls); - stateSender = IStateSender(newStateSender); - matic = IERC20(newMatic); - childValidatorSet = newChildValidatorSet; - exitHelper = newExitHelper; + _bls = IBLS(newBls); + _stateSender = IStateSender(newStateSender); + _matic = IERC20(newMatic); + _childValidatorSet = newChildValidatorSet; + _exitHelper = newExitHelper; domain = keccak256(abi.encodePacked(newDomain)); __Ownable2Step_init(); } @@ -108,21 +108,22 @@ contract CustomSupernetManager is ICustomSupernetManager, Ownable2StepUpgradeabl * @inheritdoc ICustomSupernetManager */ function withdrawSlashedStake(address to) external onlyOwner { - uint256 balance = matic.balanceOf(address(this)); - matic.safeTransfer(to, balance); + uint256 balance = _matic.balanceOf(address(this)); + _matic.safeTransfer(to, balance); } /** * @inheritdoc ICustomSupernetManager */ function onL2StateReceive(uint256 /*id*/, address sender, bytes calldata data) external { - if (msg.sender != exitHelper || sender != childValidatorSet) revert Unauthorized("exitHelper"); - if (bytes32(data[:32]) == UNSTAKE_SIG) { + if (msg.sender != _exitHelper || sender != _childValidatorSet) revert Unauthorized("_exitHelper"); + if (bytes32(data[:32]) == _UNSTAKE_SIG) { (address validator, uint256 amount) = abi.decode(data[32:], (address, uint256)); _unstake(validator, amount); - } else if (bytes32(data[:32]) == SLASH_SIG) { - address validator = abi.decode(data[32:], (address)); - _slash(validator); + } else if (bytes32(data[:32]) == _SLASH_SIG) { + (, address[] memory validatorsToSlash, uint256 slashingPercentage, uint256 slashIncentivePercentage) = abi + .decode(data, (bytes32, address[], uint256, uint256)); + _slash(id, validatorsToSlash, slashingPercentage, slashIncentivePercentage); } } @@ -145,7 +146,7 @@ contract CustomSupernetManager is ICustomSupernetManager, Ownable2StepUpgradeabl if (_genesis.gatheringGenesisValidators()) { _genesis.insert(validator, amount); } else if (_genesis.completed()) { - stateSender.syncState(childValidatorSet, abi.encode(STAKE_SIG, validator, amount)); + _stateSender.syncState(_childValidatorSet, abi.encode(_STAKE_SIG, validator, amount)); } else { revert Unauthorized("Wait for genesis"); } @@ -153,16 +154,38 @@ contract CustomSupernetManager is ICustomSupernetManager, Ownable2StepUpgradeabl function _unstake(address validator, uint256 amount) internal { // slither-disable-next-line reentrancy-benign,reentrancy-events - stakeManager.releaseStakeOf(validator, amount); + _stakeManager.releaseStakeOf(validator, amount); _removeIfValidatorUnstaked(validator); } - function _slash(address validator) internal { - uint256 stake = stakeManager.stakeOf(validator, id); - uint256 slashedAmount = (stake * SLASHING_PERCENTAGE) / 100; - // slither-disable-next-line reentrancy-benign,reentrancy-events - stakeManager.slashStakeOf(validator, slashedAmount); - _removeIfValidatorUnstaked(validator); + function _slash( + uint256 exitEventId, + address[] memory validatorsToSlash, + uint256 slashingPercentage, + uint256 slashIncentivePercentage + ) internal { + uint256 length = validatorsToSlash.length; + uint256 totalSlashedAmount; + for (uint256 i = 0; i < length; ) { + uint256 slashedAmount = (_stakeManager.stakeOf(validatorsToSlash[i], id) * slashingPercentage) / 100; + // slither-disable-next-line reentrancy-benign,reentrancy-events,reentrancy-no-eth + _stakeManager.slashStakeOf(validatorsToSlash[i], slashedAmount); + _removeIfValidatorUnstaked(validatorsToSlash[i]); + totalSlashedAmount += slashedAmount; + unchecked { + ++i; + } + } + + // contract will always have enough balance since slashStakeOf returns entire slashed amt + uint256 rewardAmount = (totalSlashedAmount * slashIncentivePercentage) / 100; + _matic.safeTransfer(IExitHelper(_exitHelper).caller(), rewardAmount); + + // complete slashing on child chain + _stateSender.syncState( + _childValidatorSet, + abi.encode(_SLASH_SIG, exitEventId, validatorsToSlash, slashingPercentage) + ); } function _verifyValidatorRegistration( @@ -173,14 +196,14 @@ contract CustomSupernetManager is ICustomSupernetManager, Ownable2StepUpgradeabl /// @dev signature verification succeeds if signature and pubkey are empty if (signature[0] == 0 && signature[1] == 0) revert InvalidSignature(signer); // slither-disable-next-line calls-loop - (bool result, bool callSuccess) = bls.verifySingle(signature, pubkey, _message(signer)); + (bool result, bool callSuccess) = _bls.verifySingle(signature, pubkey, _message(signer)); if (!callSuccess || !result) revert InvalidSignature(signer); } /// @notice Message to sign for registration function _message(address signer) internal view returns (uint256[2] memory) { // slither-disable-next-line calls-loop - return bls.hashToPoint(domain, abi.encodePacked(signer, address(this), block.chainid)); + return _bls.hashToPoint(domain, abi.encodePacked(signer, address(this), block.chainid)); } function _addToWhitelist(address validator) internal { @@ -194,9 +217,12 @@ contract CustomSupernetManager is ICustomSupernetManager, Ownable2StepUpgradeabl } function _removeIfValidatorUnstaked(address validator) internal { - if (stakeManager.stakeOf(validator, id) == 0) { + if (_stakeManager.stakeOf(validator, id) == 0) { validators[validator].isActive = false; emit ValidatorDeactivated(validator); } } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/staking/StakeManager.sol b/contracts/root/staking/StakeManager.sol index affc4d6b..3df3abfc 100644 --- a/contracts/root/staking/StakeManager.sol +++ b/contracts/root/staking/StakeManager.sol @@ -4,27 +4,25 @@ pragma solidity 0.8.19; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import "../../lib/ChildManagerLib.sol"; -import "../../lib/StakeManagerLib.sol"; +import "../../interfaces/root/staking/IStakeManager.sol"; +import "./StakeManagerChildData.sol"; +import "./StakeManagerStakingData.sol"; -contract StakeManager is IStakeManager, Initializable { - using ChildManagerLib for ChildChains; - using StakeManagerLib for Stakes; +contract StakeManager is IStakeManager, Initializable, StakeManagerChildData, StakeManagerStakingData { using SafeERC20 for IERC20; - IERC20 internal matic; - ChildChains private _chains; - Stakes private _stakes; + IERC20 private _stakingToken; - function initialize(address newMatic) public initializer { - matic = IERC20(newMatic); + function initialize(address newStakingToken) public initializer { + _stakingToken = IERC20(newStakingToken); } /** * @inheritdoc IStakeManager */ function registerChildChain(address manager) external returns (uint256 id) { - id = _chains.registerChild(manager); + require(_ids[manager] == 0, "StakeManager: ID_ALREADY_SET"); + id = _registerChild(manager); ISupernetManager(manager).onInit(id); // slither-disable-next-line reentrancy-events emit ChildManagerRegistered(id, manager); @@ -34,12 +32,12 @@ contract StakeManager is IStakeManager, Initializable { * @inheritdoc IStakeManager */ function stakeFor(uint256 id, uint256 amount) external { - require(id != 0 && id <= _chains.counter, "INVALID_ID"); + require(id != 0 && id <= _counter, "StakeManager: INVALID_ID"); // slither-disable-next-line reentrancy-benign,reentrancy-events - matic.safeTransferFrom(msg.sender, address(this), amount); + _stakingToken.safeTransferFrom(msg.sender, address(this), amount); // calling the library directly once fixes the coverage issue // https://github.com/foundry-rs/foundry/issues/4854#issuecomment-1528897219 - StakeManagerLib.addStake(_stakes, msg.sender, id, amount); + _addStake(msg.sender, id, amount); ISupernetManager manager = managerOf(id); manager.onStake(msg.sender, amount); // slither-disable-next-line reentrancy-events @@ -51,7 +49,7 @@ contract StakeManager is IStakeManager, Initializable { */ function releaseStakeOf(address validator, uint256 amount) external { uint256 id = idFor(msg.sender); - _stakes.removeStake(validator, id, amount); + _removeStake(validator, id, amount); // slither-disable-next-line reentrancy-events emit StakeRemoved(id, validator, amount); } @@ -68,9 +66,9 @@ contract StakeManager is IStakeManager, Initializable { */ function slashStakeOf(address validator, uint256 amount) external { uint256 id = idFor(msg.sender); - uint256 stake = stakeOf(validator, id); + uint256 stake = _stakeOf(validator, id); if (amount > stake) amount = stake; - _stakes.removeStake(validator, id, stake); + _removeStake(validator, id, stake); _withdrawStake(validator, msg.sender, amount); emit StakeRemoved(id, validator, stake); emit ValidatorSlashed(id, validator, amount); @@ -80,55 +78,58 @@ contract StakeManager is IStakeManager, Initializable { * @inheritdoc IStakeManager */ function withdrawableStake(address validator) external view returns (uint256 amount) { - amount = _stakes.withdrawableStakeOf(validator); + amount = _withdrawableStakeOf(validator); } /** * @inheritdoc IStakeManager */ function totalStake() external view returns (uint256 amount) { - amount = _stakes.totalStake; + amount = _totalStake; } /** * @inheritdoc IStakeManager */ function totalStakeOfChild(uint256 id) external view returns (uint256 amount) { - amount = _stakes.totalStakeOfChild(id); + amount = _totalStakeOfChild(id); } /** * @inheritdoc IStakeManager */ function totalStakeOf(address validator) external view returns (uint256 amount) { - amount = _stakes.totalStakeOf(validator); + amount = _totalStakeOf(validator); } /** * @inheritdoc IStakeManager */ function stakeOf(address validator, uint256 id) public view returns (uint256 amount) { - amount = _stakes.stakeOf(validator, id); + amount = _stakeOf(validator, id); } /** * @inheritdoc IStakeManager */ function managerOf(uint256 id) public view returns (ISupernetManager manager) { - manager = ISupernetManager(_chains.managerOf(id)); + manager = ISupernetManager(_managerOf(id)); } /** * @inheritdoc IStakeManager */ function idFor(address manager) public view returns (uint256 id) { - id = ChildManagerLib.idFor(_chains, manager); + id = _idFor(manager); } function _withdrawStake(address validator, address to, uint256 amount) private { - _stakes.withdrawStake(validator, amount); + _withdrawStake(validator, amount); // slither-disable-next-line reentrancy-events - matic.safeTransfer(to, amount); + _stakingToken.safeTransfer(to, amount); emit StakeWithdrawn(validator, to, amount); } + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/contracts/root/staking/StakeManagerChildData.sol b/contracts/root/staking/StakeManagerChildData.sol new file mode 100644 index 00000000..2f3d9d24 --- /dev/null +++ b/contracts/root/staking/StakeManagerChildData.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +/** + * @title StakeManagerChildData + * @notice Holds data to allow look-up between child chain manager contract address and child chain id. + * Note that this is contract is designed to be included in StakeManager. It is upgradeable. + */ +abstract contract StakeManagerChildData { + // Highest child chain id allocated thus far. Child chain id 0x00 is an invalid id. + // slither-disable-next-line naming-convention + uint256 internal _counter; + // child chain id to child chain manager contract address. + mapping(uint256 => address) private _managers; + // child chain manager contract address to child chain id. + // slither-disable-next-line naming-convention + mapping(address => uint256) internal _ids; + + /** + * @notice Register a child chain manager contract and allocate a child chain id. + * @param manager Child chain manager contract address. + * @return id Child chain id allocated for the child chain. + */ + function _registerChild(address manager) internal returns (uint256 id) { + require(manager != address(0), "StakeManagerChildData: INVALID_ADDRESS"); + unchecked { + id = ++_counter; + } + _managers[id] = manager; + _ids[manager] = id; + } + + /** + * @notice Get the child chain manager contract that corresponds to a child chain id. + * @param id Child chain id. + * @return manager Child chain manager contract address. + */ + function _managerOf(uint256 id) internal view returns (address manager) { + manager = _managers[id]; + require(manager != address(0), "StakeManagerChildData: INVALID_ID"); + } + + /** + * @notice Get the child chain id that corresponds to a child chain manager contract. + * @param manager Child chain manager contract address. + * @return id Child chain id. + */ + function _idFor(address manager) internal view returns (uint256 id) { + id = _ids[manager]; + require(id != 0, "StakeManagerChildData: INVALID_MANAGER"); + } + + // Storage gap + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; +} diff --git a/contracts/root/staking/StakeManagerStakingData.sol b/contracts/root/staking/StakeManagerStakingData.sol new file mode 100644 index 00000000..9d1b9042 --- /dev/null +++ b/contracts/root/staking/StakeManagerStakingData.sol @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +/** + * @title StakeManagerStakingData + * @notice Holds all staking related data. + * Note that this is contract is designed to be included in StakeManager. It is upgradeable. + */ +abstract contract StakeManagerStakingData { + // slither-disable-next-line naming-convention + uint256 internal _totalStake; + // validator => child => amount + mapping(address => mapping(uint256 => uint256)) private _stakes; + // child chain id => total stake + mapping(uint256 => uint256) private _totalStakePerChild; + // validator address => stake across all child chains. + mapping(address => uint256) private _totalStakes; + // validator address => withdrawable stake. + mapping(address => uint256) private _withdrawableStakes; + + function _addStake(address validator, uint256 id, uint256 amount) internal { + _stakes[validator][id] += amount; + _totalStakePerChild[id] += amount; + _totalStakes[validator] += amount; + _totalStake += amount; + } + + function _removeStake(address validator, uint256 id, uint256 amount) internal { + _stakes[validator][id] -= amount; + _totalStakePerChild[id] -= amount; + _totalStakes[validator] -= amount; + _totalStake -= amount; + _withdrawableStakes[validator] += amount; + } + + function _withdrawStake(address validator, uint256 amount) internal { + _withdrawableStakes[validator] -= amount; + } + + function _withdrawableStakeOf(address validator) internal view returns (uint256 amount) { + amount = _withdrawableStakes[validator]; + } + + function _totalStakeOfChild(uint256 id) internal view returns (uint256 amount) { + amount = _totalStakePerChild[id]; + } + + function _stakeOf(address validator, uint256 id) internal view returns (uint256 amount) { + amount = _stakes[validator][id]; + } + + function _totalStakeOf(address validator) internal view returns (uint256 amount) { + amount = _totalStakes[validator]; + } + + // Storage gap + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; +} diff --git a/contracts/root/staking/SupernetManager.sol b/contracts/root/staking/SupernetManager.sol index a2efb698..052d4ac0 100644 --- a/contracts/root/staking/SupernetManager.sol +++ b/contracts/root/staking/SupernetManager.sol @@ -6,20 +6,22 @@ import "../../interfaces/root/staking/IStakeManager.sol"; import "../../interfaces/root/staking/ISupernetManager.sol"; abstract contract SupernetManager is ISupernetManager, Initializable { - IStakeManager internal stakeManager; + // slither-disable-next-line naming-convention + IStakeManager internal _stakeManager; uint256 public id; modifier onlyStakeManager() { - require(msg.sender == address(stakeManager), "ONLY_STAKE_MANAGER"); + require(msg.sender == address(_stakeManager), "SupernetManager: ONLY_STAKE_MANAGER"); _; } // slither-disable-next-line naming-convention function __SupernetManager_init(address newStakeManager) internal onlyInitializing { - stakeManager = IStakeManager(newStakeManager); + _stakeManager = IStakeManager(newStakeManager); } function onInit(uint256 id_) external onlyStakeManager { + require(id == 0, "SupernetManager: ID_ALREADY_SET"); // slither-disable-next-line events-maths id = id_; } @@ -29,4 +31,7 @@ abstract contract SupernetManager is ISupernetManager, Initializable { } function _onStake(address validator, uint256 amount) internal virtual; + + // slither-disable-next-line unused-state,naming-convention + uint256[50] private __gap; } diff --git a/docs/child/ChildERC1155.md b/docs/child/ChildERC1155.md index c7842cf3..06aab644 100644 --- a/docs/child/ChildERC1155.md +++ b/docs/child/ChildERC1155.md @@ -78,7 +78,7 @@ Burns an NFT tokens from a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### burnBatch @@ -230,7 +230,7 @@ Mints an NFT token to a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### mintBatch diff --git a/docs/child/ChildERC1155Predicate.md b/docs/child/ChildERC1155Predicate.md index 83a4763f..b05a18e2 100644 --- a/docs/child/ChildERC1155Predicate.md +++ b/docs/child/ChildERC1155Predicate.md @@ -271,7 +271,7 @@ function childTokenTemplate() external view returns (address) function initialize(address newL2StateSender, address newStateReceiver, address newRootERC1155Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for ChildERC1155Predicate +Initialization function for ChildERC1155Predicate *Can only be called once.* diff --git a/docs/child/ChildERC1155PredicateAccessList.md b/docs/child/ChildERC1155PredicateAccessList.md index ea50a9af..cc0d17c6 100644 --- a/docs/child/ChildERC1155PredicateAccessList.md +++ b/docs/child/ChildERC1155PredicateAccessList.md @@ -304,7 +304,7 @@ function initialize(address newL2StateSender, address newStateReceiver, address function initialize(address newL2StateSender, address newStateReceiver, address newRootERC1155Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for ChildERC1155Predicate +Initialization function for ChildERC1155Predicate *Can only be called once.* @@ -394,7 +394,7 @@ function renounceOwnership() external nonpayable -*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.* +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* ### rootERC1155Predicate diff --git a/docs/child/ChildERC20.md b/docs/child/ChildERC20.md index 7ec86341..9bb0cefe 100644 --- a/docs/child/ChildERC20.md +++ b/docs/child/ChildERC20.md @@ -99,7 +99,7 @@ Burns an amount of tokens from a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### decimals @@ -268,7 +268,7 @@ Mints an amount of tokens to a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### name diff --git a/docs/child/ChildERC20Predicate.md b/docs/child/ChildERC20Predicate.md index b00fe9e4..31cdbf88 100644 --- a/docs/child/ChildERC20Predicate.md +++ b/docs/child/ChildERC20Predicate.md @@ -237,7 +237,7 @@ function childTokenTemplate() external view returns (address) function initialize(address newL2StateSender, address newStateReceiver, address newRootERC20Predicate, address newChildTokenTemplate, address newNativeTokenRootAddress) external nonpayable ``` -Initilization function for ChildERC20Predicate +Initialization function for ChildERC20Predicate *Can only be called once. `newNativeTokenRootAddress` should be set to zero where root token does not exist.* diff --git a/docs/child/ChildERC20PredicateAccessList.md b/docs/child/ChildERC20PredicateAccessList.md index 5679b09e..867c856a 100644 --- a/docs/child/ChildERC20PredicateAccessList.md +++ b/docs/child/ChildERC20PredicateAccessList.md @@ -248,7 +248,7 @@ function childTokenTemplate() external view returns (address) function initialize(address newL2StateSender, address newStateReceiver, address newRootERC20Predicate, address newChildTokenTemplate, address newNativeTokenRootAddress) external nonpayable ``` -Initilization function for ChildERC20Predicate +Initialization function for ChildERC20Predicate *Can only be called once. `newNativeTokenRootAddress` should be set to zero where root token does not exist.* @@ -362,7 +362,7 @@ function renounceOwnership() external nonpayable -*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.* +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* ### rootERC20Predicate diff --git a/docs/child/ChildERC721.md b/docs/child/ChildERC721.md index e43484b6..055c85f0 100644 --- a/docs/child/ChildERC721.md +++ b/docs/child/ChildERC721.md @@ -70,7 +70,7 @@ Burns an NFT tokens from a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### burnBatch @@ -243,7 +243,7 @@ Mints an NFT token to a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### mintBatch diff --git a/docs/child/ChildERC721Predicate.md b/docs/child/ChildERC721Predicate.md index fe194738..2e87166d 100644 --- a/docs/child/ChildERC721Predicate.md +++ b/docs/child/ChildERC721Predicate.md @@ -271,7 +271,7 @@ function childTokenTemplate() external view returns (address) function initialize(address newL2StateSender, address newStateReceiver, address newRootERC721Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for ChildERC721Predicate +Initialization function for ChildERC721Predicate *Can only be called once. `newNativeTokenRootAddress` should be set to zero where root token does not exist.* diff --git a/docs/child/ChildERC721PredicateAccessList.md b/docs/child/ChildERC721PredicateAccessList.md index b7803d10..30e318db 100644 --- a/docs/child/ChildERC721PredicateAccessList.md +++ b/docs/child/ChildERC721PredicateAccessList.md @@ -304,7 +304,7 @@ function initialize(address newL2StateSender, address newStateReceiver, address function initialize(address newL2StateSender, address newStateReceiver, address newRootERC721Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for ChildERC721Predicate +Initialization function for ChildERC721Predicate *Can only be called once. `newNativeTokenRootAddress` should be set to zero where root token does not exist.* @@ -394,7 +394,7 @@ function renounceOwnership() external nonpayable -*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.* +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* ### rootERC721Predicate diff --git a/docs/child/EIP1559Burn.md b/docs/child/EIP1559Burn.md index eaedc10a..a8441bde 100644 --- a/docs/child/EIP1559Burn.md +++ b/docs/child/EIP1559Burn.md @@ -50,7 +50,7 @@ function childERC20Predicate() external view returns (contract IChildERC20Predic function initialize(contract IChildERC20Predicate newChildERC20Predicate, address newBurnDestination) external nonpayable ``` -Initilization function for EIP1559 burn contract +Initialization function for EIP1559 burn contract *Can only be called once* diff --git a/docs/child/ForkParams.md b/docs/child/ForkParams.md index 92729f6b..2733fa22 100644 --- a/docs/child/ForkParams.md +++ b/docs/child/ForkParams.md @@ -49,6 +49,22 @@ function featureToBlockNumber(bytes32) external view returns (uint256) |---|---|---| | _0 | uint256 | undefined | +### initialize + +```solidity +function initialize(address newOwner) external nonpayable +``` + +initialize function to set the owner + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newOwner | address | address to transfer the ownership to | + ### isFeatureActivated ```solidity @@ -96,7 +112,7 @@ function renounceOwnership() external nonpayable -*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.* +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* ### transferOwnership @@ -136,6 +152,22 @@ function to update the block number for a feature ## Events +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + ### NewFeature ```solidity diff --git a/docs/child/NativeERC20.md b/docs/child/NativeERC20.md index 875a22bb..2697923b 100644 --- a/docs/child/NativeERC20.md +++ b/docs/child/NativeERC20.md @@ -252,7 +252,7 @@ Burns an amount of tokens from a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### decimals @@ -320,7 +320,7 @@ function increaseAllowance(address spender, uint256 addedValue) external nonpaya ### initialize ```solidity -function initialize(address predicate_, address rootToken_, string name_, string symbol_, uint8 decimals_) external nonpayable +function initialize(address predicate_, address rootToken_, string name_, string symbol_, uint8 decimals_, uint256 tokenSupply_) external nonpayable ``` @@ -336,6 +336,7 @@ function initialize(address predicate_, address rootToken_, string name_, string | name_ | string | undefined | | symbol_ | string | undefined | | decimals_ | uint8 | undefined | +| tokenSupply_ | uint256 | undefined | ### mint @@ -358,7 +359,7 @@ Mints an amount of tokens to a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### name @@ -400,7 +401,7 @@ Returns predicate address controlling the child token function rootToken() external view returns (address) ``` -Returns predicate address controlling the child token +Returns corresponding root token address for the child native token @@ -409,7 +410,7 @@ Returns predicate address controlling the child token | Name | Type | Description | |---|---|---| -| _0 | address | address Returns the address of the predicate | +| _0 | address | address Returns the root token address | ### symbol diff --git a/docs/child/NativeERC20Mintable.md b/docs/child/NativeERC20Mintable.md index e50ffef6..79b88170 100644 --- a/docs/child/NativeERC20Mintable.md +++ b/docs/child/NativeERC20Mintable.md @@ -263,7 +263,7 @@ Burns an amount of tokens from a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### decimals @@ -331,7 +331,7 @@ function increaseAllowance(address spender, uint256 addedValue) external nonpaya ### initialize ```solidity -function initialize(address predicate_, address owner_, address rootToken_, string name_, string symbol_, uint8 decimals_) external nonpayable +function initialize(address predicate_, address owner_, address rootToken_, string name_, string symbol_, uint8 decimals_, uint256 tokenSupply_) external nonpayable ``` @@ -348,6 +348,7 @@ function initialize(address predicate_, address owner_, address rootToken_, stri | name_ | string | undefined | | symbol_ | string | undefined | | decimals_ | uint8 | undefined | +| tokenSupply_ | uint256 | undefined | ### mint @@ -370,7 +371,7 @@ Mints an amount of tokens to a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### name @@ -448,7 +449,7 @@ function renounceOwnership() external nonpayable -*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.* +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* ### rootToken @@ -457,7 +458,7 @@ function renounceOwnership() external nonpayable function rootToken() external view returns (address) ``` -Returns predicate address controlling the child token +Returns corresponding root token address for the child native token @@ -466,7 +467,7 @@ Returns predicate address controlling the child token | Name | Type | Description | |---|---|---| -| _0 | address | address Returns the address of the predicate | +| _0 | address | address Returns the root token address | ### symbol diff --git a/docs/child/NetworkParams.md b/docs/child/NetworkParams.md index fe93b671..53096be7 100644 --- a/docs/child/NetworkParams.md +++ b/docs/child/NetworkParams.md @@ -10,10 +10,55 @@ Configurable network parameters that are read by the client on each epoch ## Methods -### blockGasLimit +### acceptOwnership ```solidity -function blockGasLimit() external view returns (uint256) +function acceptOwnership() external nonpayable +``` + + + +*The new owner accepts the ownership transfer.* + + +### baseFeeChangeDenom + +```solidity +function baseFeeChangeDenom() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### blockTime + +```solidity +function blockTime() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### blockTimeDrift + +```solidity +function blockTimeDrift() external view returns (uint256) ``` @@ -44,6 +89,56 @@ function checkpointBlockInterval() external view returns (uint256) |---|---|---| | _0 | uint256 | undefined | +### epochReward + +```solidity +function epochReward() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### epochSize + +```solidity +function epochSize() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### initialize + +```solidity +function initialize(NetworkParams.InitParams initParams) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| initParams | NetworkParams.InitParams | undefined | + ### maxValidatorSetSize ```solidity @@ -61,10 +156,10 @@ function maxValidatorSetSize() external view returns (uint256) |---|---|---| | _0 | uint256 | undefined | -### minStake +### minValidatorSetSize ```solidity -function minStake() external view returns (uint256) +function minValidatorSetSize() external view returns (uint256) ``` @@ -95,6 +190,40 @@ function owner() external view returns (address) |---|---|---| | _0 | address | undefined | +### pendingOwner + +```solidity +function pendingOwner() external view returns (address) +``` + + + +*Returns the address of the pending owner.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### proposalThreshold + +```solidity +function proposalThreshold() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + ### renounceOwnership ```solidity @@ -103,16 +232,16 @@ function renounceOwnership() external nonpayable -*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.* +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* -### setNewBlockGasLimit +### setNewBaseFeeChangeDenom ```solidity -function setNewBlockGasLimit(uint256 newBlockGasLimit) external nonpayable +function setNewBaseFeeChangeDenom(uint256 newBaseFeeChangeDenom) external nonpayable ``` -function to set new block gas limit +function to set new base fee change denominator *disallows setting of a zero value for sanity check purposes* @@ -120,7 +249,39 @@ function to set new block gas limit | Name | Type | Description | |---|---|---| -| newBlockGasLimit | uint256 | new block gas limit | +| newBaseFeeChangeDenom | uint256 | new base fee change denominator | + +### setNewBlockTime + +```solidity +function setNewBlockTime(uint256 newBlockTime) external nonpayable +``` + +function to set new block time + +*disallows setting of a zero value for sanity check purposes* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newBlockTime | uint256 | new block time | + +### setNewBlockTimeDrift + +```solidity +function setNewBlockTimeDrift(uint256 newBlockTimeDrift) external nonpayable +``` + +function to set new block time drift + +*disallows setting of a zero value for sanity check purposes* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newBlockTimeDrift | uint256 | new block time drift | ### setNewCheckpointBlockInterval @@ -138,6 +299,38 @@ function to set new checkpoint block interval |---|---|---| | newCheckpointBlockInterval | uint256 | new checkpoint block interval | +### setNewEpochReward + +```solidity +function setNewEpochReward(uint256 newEpochReward) external nonpayable +``` + +function to set new epoch reward + +*disallows setting of a zero value for sanity check purposes* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newEpochReward | uint256 | new epoch reward | + +### setNewEpochSize + +```solidity +function setNewEpochSize(uint256 newEpochSize) external nonpayable +``` + +function to set new epoch size + +*disallows setting of a zero value for sanity check purposes* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newEpochSize | uint256 | new epoch reward | + ### setNewMaxValidatorSetSize ```solidity @@ -154,13 +347,93 @@ function to set new maximum validator set size |---|---|---| | newMaxValidatorSetSize | uint256 | new maximum validator set size | -### setNewMinStake +### setNewMinValidatorSetSize + +```solidity +function setNewMinValidatorSetSize(uint256 newMinValidatorSetSize) external nonpayable +``` + +function to set new minimum validator set size + +*disallows setting of a zero value for sanity check purposes* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newMinValidatorSetSize | uint256 | new minimum validator set size | + +### setNewProposalThreshold + +```solidity +function setNewProposalThreshold(uint256 newProposalThreshold) external nonpayable +``` + +function to set new proposal threshold + +*disallows setting of a zero value for sanity check purposes* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newProposalThreshold | uint256 | new proposal threshold | + +### setNewSprintSize + +```solidity +function setNewSprintSize(uint256 newSprintSize) external nonpayable +``` + +function to set new sprint size + +*disallows setting of a zero value for sanity check purposes* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newSprintSize | uint256 | new sprint size | + +### setNewVotingDelay + +```solidity +function setNewVotingDelay(uint256 newVotingDelay) external nonpayable +``` + +function to set new voting delay + +*disallows setting of a zero value for sanity check purposes* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newVotingDelay | uint256 | new voting delay | + +### setNewVotingPeriod + +```solidity +function setNewVotingPeriod(uint256 newVotingPeriod) external nonpayable +``` + +function to set new voting period + +*disallows setting of a zero value for sanity check purposes* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newVotingPeriod | uint256 | new voting period | + +### setNewWithdrawalWaitPeriod ```solidity -function setNewMinStake(uint256 newMinStake) external nonpayable +function setNewWithdrawalWaitPeriod(uint256 newWithdrawalWaitPeriod) external nonpayable ``` -function to set new minimum stake +function to set new withdrawal wait period *disallows setting of a zero value for sanity check purposes* @@ -168,7 +441,24 @@ function to set new minimum stake | Name | Type | Description | |---|---|---| -| newMinStake | uint256 | new minimum stake | +| newWithdrawalWaitPeriod | uint256 | new withdrawal wait period | + +### sprintSize + +```solidity +function sprintSize() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | ### transferOwnership @@ -178,7 +468,7 @@ function transferOwnership(address newOwner) external nonpayable -*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.* +*Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.* #### Parameters @@ -186,14 +476,81 @@ function transferOwnership(address newOwner) external nonpayable |---|---|---| | newOwner | address | undefined | +### votingDelay + +```solidity +function votingDelay() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### votingPeriod + +```solidity +function votingPeriod() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### withdrawalWaitPeriod + +```solidity +function withdrawalWaitPeriod() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + ## Events -### NewBlockGasLimit +### Initialized ```solidity -event NewBlockGasLimit(uint256 indexed value) +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + +### NewBaseFeeChangeDenom + +```solidity +event NewBaseFeeChangeDenom(uint256 indexed baseFeeChangeDenom) ``` @@ -204,12 +561,44 @@ event NewBlockGasLimit(uint256 indexed value) | Name | Type | Description | |---|---|---| -| value `indexed` | uint256 | undefined | +| baseFeeChangeDenom `indexed` | uint256 | undefined | + +### NewBlockTime + +```solidity +event NewBlockTime(uint256 indexed blockTime) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| blockTime `indexed` | uint256 | undefined | + +### NewBlockTimeDrift + +```solidity +event NewBlockTimeDrift(uint256 indexed blockTimeDrift) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| blockTimeDrift `indexed` | uint256 | undefined | ### NewCheckpointBlockInterval ```solidity -event NewCheckpointBlockInterval(uint256 indexed value) +event NewCheckpointBlockInterval(uint256 indexed checkpointInterval) ``` @@ -220,12 +609,12 @@ event NewCheckpointBlockInterval(uint256 indexed value) | Name | Type | Description | |---|---|---| -| value `indexed` | uint256 | undefined | +| checkpointInterval `indexed` | uint256 | undefined | -### NewMaxValdidatorSetSize +### NewEpochReward ```solidity -event NewMaxValdidatorSetSize(uint256 indexed value) +event NewEpochReward(uint256 indexed reward) ``` @@ -236,12 +625,12 @@ event NewMaxValdidatorSetSize(uint256 indexed value) | Name | Type | Description | |---|---|---| -| value `indexed` | uint256 | undefined | +| reward `indexed` | uint256 | undefined | -### NewMinStake +### NewEpochSize ```solidity -event NewMinStake(uint256 indexed value) +event NewEpochSize(uint256 indexed size) ``` @@ -252,7 +641,136 @@ event NewMinStake(uint256 indexed value) | Name | Type | Description | |---|---|---| -| value `indexed` | uint256 | undefined | +| size `indexed` | uint256 | undefined | + +### NewMaxValidatorSetSize + +```solidity +event NewMaxValidatorSetSize(uint256 indexed maxValidatorSet) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| maxValidatorSet `indexed` | uint256 | undefined | + +### NewMinValidatorSetSize + +```solidity +event NewMinValidatorSetSize(uint256 indexed minValidatorSet) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| minValidatorSet `indexed` | uint256 | undefined | + +### NewProposalThreshold + +```solidity +event NewProposalThreshold(uint256 indexed proposalThreshold) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalThreshold `indexed` | uint256 | undefined | + +### NewSprintSize + +```solidity +event NewSprintSize(uint256 indexed size) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| size `indexed` | uint256 | undefined | + +### NewVotingDelay + +```solidity +event NewVotingDelay(uint256 indexed votingDelay) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| votingDelay `indexed` | uint256 | undefined | + +### NewVotingPeriod + +```solidity +event NewVotingPeriod(uint256 indexed votingPeriod) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| votingPeriod `indexed` | uint256 | undefined | + +### NewWithdrawalWaitPeriod + +```solidity +event NewWithdrawalWaitPeriod(uint256 indexed withdrawalPeriod) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| withdrawalPeriod `indexed` | uint256 | undefined | + +### OwnershipTransferStarted + +```solidity +event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | ### OwnershipTransferred diff --git a/docs/child/RootMintableERC1155Predicate.md b/docs/child/RootMintableERC1155Predicate.md index 56352390..ae5d0cb9 100644 --- a/docs/child/RootMintableERC1155Predicate.md +++ b/docs/child/RootMintableERC1155Predicate.md @@ -191,7 +191,7 @@ Function to deposit tokens from the depositor to another address on the child ch function initialize(address newL2StateSender, address newStateReceiver, address newChildERC1155Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for RootERC1155Predicate +Initialization function for RootMintableERC1155Predicate *Can only be called once.* @@ -199,8 +199,8 @@ Initilization function for RootERC1155Predicate | Name | Type | Description | |---|---|---| -| newL2StateSender | address | Address of StateSender to send deposit information to | -| newStateReceiver | address | Address of ExitHelper to receive withdrawal information from | +| newL2StateSender | address | Address of L2StateSender to send deposit information to | +| newStateReceiver | address | Address of StateReceiver to receive withdrawal information from | | newChildERC1155Predicate | address | Address of child ERC1155 predicate to communicate with | | newChildTokenTemplate | address | undefined | diff --git a/docs/child/RootMintableERC1155PredicateAccessList.md b/docs/child/RootMintableERC1155PredicateAccessList.md new file mode 100644 index 00000000..d5f9760e --- /dev/null +++ b/docs/child/RootMintableERC1155PredicateAccessList.md @@ -0,0 +1,865 @@ +# RootMintableERC1155PredicateAccessList + +*Polygon Technology (@QEDK)* + +> RootMintableERC1155PredicateAccessList + +Enables child-chain origin ERC1155 token deposits and withdrawals (only from allowlisted address, and not from blocklisted addresses) across an arbitrary root chain and child chain + + + +## Methods + +### ALLOWLIST_PRECOMPILE + +```solidity +function ALLOWLIST_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### BLOCKLIST_PRECOMPILE + +```solidity +function BLOCKLIST_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### DEPOSIT_BATCH_SIG + +```solidity +function DEPOSIT_BATCH_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### DEPOSIT_SIG + +```solidity +function DEPOSIT_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### MAP_TOKEN_SIG + +```solidity +function MAP_TOKEN_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### NATIVE_TOKEN_CONTRACT + +```solidity +function NATIVE_TOKEN_CONTRACT() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### NATIVE_TRANSFER_PRECOMPILE + +```solidity +function NATIVE_TRANSFER_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### NATIVE_TRANSFER_PRECOMPILE_GAS + +```solidity +function NATIVE_TRANSFER_PRECOMPILE_GAS() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### READ_ADDRESSLIST_GAS + +```solidity +function READ_ADDRESSLIST_GAS() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### SYSTEM + +```solidity +function SYSTEM() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### VALIDATOR_PKCHECK_PRECOMPILE + +```solidity +function VALIDATOR_PKCHECK_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### VALIDATOR_PKCHECK_PRECOMPILE_GAS + +```solidity +function VALIDATOR_PKCHECK_PRECOMPILE_GAS() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### WITHDRAW_BATCH_SIG + +```solidity +function WITHDRAW_BATCH_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### WITHDRAW_SIG + +```solidity +function WITHDRAW_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### acceptOwnership + +```solidity +function acceptOwnership() external nonpayable +``` + + + +*The new owner accepts the ownership transfer.* + + +### childERC1155Predicate + +```solidity +function childERC1155Predicate() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### childTokenTemplate + +```solidity +function childTokenTemplate() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### deposit + +```solidity +function deposit(contract IERC1155MetadataURI rootToken, uint256 tokenId, uint256 amount) external nonpayable +``` + +Function to deposit tokens from the depositor to themselves on the child chain + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC1155MetadataURI | Address of the root token being deposited | +| tokenId | uint256 | Index of the NFT to deposit | +| amount | uint256 | Amount to deposit | + +### depositBatch + +```solidity +function depositBatch(contract IERC1155MetadataURI rootToken, address[] receivers, uint256[] tokenIds, uint256[] amounts) external nonpayable +``` + +Function to deposit tokens from the depositor to other addresses on the child chain + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC1155MetadataURI | Address of the root token being deposited | +| receivers | address[] | Addresses of the receivers on the child chain | +| tokenIds | uint256[] | Indeices of the NFTs to deposit | +| amounts | uint256[] | Amounts to deposit | + +### depositTo + +```solidity +function depositTo(contract IERC1155MetadataURI rootToken, address receiver, uint256 tokenId, uint256 amount) external nonpayable +``` + +Function to deposit tokens from the depositor to another address on the child chain + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC1155MetadataURI | Address of the root token being deposited | +| receiver | address | undefined | +| tokenId | uint256 | Index of the NFT to deposit | +| amount | uint256 | Amount to deposit | + +### initialize + +```solidity +function initialize(address newL2StateSender, address newStateReceiver, address newChildERC1155Predicate, address newChildTokenTemplate, bool newUseAllowList, bool newUseBlockList, address newOwner) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newL2StateSender | address | undefined | +| newStateReceiver | address | undefined | +| newChildERC1155Predicate | address | undefined | +| newChildTokenTemplate | address | undefined | +| newUseAllowList | bool | undefined | +| newUseBlockList | bool | undefined | +| newOwner | address | undefined | + +### initialize + +```solidity +function initialize(address newL2StateSender, address newStateReceiver, address newChildERC1155Predicate, address newChildTokenTemplate) external nonpayable +``` + +Initialization function for RootMintableERC1155Predicate + +*Can only be called once.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newL2StateSender | address | Address of L2StateSender to send deposit information to | +| newStateReceiver | address | Address of StateReceiver to receive withdrawal information from | +| newChildERC1155Predicate | address | Address of child ERC1155 predicate to communicate with | +| newChildTokenTemplate | address | undefined | + +### l2StateSender + +```solidity +function l2StateSender() external view returns (contract IStateSender) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | contract IStateSender | undefined | + +### mapToken + +```solidity +function mapToken(contract IERC1155MetadataURI rootToken) external nonpayable returns (address childToken) +``` + +Function to be used for token mapping + +*Called internally on deposit if token is not mapped already* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC1155MetadataURI | Address of the root token to map | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| childToken | address | Address of the mapped child token | + +### onERC1155BatchReceived + +```solidity +function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external nonpayable returns (bytes4) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256[] | undefined | +| _3 | uint256[] | undefined | +| _4 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### onERC1155Received + +```solidity +function onERC1155Received(address, address, uint256, uint256, bytes) external nonpayable returns (bytes4) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256 | undefined | +| _3 | uint256 | undefined | +| _4 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### onStateReceive + +```solidity +function onStateReceive(uint256, address sender, bytes data) external nonpayable +``` + +Function to be used for token withdrawals + +*Can be extended to include other signatures for more functionality* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | +| sender | address | undefined | +| data | bytes | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + + + +*Returns the address of the current owner.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### pendingOwner + +```solidity +function pendingOwner() external view returns (address) +``` + + + +*Returns the address of the pending owner.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + + + +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* + + +### rootTokenToChildToken + +```solidity +function rootTokenToChildToken(address) external view returns (address) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### setAllowList + +```solidity +function setAllowList(bool newUseAllowList) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newUseAllowList | bool | undefined | + +### setBlockList + +```solidity +function setBlockList(bool newUseBlockList) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newUseBlockList | bool | undefined | + +### stateReceiver + +```solidity +function stateReceiver() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + + + +*See {IERC165-supportsInterface}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + + + +*Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newOwner | address | undefined | + + + +## Events + +### AllowListUsageSet + +```solidity +event AllowListUsageSet(uint256 indexed block, bool indexed status) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| block `indexed` | uint256 | undefined | +| status `indexed` | bool | undefined | + +### BlockListUsageSet + +```solidity +event BlockListUsageSet(uint256 indexed block, bool indexed status) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| block `indexed` | uint256 | undefined | +| status `indexed` | bool | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + +### L2MintableERC1155Deposit + +```solidity +event L2MintableERC1155Deposit(address indexed rootToken, address indexed childToken, address depositor, address indexed receiver, uint256 tokenId, uint256 amount) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | +| depositor | address | undefined | +| receiver `indexed` | address | undefined | +| tokenId | uint256 | undefined | +| amount | uint256 | undefined | + +### L2MintableERC1155DepositBatch + +```solidity +event L2MintableERC1155DepositBatch(address indexed rootToken, address indexed childToken, address indexed depositor, address[] receivers, uint256[] tokenIds, uint256[] amounts) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | +| depositor `indexed` | address | undefined | +| receivers | address[] | undefined | +| tokenIds | uint256[] | undefined | +| amounts | uint256[] | undefined | + +### L2MintableERC1155Withdraw + +```solidity +event L2MintableERC1155Withdraw(address indexed rootToken, address indexed childToken, address withdrawer, address indexed receiver, uint256 tokenId, uint256 amount) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | +| withdrawer | address | undefined | +| receiver `indexed` | address | undefined | +| tokenId | uint256 | undefined | +| amount | uint256 | undefined | + +### L2MintableERC1155WithdrawBatch + +```solidity +event L2MintableERC1155WithdrawBatch(address indexed rootToken, address indexed childToken, address indexed withdrawer, address[] receivers, uint256[] tokenIds, uint256[] amounts) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | +| withdrawer `indexed` | address | undefined | +| receivers | address[] | undefined | +| tokenIds | uint256[] | undefined | +| amounts | uint256[] | undefined | + +### L2MintableTokenMapped + +```solidity +event L2MintableTokenMapped(address indexed rootToken, address indexed childToken) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | + +### OwnershipTransferStarted + +```solidity +event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + + + +## Errors + +### Unauthorized + +```solidity +error Unauthorized(string only) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| only | string | undefined | + + diff --git a/docs/child/RootMintableERC20Predicate.md b/docs/child/RootMintableERC20Predicate.md index 7f33cb94..fd16b89e 100644 --- a/docs/child/RootMintableERC20Predicate.md +++ b/docs/child/RootMintableERC20Predicate.md @@ -289,7 +289,7 @@ Function to deposit tokens from the depositor to another address on the child ch function initialize(address newL2StateSender, address newStateReceiver, address newChildERC20Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for RootMintableERC20Predicate +Initialization function for RootMintableERC20Predicate *Can only be called once.* @@ -299,7 +299,7 @@ Initilization function for RootMintableERC20Predicate |---|---|---| | newL2StateSender | address | Address of L2StateSender to send exit information to | | newStateReceiver | address | Address of StateReceiver to receive deposit information from | -| newChildERC20Predicate | address | Address of root ERC20 predicate to communicate with | +| newChildERC20Predicate | address | Address of child ERC20 predicate to communicate with | | newChildTokenTemplate | address | Address of child token implementation to deploy clones of | ### l2StateSender diff --git a/docs/child/RootMintableERC20PredicateAccessList.md b/docs/child/RootMintableERC20PredicateAccessList.md new file mode 100644 index 00000000..5d07acfa --- /dev/null +++ b/docs/child/RootMintableERC20PredicateAccessList.md @@ -0,0 +1,692 @@ +# RootMintableERC20PredicateAccessList + +*Polygon Technology (@QEDK)* + +> RootMintableERC20PredicateAccessList + +Enables child-chain origin ERC20 token deposits and withdrawals (only from allowlisted address, and not from blocklisted addresses) across an arbitrary root chain and child chain + + + +## Methods + +### ALLOWLIST_PRECOMPILE + +```solidity +function ALLOWLIST_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### BLOCKLIST_PRECOMPILE + +```solidity +function BLOCKLIST_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### DEPOSIT_SIG + +```solidity +function DEPOSIT_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### MAP_TOKEN_SIG + +```solidity +function MAP_TOKEN_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### NATIVE_TOKEN_CONTRACT + +```solidity +function NATIVE_TOKEN_CONTRACT() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### NATIVE_TRANSFER_PRECOMPILE + +```solidity +function NATIVE_TRANSFER_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### NATIVE_TRANSFER_PRECOMPILE_GAS + +```solidity +function NATIVE_TRANSFER_PRECOMPILE_GAS() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### READ_ADDRESSLIST_GAS + +```solidity +function READ_ADDRESSLIST_GAS() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### SYSTEM + +```solidity +function SYSTEM() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### VALIDATOR_PKCHECK_PRECOMPILE + +```solidity +function VALIDATOR_PKCHECK_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### VALIDATOR_PKCHECK_PRECOMPILE_GAS + +```solidity +function VALIDATOR_PKCHECK_PRECOMPILE_GAS() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### WITHDRAW_SIG + +```solidity +function WITHDRAW_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### acceptOwnership + +```solidity +function acceptOwnership() external nonpayable +``` + + + +*The new owner accepts the ownership transfer.* + + +### childERC20Predicate + +```solidity +function childERC20Predicate() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### childTokenTemplate + +```solidity +function childTokenTemplate() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### deposit + +```solidity +function deposit(contract IERC20Metadata rootToken, uint256 amount) external nonpayable +``` + +Function to deposit tokens from the depositor to themselves on the child chain + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC20Metadata | Address of the root token being deposited | +| amount | uint256 | Amount to deposit | + +### depositTo + +```solidity +function depositTo(contract IERC20Metadata rootToken, address receiver, uint256 amount) external nonpayable +``` + +Function to deposit tokens from the depositor to another address on the child chain + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC20Metadata | Address of the root token being deposited | +| receiver | address | undefined | +| amount | uint256 | Amount to deposit | + +### initialize + +```solidity +function initialize(address newL2StateSender, address newStateReceiver, address newChildERC20Predicate, address newChildTokenTemplate, bool newUseAllowList, bool newUseBlockList, address newOwner) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newL2StateSender | address | undefined | +| newStateReceiver | address | undefined | +| newChildERC20Predicate | address | undefined | +| newChildTokenTemplate | address | undefined | +| newUseAllowList | bool | undefined | +| newUseBlockList | bool | undefined | +| newOwner | address | undefined | + +### initialize + +```solidity +function initialize(address newL2StateSender, address newStateReceiver, address newChildERC20Predicate, address newChildTokenTemplate) external nonpayable +``` + +Initialization function for RootMintableERC20Predicate + +*Can only be called once.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newL2StateSender | address | Address of L2StateSender to send exit information to | +| newStateReceiver | address | Address of StateReceiver to receive deposit information from | +| newChildERC20Predicate | address | Address of child ERC20 predicate to communicate with | +| newChildTokenTemplate | address | Address of child token implementation to deploy clones of | + +### l2StateSender + +```solidity +function l2StateSender() external view returns (contract IStateSender) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | contract IStateSender | undefined | + +### mapToken + +```solidity +function mapToken(contract IERC20Metadata rootToken) external nonpayable returns (address) +``` + +Function to be used for token mapping + +*Called internally on deposit if token is not mapped already* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC20Metadata | Address of the root token to map | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | address Address of the child token | + +### onStateReceive + +```solidity +function onStateReceive(uint256, address sender, bytes data) external nonpayable +``` + +Function to be used for token withdrawals + +*Can be extended to include other signatures for more functionality* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | +| sender | address | Address of the sender on the root chain | +| data | bytes | Data sent by the sender | + +### owner + +```solidity +function owner() external view returns (address) +``` + + + +*Returns the address of the current owner.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### pendingOwner + +```solidity +function pendingOwner() external view returns (address) +``` + + + +*Returns the address of the pending owner.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + + + +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* + + +### rootTokenToChildToken + +```solidity +function rootTokenToChildToken(address) external view returns (address) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### setAllowList + +```solidity +function setAllowList(bool newUseAllowList) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newUseAllowList | bool | undefined | + +### setBlockList + +```solidity +function setBlockList(bool newUseBlockList) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newUseBlockList | bool | undefined | + +### stateReceiver + +```solidity +function stateReceiver() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + + + +*Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newOwner | address | undefined | + + + +## Events + +### AllowListUsageSet + +```solidity +event AllowListUsageSet(uint256 indexed block, bool indexed status) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| block `indexed` | uint256 | undefined | +| status `indexed` | bool | undefined | + +### BlockListUsageSet + +```solidity +event BlockListUsageSet(uint256 indexed block, bool indexed status) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| block `indexed` | uint256 | undefined | +| status `indexed` | bool | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + +### L2MintableERC20Deposit + +```solidity +event L2MintableERC20Deposit(address indexed rootToken, address indexed childToken, address depositor, address indexed receiver, uint256 amount) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | +| depositor | address | undefined | +| receiver `indexed` | address | undefined | +| amount | uint256 | undefined | + +### L2MintableERC20Withdraw + +```solidity +event L2MintableERC20Withdraw(address indexed rootToken, address indexed childToken, address withdrawer, address indexed receiver, uint256 amount) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | +| withdrawer | address | undefined | +| receiver `indexed` | address | undefined | +| amount | uint256 | undefined | + +### L2MintableTokenMapped + +```solidity +event L2MintableTokenMapped(address indexed rootToken, address indexed childToken) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | + +### OwnershipTransferStarted + +```solidity +event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + + + +## Errors + +### Unauthorized + +```solidity +error Unauthorized(string only) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| only | string | undefined | + + diff --git a/docs/child/RootMintableERC721Predicate.md b/docs/child/RootMintableERC721Predicate.md index f85d2910..0302f286 100644 --- a/docs/child/RootMintableERC721Predicate.md +++ b/docs/child/RootMintableERC721Predicate.md @@ -341,7 +341,7 @@ Function to deposit tokens from the depositor to another address on the child ch function initialize(address newL2StateSender, address newStateReceiver, address newChildERC721Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for RootMintableERC721Predicate +Initialization function for RootMintableERC721Predicate *Can only be called once.* @@ -349,8 +349,8 @@ Initilization function for RootMintableERC721Predicate | Name | Type | Description | |---|---|---| -| newL2StateSender | address | Address of StateSender to send deposit information to | -| newStateReceiver | address | Address of ExitHelper to receive withdrawal information from | +| newL2StateSender | address | Address of L2StateSender to send deposit information to | +| newStateReceiver | address | Address of StateReceiver to receive withdrawal information from | | newChildERC721Predicate | address | Address of child ERC721 predicate to communicate with | | newChildTokenTemplate | address | Address of child token template to calculate child token addresses | diff --git a/docs/child/RootMintableERC721PredicateAccessList.md b/docs/child/RootMintableERC721PredicateAccessList.md new file mode 100644 index 00000000..1eeae374 --- /dev/null +++ b/docs/child/RootMintableERC721PredicateAccessList.md @@ -0,0 +1,809 @@ +# RootMintableERC721PredicateAccessList + +*Polygon Technology (@QEDK)* + +> RootMintableERC721PredicateAccessList + +Enables child-chain origin ERC721 token deposits and withdrawals (only from allowlisted address, and not from blocklisted addresses) across an arbitrary root chain and child chain + + + +## Methods + +### ALLOWLIST_PRECOMPILE + +```solidity +function ALLOWLIST_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### BLOCKLIST_PRECOMPILE + +```solidity +function BLOCKLIST_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### DEPOSIT_BATCH_SIG + +```solidity +function DEPOSIT_BATCH_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### DEPOSIT_SIG + +```solidity +function DEPOSIT_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### MAP_TOKEN_SIG + +```solidity +function MAP_TOKEN_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### NATIVE_TOKEN_CONTRACT + +```solidity +function NATIVE_TOKEN_CONTRACT() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### NATIVE_TRANSFER_PRECOMPILE + +```solidity +function NATIVE_TRANSFER_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### NATIVE_TRANSFER_PRECOMPILE_GAS + +```solidity +function NATIVE_TRANSFER_PRECOMPILE_GAS() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### READ_ADDRESSLIST_GAS + +```solidity +function READ_ADDRESSLIST_GAS() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### SYSTEM + +```solidity +function SYSTEM() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### VALIDATOR_PKCHECK_PRECOMPILE + +```solidity +function VALIDATOR_PKCHECK_PRECOMPILE() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### VALIDATOR_PKCHECK_PRECOMPILE_GAS + +```solidity +function VALIDATOR_PKCHECK_PRECOMPILE_GAS() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### WITHDRAW_BATCH_SIG + +```solidity +function WITHDRAW_BATCH_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### WITHDRAW_SIG + +```solidity +function WITHDRAW_SIG() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### acceptOwnership + +```solidity +function acceptOwnership() external nonpayable +``` + + + +*The new owner accepts the ownership transfer.* + + +### childERC721Predicate + +```solidity +function childERC721Predicate() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### childTokenTemplate + +```solidity +function childTokenTemplate() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### deposit + +```solidity +function deposit(contract IERC721Metadata rootToken, uint256 tokenId) external nonpayable +``` + +Function to deposit tokens from the depositor to themselves on the child chain + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC721Metadata | Address of the root token being deposited | +| tokenId | uint256 | Index of the NFT to deposit | + +### depositBatch + +```solidity +function depositBatch(contract IERC721Metadata rootToken, address[] receivers, uint256[] tokenIds) external nonpayable +``` + +Function to deposit tokens from the depositor to other addresses on the child chain + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC721Metadata | Address of the root token being deposited | +| receivers | address[] | Addresses of the receivers on the child chain | +| tokenIds | uint256[] | Indeices of the NFTs to deposit | + +### depositTo + +```solidity +function depositTo(contract IERC721Metadata rootToken, address receiver, uint256 tokenId) external nonpayable +``` + +Function to deposit tokens from the depositor to another address on the child chain + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC721Metadata | Address of the root token being deposited | +| receiver | address | undefined | +| tokenId | uint256 | Index of the NFT to deposit | + +### initialize + +```solidity +function initialize(address newL2StateSender, address newStateReceiver, address newChildERC721Predicate, address newChildTokenTemplate, bool newUseAllowList, bool newUseBlockList, address newOwner) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newL2StateSender | address | undefined | +| newStateReceiver | address | undefined | +| newChildERC721Predicate | address | undefined | +| newChildTokenTemplate | address | undefined | +| newUseAllowList | bool | undefined | +| newUseBlockList | bool | undefined | +| newOwner | address | undefined | + +### initialize + +```solidity +function initialize(address newL2StateSender, address newStateReceiver, address newChildERC721Predicate, address newChildTokenTemplate) external nonpayable +``` + +Initialization function for RootMintableERC721Predicate + +*Can only be called once.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newL2StateSender | address | Address of L2StateSender to send deposit information to | +| newStateReceiver | address | Address of StateReceiver to receive withdrawal information from | +| newChildERC721Predicate | address | Address of child ERC721 predicate to communicate with | +| newChildTokenTemplate | address | Address of child token template to calculate child token addresses | + +### l2StateSender + +```solidity +function l2StateSender() external view returns (contract IStateSender) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | contract IStateSender | undefined | + +### mapToken + +```solidity +function mapToken(contract IERC721Metadata rootToken) external nonpayable returns (address) +``` + +Function to be used for token mapping + +*Called internally on deposit if token is not mapped already* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken | contract IERC721Metadata | Address of the root token to map | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | Address of the mapped child token | + +### onERC721Received + +```solidity +function onERC721Received(address, address, uint256, bytes) external nonpayable returns (bytes4) +``` + + + +*See {IERC721Receiver-onERC721Received}. Always returns `IERC721Receiver.onERC721Received.selector`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256 | undefined | +| _3 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### onStateReceive + +```solidity +function onStateReceive(uint256, address sender, bytes data) external nonpayable +``` + +Function to be used for token withdrawals + +*Can be extended to include other signatures for more functionality* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | +| sender | address | undefined | +| data | bytes | undefined | + +### owner + +```solidity +function owner() external view returns (address) +``` + + + +*Returns the address of the current owner.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### pendingOwner + +```solidity +function pendingOwner() external view returns (address) +``` + + + +*Returns the address of the pending owner.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### renounceOwnership + +```solidity +function renounceOwnership() external nonpayable +``` + + + +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* + + +### rootTokenToChildToken + +```solidity +function rootTokenToChildToken(address) external view returns (address) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### setAllowList + +```solidity +function setAllowList(bool newUseAllowList) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newUseAllowList | bool | undefined | + +### setBlockList + +```solidity +function setBlockList(bool newUseBlockList) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newUseBlockList | bool | undefined | + +### stateReceiver + +```solidity +function stateReceiver() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### transferOwnership + +```solidity +function transferOwnership(address newOwner) external nonpayable +``` + + + +*Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newOwner | address | undefined | + + + +## Events + +### AllowListUsageSet + +```solidity +event AllowListUsageSet(uint256 indexed block, bool indexed status) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| block `indexed` | uint256 | undefined | +| status `indexed` | bool | undefined | + +### BlockListUsageSet + +```solidity +event BlockListUsageSet(uint256 indexed block, bool indexed status) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| block `indexed` | uint256 | undefined | +| status `indexed` | bool | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + +### L2MintableERC721Deposit + +```solidity +event L2MintableERC721Deposit(address indexed rootToken, address indexed childToken, address depositor, address indexed receiver, uint256 tokenId) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | +| depositor | address | undefined | +| receiver `indexed` | address | undefined | +| tokenId | uint256 | undefined | + +### L2MintableERC721DepositBatch + +```solidity +event L2MintableERC721DepositBatch(address indexed rootToken, address indexed childToken, address indexed depositor, address[] receivers, uint256[] tokenIds) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | +| depositor `indexed` | address | undefined | +| receivers | address[] | undefined | +| tokenIds | uint256[] | undefined | + +### L2MintableERC721Withdraw + +```solidity +event L2MintableERC721Withdraw(address indexed rootToken, address indexed childToken, address withdrawer, address indexed receiver, uint256 tokenId) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | +| withdrawer | address | undefined | +| receiver `indexed` | address | undefined | +| tokenId | uint256 | undefined | + +### L2MintableERC721WithdrawBatch + +```solidity +event L2MintableERC721WithdrawBatch(address indexed rootToken, address indexed childToken, address indexed withdrawer, address[] receivers, uint256[] tokenIds) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | +| withdrawer `indexed` | address | undefined | +| receivers | address[] | undefined | +| tokenIds | uint256[] | undefined | + +### L2MintableTokenMapped + +```solidity +event L2MintableTokenMapped(address indexed rootToken, address indexed childToken) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| rootToken `indexed` | address | undefined | +| childToken `indexed` | address | undefined | + +### OwnershipTransferStarted + +```solidity +event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + +### OwnershipTransferred + +```solidity +event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | + + + +## Errors + +### Unauthorized + +```solidity +error Unauthorized(string only) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| only | string | undefined | + + diff --git a/docs/child/governance/ChildGovernor.md b/docs/child/governance/ChildGovernor.md new file mode 100644 index 00000000..51e2b156 --- /dev/null +++ b/docs/child/governance/ChildGovernor.md @@ -0,0 +1,1281 @@ +# ChildGovernor + + + + + + + + + +## Methods + +### BALLOT_TYPEHASH + +```solidity +function BALLOT_TYPEHASH() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### CLOCK_MODE + +```solidity +function CLOCK_MODE() external view returns (string) +``` + + + +*Machine-readable description of the clock as specified in EIP-6372.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### COUNTING_MODE + +```solidity +function COUNTING_MODE() external pure returns (string) +``` + +module:voting + +*A description of the possible `support` values for {castVote} and the way these votes are counted, meant to be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`. There are 2 standard keys: `support` and `quorum`. - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`. - `quorum=bravo` means that only For votes are counted towards quorum. - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum. If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique name that describes the behavior. For example: - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain. - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote. NOTE: The string can be decoded by the standard https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`] JavaScript class.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### EXTENDED_BALLOT_TYPEHASH + +```solidity +function EXTENDED_BALLOT_TYPEHASH() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### cancel + +```solidity +function cancel(uint256 proposalId) external nonpayable +``` + + + +*Cancel a proposal with GovernorBravo logic.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### cancel + +```solidity +function cancel(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external nonpayable returns (uint256) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### castVote + +```solidity +function castVote(uint256 proposalId, uint8 support) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-castVote}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### castVoteBySig + +```solidity +function castVoteBySig(uint256 proposalId, uint8 support, uint8 v, bytes32 r, bytes32 s) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-castVoteBySig}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| v | uint8 | undefined | +| r | bytes32 | undefined | +| s | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### castVoteWithReason + +```solidity +function castVoteWithReason(uint256 proposalId, uint8 support, string reason) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-castVoteWithReason}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| reason | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### castVoteWithReasonAndParams + +```solidity +function castVoteWithReasonAndParams(uint256 proposalId, uint8 support, string reason, bytes params) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-castVoteWithReasonAndParams}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| reason | string | undefined | +| params | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### castVoteWithReasonAndParamsBySig + +```solidity +function castVoteWithReasonAndParamsBySig(uint256 proposalId, uint8 support, string reason, bytes params, uint8 v, bytes32 r, bytes32 s) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-castVoteWithReasonAndParamsBySig}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| reason | string | undefined | +| params | bytes | undefined | +| v | uint8 | undefined | +| r | bytes32 | undefined | +| s | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### clock + +```solidity +function clock() external view returns (uint48) +``` + + + +*Clock (as specified in EIP-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement EIP-6372.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint48 | undefined | + +### eip712Domain + +```solidity +function eip712Domain() external view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) +``` + + + +*See {EIP-5267}. _Available since v4.9._* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| fields | bytes1 | undefined | +| name | string | undefined | +| version | string | undefined | +| chainId | uint256 | undefined | +| verifyingContract | address | undefined | +| salt | bytes32 | undefined | +| extensions | uint256[] | undefined | + +### execute + +```solidity +function execute(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external payable returns (uint256) +``` + + + +*See {IGovernor-execute}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### execute + +```solidity +function execute(uint256 proposalId) external payable +``` + + + +*See {IGovernorCompatibilityBravo-execute}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### getActions + +```solidity +function getActions(uint256 proposalId) external view returns (address[] targets, uint256[] values, string[] signatures, bytes[] calldatas) +``` + + + +*See {IGovernorCompatibilityBravo-getActions}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| signatures | string[] | undefined | +| calldatas | bytes[] | undefined | + +### getReceipt + +```solidity +function getReceipt(uint256 proposalId, address voter) external view returns (struct IGovernorCompatibilityBravoUpgradeable.Receipt) +``` + + + +*See {IGovernorCompatibilityBravo-getReceipt}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| voter | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | IGovernorCompatibilityBravoUpgradeable.Receipt | undefined | + +### getVotes + +```solidity +function getVotes(address account, uint256 timepoint) external view returns (uint256) +``` + + + +*See {IGovernor-getVotes}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | +| timepoint | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### getVotesWithParams + +```solidity +function getVotesWithParams(address account, uint256 timepoint, bytes params) external view returns (uint256) +``` + + + +*See {IGovernor-getVotesWithParams}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | +| timepoint | uint256 | undefined | +| params | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### hasVoted + +```solidity +function hasVoted(uint256 proposalId, address account) external view returns (bool) +``` + + + +*See {IGovernor-hasVoted}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### hashProposal + +```solidity +function hashProposal(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external pure returns (uint256) +``` + + + +*See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### initialize + +```solidity +function initialize(contract IVotesUpgradeable token_, contract TimelockControllerUpgradeable timelock_, uint256 quorumNumerator_, address networkParams) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| token_ | contract IVotesUpgradeable | undefined | +| timelock_ | contract TimelockControllerUpgradeable | undefined | +| quorumNumerator_ | uint256 | undefined | +| networkParams | address | undefined | + +### name + +```solidity +function name() external view returns (string) +``` + + + +*See {IGovernor-name}.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### onERC1155BatchReceived + +```solidity +function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external nonpayable returns (bytes4) +``` + + + +*See {IERC1155Receiver-onERC1155BatchReceived}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256[] | undefined | +| _3 | uint256[] | undefined | +| _4 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### onERC1155Received + +```solidity +function onERC1155Received(address, address, uint256, uint256, bytes) external nonpayable returns (bytes4) +``` + + + +*See {IERC1155Receiver-onERC1155Received}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256 | undefined | +| _3 | uint256 | undefined | +| _4 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### onERC721Received + +```solidity +function onERC721Received(address, address, uint256, bytes) external nonpayable returns (bytes4) +``` + + + +*See {IERC721Receiver-onERC721Received}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256 | undefined | +| _3 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### proposalDeadline + +```solidity +function proposalDeadline(uint256 proposalId) external view returns (uint256) +``` + + + +*See {IGovernor-proposalDeadline}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### proposalEta + +```solidity +function proposalEta(uint256 proposalId) external view returns (uint256) +``` + + + +*Public accessor to check the eta of a queued proposal* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### proposalProposer + +```solidity +function proposalProposer(uint256 proposalId) external view returns (address) +``` + + + +*Returns the account that created a given proposal.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### proposalSnapshot + +```solidity +function proposalSnapshot(uint256 proposalId) external view returns (uint256) +``` + + + +*See {IGovernor-proposalSnapshot}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### proposalThreshold + +```solidity +function proposalThreshold() external view returns (uint256) +``` + + + +*Part of the Governor Bravo's interface: _"The number of votes required in order for a voter to become a proposer"_.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### proposals + +```solidity +function proposals(uint256 proposalId) external view returns (uint256 id, address proposer, uint256 eta, uint256 startBlock, uint256 endBlock, uint256 forVotes, uint256 againstVotes, uint256 abstainVotes, bool canceled, bool executed) +``` + + + +*See {IGovernorCompatibilityBravo-proposals}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| id | uint256 | undefined | +| proposer | address | undefined | +| eta | uint256 | undefined | +| startBlock | uint256 | undefined | +| endBlock | uint256 | undefined | +| forVotes | uint256 | undefined | +| againstVotes | uint256 | undefined | +| abstainVotes | uint256 | undefined | +| canceled | bool | undefined | +| executed | bool | undefined | + +### propose + +```solidity +function propose(address[] targets, uint256[] values, bytes[] calldatas, string description) external nonpayable returns (uint256) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| description | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### propose + +```solidity +function propose(address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, string description) external nonpayable returns (uint256) +``` + + + +*See {IGovernorCompatibilityBravo-propose}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| signatures | string[] | undefined | +| calldatas | bytes[] | undefined | +| description | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### queue + +```solidity +function queue(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external nonpayable returns (uint256) +``` + + + +*Function to queue a proposal to the timelock.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### queue + +```solidity +function queue(uint256 proposalId) external nonpayable +``` + + + +*See {IGovernorCompatibilityBravo-queue}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### quorum + +```solidity +function quorum(uint256 timepoint) external view returns (uint256) +``` + + + +*Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| timepoint | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### quorumDenominator + +```solidity +function quorumDenominator() external view returns (uint256) +``` + + + +*Returns the quorum denominator. Defaults to 100, but may be overridden.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### quorumNumerator + +```solidity +function quorumNumerator(uint256 timepoint) external view returns (uint256) +``` + + + +*Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| timepoint | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### quorumNumerator + +```solidity +function quorumNumerator() external view returns (uint256) +``` + + + +*Returns the current quorum numerator. See {quorumDenominator}.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### quorumVotes + +```solidity +function quorumVotes() external view returns (uint256) +``` + + + +*See {IGovernorCompatibilityBravo-quorumVotes}.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### relay + +```solidity +function relay(address target, uint256 value, bytes data) external payable +``` + + + +*Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| target | address | undefined | +| value | uint256 | undefined | +| data | bytes | undefined | + +### state + +```solidity +function state(uint256 proposalId) external view returns (enum IGovernorUpgradeable.ProposalState) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | enum IGovernorUpgradeable.ProposalState | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### timelock + +```solidity +function timelock() external view returns (address) +``` + + + +*Public accessor to check the address of the timelock* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### token + +```solidity +function token() external view returns (contract IERC5805Upgradeable) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | contract IERC5805Upgradeable | undefined | + +### updateQuorumNumerator + +```solidity +function updateQuorumNumerator(uint256 newQuorumNumerator) external nonpayable +``` + + + +*Changes the quorum numerator. Emits a {QuorumNumeratorUpdated} event. Requirements: - Must be called through a governance proposal. - New numerator must be smaller or equal to the denominator.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newQuorumNumerator | uint256 | undefined | + +### updateTimelock + +```solidity +function updateTimelock(contract TimelockControllerUpgradeable newTimelock) external nonpayable +``` + + + +*Public endpoint to update the underlying timelock instance. Restricted to the timelock itself, so updates must be proposed, scheduled, and executed through governance proposals. CAUTION: It is not recommended to change the timelock while there are other queued governance proposals.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newTimelock | contract TimelockControllerUpgradeable | undefined | + +### version + +```solidity +function version() external view returns (string) +``` + + + +*See {IGovernor-version}.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### votingDelay + +```solidity +function votingDelay() external view returns (uint256) +``` + +module:user-config + +*Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends on the clock (see EIP-6372) this contract uses. This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a proposal starts.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### votingPeriod + +```solidity +function votingPeriod() external view returns (uint256) +``` + +module:user-config + +*Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock (see EIP-6372) this contract uses. NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting duration compared to the voting delay.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + + + +## Events + +### EIP712DomainChanged + +```solidity +event EIP712DomainChanged() +``` + + + +*MAY be emitted to signal that the domain could have changed.* + + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + +### ProposalCanceled + +```solidity +event ProposalCanceled(uint256 proposalId) +``` + + + +*Emitted when a proposal is canceled.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### ProposalCreated + +```solidity +event ProposalCreated(uint256 proposalId, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 voteStart, uint256 voteEnd, string description) +``` + + + +*Emitted when a proposal is created.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| proposer | address | undefined | +| targets | address[] | undefined | +| values | uint256[] | undefined | +| signatures | string[] | undefined | +| calldatas | bytes[] | undefined | +| voteStart | uint256 | undefined | +| voteEnd | uint256 | undefined | +| description | string | undefined | + +### ProposalExecuted + +```solidity +event ProposalExecuted(uint256 proposalId) +``` + + + +*Emitted when a proposal is executed.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### ProposalQueued + +```solidity +event ProposalQueued(uint256 proposalId, uint256 eta) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| eta | uint256 | undefined | + +### QuorumNumeratorUpdated + +```solidity +event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| oldQuorumNumerator | uint256 | undefined | +| newQuorumNumerator | uint256 | undefined | + +### TimelockChange + +```solidity +event TimelockChange(address oldTimelock, address newTimelock) +``` + + + +*Emitted when the timelock controller used for proposal execution is modified.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| oldTimelock | address | undefined | +| newTimelock | address | undefined | + +### VoteCast + +```solidity +event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason) +``` + + + +*Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| voter `indexed` | address | undefined | +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| weight | uint256 | undefined | +| reason | string | undefined | + +### VoteCastWithParams + +```solidity +event VoteCastWithParams(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason, bytes params) +``` + + + +*Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpepretation also depends on the voting module used.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| voter `indexed` | address | undefined | +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| weight | uint256 | undefined | +| reason | string | undefined | +| params | bytes | undefined | + + + +## Errors + +### Empty + +```solidity +error Empty() +``` + + + +*An operation (e.g. {front}) couldn't be completed due to the queue being empty.* + + + diff --git a/docs/child/governance/ChildTimelock.md b/docs/child/governance/ChildTimelock.md new file mode 100644 index 00000000..f88c950c --- /dev/null +++ b/docs/child/governance/ChildTimelock.md @@ -0,0 +1,772 @@ +# ChildTimelock + + + + + + + + + +## Methods + +### CANCELLER_ROLE + +```solidity +function CANCELLER_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### DEFAULT_ADMIN_ROLE + +```solidity +function DEFAULT_ADMIN_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### EXECUTOR_ROLE + +```solidity +function EXECUTOR_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### PROPOSER_ROLE + +```solidity +function PROPOSER_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### TIMELOCK_ADMIN_ROLE + +```solidity +function TIMELOCK_ADMIN_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### cancel + +```solidity +function cancel(bytes32 id) external nonpayable +``` + + + +*Cancel an operation. Requirements: - the caller must have the 'canceller' role.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| id | bytes32 | undefined | + +### execute + +```solidity +function execute(address target, uint256 value, bytes payload, bytes32 predecessor, bytes32 salt) external payable +``` + + + +*Execute an (ready) operation containing a single transaction. Emits a {CallExecuted} event. Requirements: - the caller must have the 'executor' role.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| target | address | undefined | +| value | uint256 | undefined | +| payload | bytes | undefined | +| predecessor | bytes32 | undefined | +| salt | bytes32 | undefined | + +### executeBatch + +```solidity +function executeBatch(address[] targets, uint256[] values, bytes[] payloads, bytes32 predecessor, bytes32 salt) external payable +``` + + + +*Execute an (ready) operation containing a batch of transactions. Emits one {CallExecuted} event per transaction in the batch. Requirements: - the caller must have the 'executor' role.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| payloads | bytes[] | undefined | +| predecessor | bytes32 | undefined | +| salt | bytes32 | undefined | + +### getMinDelay + +```solidity +function getMinDelay() external view returns (uint256) +``` + + + +*Returns the minimum delay for an operation to become valid. This value can be changed by executing an operation that calls `updateDelay`.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### getRoleAdmin + +```solidity +function getRoleAdmin(bytes32 role) external view returns (bytes32) +``` + + + +*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### getTimestamp + +```solidity +function getTimestamp(bytes32 id) external view returns (uint256) +``` + + + +*Returns the timestamp at which an operation becomes ready (0 for unset operations, 1 for done operations).* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| id | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### grantRole + +```solidity +function grantRole(bytes32 role, address account) external nonpayable +``` + + + +*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.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | undefined | +| account | address | undefined | + +### hasRole + +```solidity +function hasRole(bytes32 role, address account) external view returns (bool) +``` + + + +*Returns `true` if `account` has been granted `role`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | undefined | +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### hashOperation + +```solidity +function hashOperation(address target, uint256 value, bytes data, bytes32 predecessor, bytes32 salt) external pure returns (bytes32) +``` + + + +*Returns the identifier of an operation containing a single transaction.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| target | address | undefined | +| value | uint256 | undefined | +| data | bytes | undefined | +| predecessor | bytes32 | undefined | +| salt | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### hashOperationBatch + +```solidity +function hashOperationBatch(address[] targets, uint256[] values, bytes[] payloads, bytes32 predecessor, bytes32 salt) external pure returns (bytes32) +``` + + + +*Returns the identifier of an operation containing a batch of transactions.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| payloads | bytes[] | undefined | +| predecessor | bytes32 | undefined | +| salt | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### initialize + +```solidity +function initialize(uint256 minDelay, address[] proposers, address[] executors, address admin) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| minDelay | uint256 | undefined | +| proposers | address[] | undefined | +| executors | address[] | undefined | +| admin | address | undefined | + +### isOperation + +```solidity +function isOperation(bytes32 id) external view returns (bool) +``` + + + +*Returns whether an id correspond to a registered operation. This includes both Pending, Ready and Done operations.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| id | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### isOperationDone + +```solidity +function isOperationDone(bytes32 id) external view returns (bool) +``` + + + +*Returns whether an operation is done or not.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| id | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### isOperationPending + +```solidity +function isOperationPending(bytes32 id) external view returns (bool) +``` + + + +*Returns whether an operation is pending or not. Note that a "pending" operation may also be "ready".* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| id | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### isOperationReady + +```solidity +function isOperationReady(bytes32 id) external view returns (bool) +``` + + + +*Returns whether an operation is ready for execution. Note that a "ready" operation is also "pending".* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| id | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### onERC1155BatchReceived + +```solidity +function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external nonpayable returns (bytes4) +``` + + + +*See {IERC1155Receiver-onERC1155BatchReceived}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256[] | undefined | +| _3 | uint256[] | undefined | +| _4 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### onERC1155Received + +```solidity +function onERC1155Received(address, address, uint256, uint256, bytes) external nonpayable returns (bytes4) +``` + + + +*See {IERC1155Receiver-onERC1155Received}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256 | undefined | +| _3 | uint256 | undefined | +| _4 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### onERC721Received + +```solidity +function onERC721Received(address, address, uint256, bytes) external nonpayable returns (bytes4) +``` + + + +*See {IERC721Receiver-onERC721Received}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256 | undefined | +| _3 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### renounceRole + +```solidity +function renounceRole(bytes32 role, address account) external nonpayable +``` + + + +*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 `account`. May emit a {RoleRevoked} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | undefined | +| account | address | undefined | + +### revokeRole + +```solidity +function revokeRole(bytes32 role, address account) external nonpayable +``` + + + +*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.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | undefined | +| account | address | undefined | + +### schedule + +```solidity +function schedule(address target, uint256 value, bytes data, bytes32 predecessor, bytes32 salt, uint256 delay) external nonpayable +``` + + + +*Schedule an operation containing a single transaction. Emits {CallSalt} if salt is nonzero, and {CallScheduled}. Requirements: - the caller must have the 'proposer' role.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| target | address | undefined | +| value | uint256 | undefined | +| data | bytes | undefined | +| predecessor | bytes32 | undefined | +| salt | bytes32 | undefined | +| delay | uint256 | undefined | + +### scheduleBatch + +```solidity +function scheduleBatch(address[] targets, uint256[] values, bytes[] payloads, bytes32 predecessor, bytes32 salt, uint256 delay) external nonpayable +``` + + + +*Schedule an operation containing a batch of transactions. Emits {CallSalt} if salt is nonzero, and one {CallScheduled} event per transaction in the batch. Requirements: - the caller must have the 'proposer' role.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| payloads | bytes[] | undefined | +| predecessor | bytes32 | undefined | +| salt | bytes32 | undefined | +| delay | uint256 | undefined | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + + + +*See {IERC165-supportsInterface}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### updateDelay + +```solidity +function updateDelay(uint256 newDelay) external nonpayable +``` + + + +*Changes the minimum timelock duration for future operations. Emits a {MinDelayChange} event. Requirements: - the caller must be the timelock itself. This can only be achieved by scheduling and later executing an operation where the timelock is the target and the data is the ABI-encoded call to this function.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newDelay | uint256 | undefined | + + + +## Events + +### CallExecuted + +```solidity +event CallExecuted(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data) +``` + + + +*Emitted when a call is performed as part of operation `id`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| id `indexed` | bytes32 | undefined | +| index `indexed` | uint256 | undefined | +| target | address | undefined | +| value | uint256 | undefined | +| data | bytes | undefined | + +### CallSalt + +```solidity +event CallSalt(bytes32 indexed id, bytes32 salt) +``` + + + +*Emitted when new proposal is scheduled with non-zero salt.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| id `indexed` | bytes32 | undefined | +| salt | bytes32 | undefined | + +### CallScheduled + +```solidity +event CallScheduled(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data, bytes32 predecessor, uint256 delay) +``` + + + +*Emitted when a call is scheduled as part of operation `id`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| id `indexed` | bytes32 | undefined | +| index `indexed` | uint256 | undefined | +| target | address | undefined | +| value | uint256 | undefined | +| data | bytes | undefined | +| predecessor | bytes32 | undefined | +| delay | uint256 | undefined | + +### Cancelled + +```solidity +event Cancelled(bytes32 indexed id) +``` + + + +*Emitted when operation `id` is cancelled.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| id `indexed` | bytes32 | undefined | + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + +### MinDelayChange + +```solidity +event MinDelayChange(uint256 oldDuration, uint256 newDuration) +``` + + + +*Emitted when the minimum delay for future operations is modified.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| oldDuration | uint256 | undefined | +| newDuration | uint256 | undefined | + +### RoleAdminChanged + +```solidity +event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) +``` + + + +*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| previousAdminRole `indexed` | bytes32 | undefined | +| newAdminRole `indexed` | bytes32 | undefined | + +### RoleGranted + +```solidity +event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) +``` + + + +*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| account `indexed` | address | undefined | +| sender `indexed` | address | undefined | + +### RoleRevoked + +```solidity +event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) +``` + + + +*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`)* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| account `indexed` | address | undefined | +| sender `indexed` | address | undefined | + + + diff --git a/docs/child/validator/RewardPool.md b/docs/child/validator/RewardPool.md index 33da34aa..9e353ddc 100644 --- a/docs/child/validator/RewardPool.md +++ b/docs/child/validator/RewardPool.md @@ -157,23 +157,6 @@ function VALIDATOR_PKCHECK_PRECOMPILE_GAS() external view returns (uint256) -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### baseReward - -```solidity -function baseReward() external view returns (uint256) -``` - - - - - - #### Returns | Name | Type | Description | @@ -183,7 +166,7 @@ function baseReward() external view returns (uint256) ### distributeRewardFor ```solidity -function distributeRewardFor(uint256 epochId, Uptime[] uptime) external nonpayable +function distributeRewardFor(uint256 epochId, Uptime[] uptime, uint256 epochSize) external nonpayable ``` @@ -196,11 +179,12 @@ function distributeRewardFor(uint256 epochId, Uptime[] uptime) external nonpayab |---|---|---| | epochId | uint256 | undefined | | uptime | Uptime[] | undefined | +| epochSize | uint256 | undefined | ### initialize ```solidity -function initialize(address newRewardToken, address newRewardWallet, address newValidatorSet, uint256 newBaseReward) external nonpayable +function initialize(address newRewardToken, address newRewardWallet, address newValidatorSet, address networkParamsAddr) external nonpayable ``` @@ -214,7 +198,7 @@ function initialize(address newRewardToken, address newRewardWallet, address new | newRewardToken | address | undefined | | newRewardWallet | address | undefined | | newValidatorSet | address | undefined | -| newBaseReward | uint256 | undefined | +| networkParamsAddr | address | undefined | ### paidRewardPerEpoch diff --git a/docs/child/validator/ValidatorSet.md b/docs/child/validator/ValidatorSet.md index 1aefbc47..77ef0e50 100644 --- a/docs/child/validator/ValidatorSet.md +++ b/docs/child/validator/ValidatorSet.md @@ -6,7 +6,7 @@ - +*Inherits a modified version of `ERC20VotesUpgradeable` with a shifted storage layout.* ## Methods @@ -44,22 +44,39 @@ function BLOCKLIST_PRECOMPILE() external view returns (address) |---|---|---| | _0 | address | undefined | -### EPOCH_SIZE +### CLOCK_MODE ```solidity -function EPOCH_SIZE() external view returns (uint256) +function CLOCK_MODE() external view returns (string) ``` -amount of blocks in an epoch -*when an epoch is committed a multiple of this number of blocks must be committed* + +*Description of the clock* #### Returns | Name | Type | Description | |---|---|---| -| _0 | uint256 | undefined | +| _0 | string | undefined | + +### DOMAIN_SEPARATOR + +```solidity +function DOMAIN_SEPARATOR() external view returns (bytes32) +``` + + + +*See {IERC20Permit-DOMAIN_SEPARATOR}.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | ### NATIVE_TOKEN_CONTRACT @@ -129,10 +146,10 @@ function READ_ADDRESSLIST_GAS() external view returns (uint256) |---|---|---| | _0 | uint256 | undefined | -### SYSTEM +### SLASHING_PERCENTAGE ```solidity -function SYSTEM() external view returns (address) +function SLASHING_PERCENTAGE() external view returns (uint256) ``` @@ -144,12 +161,29 @@ function SYSTEM() external view returns (address) | Name | Type | Description | |---|---|---| -| _0 | address | undefined | +| _0 | uint256 | undefined | -### VALIDATOR_PKCHECK_PRECOMPILE +### SLASH_INCENTIVE_PERCENTAGE ```solidity -function VALIDATOR_PKCHECK_PRECOMPILE() external view returns (address) +function SLASH_INCENTIVE_PERCENTAGE() external view returns (uint256) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### SYSTEM + +```solidity +function SYSTEM() external view returns (address) ``` @@ -163,10 +197,10 @@ function VALIDATOR_PKCHECK_PRECOMPILE() external view returns (address) |---|---|---| | _0 | address | undefined | -### VALIDATOR_PKCHECK_PRECOMPILE_GAS +### VALIDATOR_PKCHECK_PRECOMPILE ```solidity -function VALIDATOR_PKCHECK_PRECOMPILE_GAS() external view returns (uint256) +function VALIDATOR_PKCHECK_PRECOMPILE() external view returns (address) ``` @@ -178,12 +212,12 @@ function VALIDATOR_PKCHECK_PRECOMPILE_GAS() external view returns (uint256) | Name | Type | Description | |---|---|---| -| _0 | uint256 | undefined | +| _0 | address | undefined | -### WITHDRAWAL_WAIT_PERIOD +### VALIDATOR_PKCHECK_PRECOMPILE_GAS ```solidity -function WITHDRAWAL_WAIT_PERIOD() external view returns (uint256) +function VALIDATOR_PKCHECK_PRECOMPILE_GAS() external view returns (uint256) ``` @@ -271,7 +305,7 @@ function balanceOf(address account) external view returns (uint256) function balanceOfAt(address account, uint256 epochNumber) external view returns (uint256) ``` - +returns a validator balance for a given epoch @@ -288,10 +322,50 @@ function balanceOfAt(address account, uint256 epochNumber) external view returns |---|---|---| | _0 | uint256 | undefined | +### checkpoints + +```solidity +function checkpoints(address account, uint32 pos) external view returns (struct ERC20VotesUpgradeable.Checkpoint) +``` + + + +*Get the `pos`-th checkpoint for `account`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | +| pos | uint32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | ERC20VotesUpgradeable.Checkpoint | undefined | + +### clock + +```solidity +function clock() external view returns (uint48) +``` + + + +*Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint48 | undefined | + ### commitEpoch ```solidity -function commitEpoch(uint256 id, Epoch epoch) external nonpayable +function commitEpoch(uint256 id, Epoch epoch, uint256 epochSize) external nonpayable ``` @@ -304,6 +378,7 @@ function commitEpoch(uint256 id, Epoch epoch) external nonpayable |---|---|---| | id | uint256 | undefined | | epoch | Epoch | undefined | +| epochSize | uint256 | undefined | ### currentEpochId @@ -330,7 +405,7 @@ function decimals() external view returns (uint8) -*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 this function is 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}.* +*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}.* #### Returns @@ -362,6 +437,88 @@ function decreaseAllowance(address spender, uint256 subtractedValue) external no |---|---|---| | _0 | bool | undefined | +### delegate + +```solidity +function delegate(address delegatee) external nonpayable +``` + + + +*Delegate votes from the sender to `delegatee`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| delegatee | address | undefined | + +### delegateBySig + +```solidity +function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external nonpayable +``` + + + +*Delegates votes from signer to `delegatee`* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| delegatee | address | undefined | +| nonce | uint256 | undefined | +| expiry | uint256 | undefined | +| v | uint8 | undefined | +| r | bytes32 | undefined | +| s | bytes32 | undefined | + +### delegates + +```solidity +function delegates(address account) external view returns (address) +``` + + + +*Get the address `account` is currently delegating to.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### eip712Domain + +```solidity +function eip712Domain() external view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) +``` + + + +*See {EIP-5267}. _Available since v4.9._* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| fields | bytes1 | undefined | +| name | string | undefined | +| version | string | undefined | +| chainId | uint256 | undefined | +| verifyingContract | address | undefined | +| salt | bytes32 | undefined | +| extensions | uint256[] | undefined | + ### epochEndBlocks ```solidity @@ -408,6 +565,73 @@ function epochs(uint256) external view returns (uint256 startBlock, uint256 endB | endBlock | uint256 | undefined | | epochRoot | bytes32 | undefined | +### getPastTotalSupply + +```solidity +function getPastTotalSupply(uint256 timepoint) external view returns (uint256) +``` + + + +*Retrieve the `totalSupply` at the end of `timepoint`. Note, this value is the sum of all balances. It is NOT the sum of all the delegated votes! Requirements: - `timepoint` must be in the past* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| timepoint | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### getPastVotes + +```solidity +function getPastVotes(address account, uint256 timepoint) external view returns (uint256) +``` + + + +*Retrieve the number of votes for `account` at the end of `timepoint`. Requirements: - `timepoint` must be in the past* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | +| timepoint | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### getVotes + +```solidity +function getVotes(address account) external view returns (uint256) +``` + + + +*Gets the current votes balance for `account`* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + ### increaseAllowance ```solidity @@ -434,7 +658,7 @@ function increaseAllowance(address spender, uint256 addedValue) external nonpaya ### initialize ```solidity -function initialize(address newStateSender, address newStateReceiver, address newRootChainManager, uint256 newEpochSize, ValidatorInit[] initalValidators) external nonpayable +function initialize(address newStateSender, address newStateReceiver, address newRootChainManager, address newNetworkParams, ValidatorInit[] initialValidators) external nonpayable ``` @@ -448,8 +672,8 @@ function initialize(address newStateSender, address newStateReceiver, address ne | newStateSender | address | undefined | | newStateReceiver | address | undefined | | newRootChainManager | address | undefined | -| newEpochSize | uint256 | undefined | -| initalValidators | ValidatorInit[] | undefined | +| newNetworkParams | address | undefined | +| initialValidators | ValidatorInit[] | undefined | ### name @@ -468,6 +692,50 @@ function name() external view returns (string) |---|---|---| | _0 | string | undefined | +### nonces + +```solidity +function nonces(address owner) external view returns (uint256) +``` + + + +*See {IERC20Permit-nonces}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| owner | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### numCheckpoints + +```solidity +function numCheckpoints(address account) external view returns (uint32) +``` + + + +*Get number of checkpoints for `account`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint32 | undefined | + ### onStateReceive ```solidity @@ -508,6 +776,66 @@ Calculates how much is yet to become withdrawable for account. |---|---|---| | _0 | uint256 | Amount not yet withdrawable (in MATIC wei) | +### permit + +```solidity +function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable +``` + + + +*See {IERC20Permit-permit}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| owner | address | undefined | +| spender | address | undefined | +| value | uint256 | undefined | +| deadline | uint256 | undefined | +| v | uint8 | undefined | +| r | bytes32 | undefined | +| s | bytes32 | undefined | + +### slash + +```solidity +function slash(address[] validators) external nonpayable +``` + +initialises slashing process + +*system call,given list of validators are slashed on L2 subsequently after their stake is slashed on L1* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| validators | address[] | list of validators to be slashed | + +### slashProcessed + +```solidity +function slashProcessed(uint256) external view returns (bool) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + ### symbol ```solidity @@ -570,7 +898,7 @@ function totalSupply() external view returns (uint256) function totalSupplyAt(uint256 epochNumber) external view returns (uint256) ``` - +returns the total supply for a given epoch @@ -704,45 +1032,73 @@ event Approval(address indexed owner, address indexed spender, uint256 value) | spender `indexed` | address | undefined | | value | uint256 | undefined | -### Initialized +### DelegateChanged ```solidity -event Initialized(uint8 version) +event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) ``` -*Triggered when the contract has been initialized or reinitialized.* +*Emitted when an account changes their delegate.* #### Parameters | Name | Type | Description | |---|---|---| -| version | uint8 | undefined | +| delegator `indexed` | address | undefined | +| fromDelegate `indexed` | address | undefined | +| toDelegate `indexed` | address | undefined | -### NewEpoch +### DelegateVotesChanged ```solidity -event NewEpoch(uint256 indexed id, uint256 indexed startBlock, uint256 indexed endBlock, bytes32 epochRoot) +event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) +``` + + + +*Emitted when a token transfer or delegate change results in changes to a delegate's number of votes.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| delegate `indexed` | address | undefined | +| previousBalance | uint256 | undefined | +| newBalance | uint256 | undefined | + +### EIP712DomainChanged + +```solidity +event EIP712DomainChanged() ``` +*MAY be emitted to signal that the domain could have changed.* + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* #### Parameters | Name | Type | Description | |---|---|---| -| id `indexed` | uint256 | undefined | -| startBlock `indexed` | uint256 | undefined | -| endBlock `indexed` | uint256 | undefined | -| epochRoot | bytes32 | undefined | +| version | uint8 | undefined | -### Slashed +### NewEpoch ```solidity -event Slashed(uint256 indexed validator, uint256 amount) +event NewEpoch(uint256 indexed id, uint256 indexed startBlock, uint256 indexed endBlock, bytes32 epochRoot) ``` @@ -753,24 +1109,27 @@ event Slashed(uint256 indexed validator, uint256 amount) | Name | Type | Description | |---|---|---| -| validator `indexed` | uint256 | undefined | -| amount | uint256 | undefined | +| id `indexed` | uint256 | undefined | +| startBlock `indexed` | uint256 | undefined | +| endBlock `indexed` | uint256 | undefined | +| epochRoot | bytes32 | undefined | -### Snapshot +### Slashed ```solidity -event Snapshot(uint256 id) +event Slashed(uint256 indexed exitId, address[] validators) ``` -*Emitted by {_snapshot} when a snapshot identified by `id` is created.* + #### Parameters | Name | Type | Description | |---|---|---| -| id | uint256 | undefined | +| exitId `indexed` | uint256 | undefined | +| validators | address[] | undefined | ### Transfer diff --git a/docs/elin/contracts-upgradeable/access/Ownable2StepUpgradeable.md b/docs/elin/contracts-upgradeable/access/Ownable2StepUpgradeable.md deleted file mode 100644 index 7593d4c1..00000000 --- a/docs/elin/contracts-upgradeable/access/Ownable2StepUpgradeable.md +++ /dev/null @@ -1,140 +0,0 @@ -# Ownable2StepUpgradeable - - - - - - - -*Contract module which provides 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} and {acceptOwnership}. This module is used through inheritance. It will make available all functions from parent (Ownable).* - -## Methods - -### acceptOwnership - -```solidity -function acceptOwnership() external nonpayable -``` - - - -*The new owner accepts the ownership transfer.* - - -### owner - -```solidity -function owner() external view returns (address) -``` - - - -*Returns the address of the current owner.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### pendingOwner - -```solidity -function pendingOwner() external view returns (address) -``` - - - -*Returns the address of the pending owner.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### renounceOwnership - -```solidity -function renounceOwnership() external nonpayable -``` - - - -*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.* - - -### transferOwnership - -```solidity -function transferOwnership(address newOwner) external nonpayable -``` - - - -*Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| newOwner | address | undefined | - - - -## Events - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - -### OwnershipTransferStarted - -```solidity -event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - -### OwnershipTransferred - -```solidity -event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/access/OwnableUpgradeable.md b/docs/elin/contracts-upgradeable/access/OwnableUpgradeable.md deleted file mode 100644 index f40a49fb..00000000 --- a/docs/elin/contracts-upgradeable/access/OwnableUpgradeable.md +++ /dev/null @@ -1,95 +0,0 @@ -# OwnableUpgradeable - - - - - - - -*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.* - -## Methods - -### owner - -```solidity -function owner() external view returns (address) -``` - - - -*Returns the address of the current owner.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### renounceOwnership - -```solidity -function renounceOwnership() external nonpayable -``` - - - -*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.* - - -### transferOwnership - -```solidity -function transferOwnership(address newOwner) external nonpayable -``` - - - -*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| newOwner | address | undefined | - - - -## Events - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - -### OwnershipTransferred - -```solidity -event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/proxy/utils/Initializable.md b/docs/elin/contracts-upgradeable/proxy/utils/Initializable.md deleted file mode 100644 index 0421ee00..00000000 --- a/docs/elin/contracts-upgradeable/proxy/utils/Initializable.md +++ /dev/null @@ -1,31 +0,0 @@ -# Initializable - - - - - - - -*This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. The initialization functions use a version number. Once a version number is used, it is consumed and cannot be reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in case an upgrade adds a module that needs to be initialized. For example: [.hljs-theme-light.nopadding] ``` contract MyToken is ERC20Upgradeable { function initialize() initializer public { __ERC20_init("MyToken", "MTK"); } } contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { function initializeV2() reinitializer(2) public { __ERC20Permit_init("MyToken"); } } ``` TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. [CAUTION] ==== Avoid leaving a contract uninitialized. An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: [.hljs-theme-light.nopadding] ```* - - -## Events - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.md b/docs/elin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.md deleted file mode 100644 index feeb3d3d..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.md +++ /dev/null @@ -1,279 +0,0 @@ -# ERC1155Upgradeable - - - - - - - -*Implementation of the basic standard multi-token. See https://eips.ethereum.org/EIPS/eip-1155 Originally based on code by Enjin: https://github.com/enjin/erc-1155 _Available since v3.1._* - -## Methods - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - - - -*See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - - - -*See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256[] | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - - - -*See {IERC1155-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeBatchTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC1155-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### uri - -```solidity -function uri(uint256) external view returns (string) -``` - - - -*See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\{id\}` substring with the actual token type ID.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - - - -## Events - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - - - -*Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - - - -*Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - - - -*Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - - - -*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}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| value | string | undefined | -| id `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC1155/IERC1155ReceiverUpgradeable.md b/docs/elin/contracts-upgradeable/token/ERC1155/IERC1155ReceiverUpgradeable.md deleted file mode 100644 index 2d4c5f71..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC1155/IERC1155ReceiverUpgradeable.md +++ /dev/null @@ -1,89 +0,0 @@ -# IERC1155ReceiverUpgradeable - - - - - - - -*_Available since v3.1._* - -## Methods - -### onERC1155BatchReceived - -```solidity -function onERC1155BatchReceived(address operator, address from, uint256[] ids, uint256[] values, bytes data) external nonpayable returns (bytes4) -``` - - - -*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. NOTE: To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector).* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | The address which initiated the batch transfer (i.e. msg.sender) | -| from | address | The address which previously owned the token | -| ids | uint256[] | An array containing ids of each token being transferred (order and length must match values array) | -| values | uint256[] | An array containing amounts of each token being transferred (order and length must match ids array) | -| data | bytes | Additional data with no specified format | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed | - -### onERC1155Received - -```solidity -function onERC1155Received(address operator, address from, uint256 id, uint256 value, bytes data) external nonpayable returns (bytes4) -``` - - - -*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. NOTE: To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector).* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | The address which initiated the transfer (i.e. msg.sender) | -| from | address | The address which previously owned the token | -| id | uint256 | The ID of the token being transferred | -| value | uint256 | The amount of tokens being transferred | -| data | bytes | Additional data with no specified format | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.md b/docs/elin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.md deleted file mode 100644 index c1a58bd9..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.md +++ /dev/null @@ -1,241 +0,0 @@ -# IERC1155Upgradeable - - - - - - - -*Required interface of an ERC1155 compliant contract, as defined in the https://eips.ethereum.org/EIPS/eip-1155[EIP]. _Available since v3.1._* - -## Methods - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - - - -*Returns the amount of tokens of token type `id` owned by `account`. Requirements: - `account` cannot be the zero address.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - - - -*xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. Requirements: - `accounts` and `ids` must have the same length.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256[] | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - - - -*Returns true if `operator` is approved to transfer ``account``'s tokens. See {setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*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 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - - - -*Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - - - -*Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - - - -*Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - - - -*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}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| value | string | undefined | -| id `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC1155/extensions/IERC1155MetadataURIUpgradeable.md b/docs/elin/contracts-upgradeable/token/ERC1155/extensions/IERC1155MetadataURIUpgradeable.md deleted file mode 100644 index 965fe1c6..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC1155/extensions/IERC1155MetadataURIUpgradeable.md +++ /dev/null @@ -1,263 +0,0 @@ -# IERC1155MetadataURIUpgradeable - - - - - - - -*Interface of the optional ERC1155MetadataExtension interface, as defined in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. _Available since v3.1._* - -## Methods - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - - - -*Returns the amount of tokens of token type `id` owned by `account`. Requirements: - `account` cannot be the zero address.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - - - -*xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. Requirements: - `accounts` and `ids` must have the same length.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256[] | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - - - -*Returns true if `operator` is approved to transfer ``account``'s tokens. See {setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*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 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### uri - -```solidity -function uri(uint256 id) external view returns (string) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - - - -## Events - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - - - -*Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - - - -*Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - - - -*Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - - - -*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}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| value | string | undefined | -| id `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.md b/docs/elin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.md deleted file mode 100644 index e7bc3ff0..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.md +++ /dev/null @@ -1,299 +0,0 @@ -# ERC20Upgradeable - - - - - - - -*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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How to implement supply mechanisms]. 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. Finally, the non-standard {decreaseAllowance} and {increaseAllowance} functions have been added to mitigate the well-known issues around setting allowances. See {IERC20-approve}.* - -## Methods - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*See {IERC20-allowance}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-approve}. NOTE: If `amount` 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*See {IERC20-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### decimals - -```solidity -function decimals() external view returns (uint8) -``` - - - -*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 this function is 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}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint8 | undefined | - -### decreaseAllowance - -```solidity -function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool) -``` - - - -*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`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| subtractedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### increaseAllowance - -```solidity -function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| addedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the name of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the symbol of the token, usually a shorter version of the name.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*See {IERC20-totalSupply}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*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 `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.md b/docs/elin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.md deleted file mode 100644 index b0420d69..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.md +++ /dev/null @@ -1,186 +0,0 @@ -# IERC20Upgradeable - - - - - - - -*Interface of the ERC20 standard as defined in the EIP.* - -## Methods - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*Returns the amount of tokens owned by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*Returns the amount of tokens in existence.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.md b/docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.md deleted file mode 100644 index 6541976a..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.md +++ /dev/null @@ -1,360 +0,0 @@ -# ERC20SnapshotUpgradeable - - - - - - - -*This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and total supply at the time are recorded for later access. This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting. In naive implementations it's possible to perform a "double spend" attack by reusing the same balance from different accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be used to create an efficient ERC20 forking mechanism. Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id and the account address. NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract. Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient alternative consider {ERC20Votes}. ==== Gas Costs Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much smaller since identical balances in subsequent snapshots are stored as a single entry. There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent transfers will have normal cost until the next snapshot, and so on.* - -## Methods - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*See {IERC20-allowance}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-approve}. NOTE: If `amount` 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*See {IERC20-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfAt - -```solidity -function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256) -``` - - - -*Retrieves the balance of `account` at the time `snapshotId` was created.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| snapshotId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### decimals - -```solidity -function decimals() external view returns (uint8) -``` - - - -*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 this function is 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}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint8 | undefined | - -### decreaseAllowance - -```solidity -function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool) -``` - - - -*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`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| subtractedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### increaseAllowance - -```solidity -function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| addedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the name of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the symbol of the token, usually a shorter version of the name.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*See {IERC20-totalSupply}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### totalSupplyAt - -```solidity -function totalSupplyAt(uint256 snapshotId) external view returns (uint256) -``` - - - -*Retrieves the total supply at the time `snapshotId` was created.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| snapshotId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*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 `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - -### Snapshot - -```solidity -event Snapshot(uint256 id) -``` - - - -*Emitted by {_snapshot} when a snapshot identified by `id` is created.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| id | uint256 | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.md b/docs/elin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.md deleted file mode 100644 index a33e288c..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.md +++ /dev/null @@ -1,237 +0,0 @@ -# IERC20MetadataUpgradeable - - - - - - - -*Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._* - -## Methods - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*Returns the amount of tokens owned by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### decimals - -```solidity -function decimals() external view returns (uint8) -``` - - - -*Returns the decimals places of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint8 | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the name of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the symbol of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*Returns the amount of tokens in existence.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.md b/docs/elin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.md deleted file mode 100644 index 0798f09a..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.md +++ /dev/null @@ -1,76 +0,0 @@ -# IERC20PermitUpgradeable - - - - - - - -*Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't need to send a transaction, and thus is not required to hold Ether at all.* - -## Methods - -### DOMAIN_SEPARATOR - -```solidity -function DOMAIN_SEPARATOR() external view returns (bytes32) -``` - - - -*Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### nonces - -```solidity -function nonces(address owner) external view returns (uint256) -``` - - - -*Returns the current nonce for `owner`. This value must be included whenever a signature is generated for {permit}. Every successful call to {permit} increases ``owner``'s nonce by one. This prevents a signature from being used multiple times.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### permit - -```solidity -function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable -``` - - - -*Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section].* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | -| value | uint256 | undefined | -| deadline | uint256 | undefined | -| v | uint8 | undefined | -| r | bytes32 | undefined | -| s | bytes32 | undefined | - - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.md b/docs/elin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.md deleted file mode 100644 index 77a1b122..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.md +++ /dev/null @@ -1,12 +0,0 @@ -# SafeERC20Upgradeable - - - -> SafeERC20 - - - -*Wrappers around ERC20 operations that throw on failure (when the token contract returns false). Tokens that return no value (and instead revert or throw on failure) are also supported, non-reverting calls are assumed to be successful. To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, which allows you to call the safe operations as `token.safeTransfer(...)`, etc.* - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.md b/docs/elin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.md deleted file mode 100644 index 138b320e..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.md +++ /dev/null @@ -1,344 +0,0 @@ -# ERC721Upgradeable - - - - - - - -*Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including the Metadata extension, but not including the Enumerable extension, which is available separately as {ERC721Enumerable}.* - -## Methods - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-approve}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256) -``` - - - -*See {IERC721-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-getApproved}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*See {IERC721-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*See {IERC721Metadata-name}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-ownerOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC721-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*See {IERC721Metadata-symbol}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### tokenURI - -```solidity -function tokenURI(uint256 tokenId) external view returns (string) -``` - - - -*See {IERC721Metadata-tokenURI}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-transferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.md b/docs/elin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.md deleted file mode 100644 index 2c993860..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.md +++ /dev/null @@ -1,40 +0,0 @@ -# IERC721ReceiverUpgradeable - - - -> ERC721 token receiver interface - - - -*Interface for any contract that wants to support safeTransfers from ERC721 asset contracts.* - -## Methods - -### onERC721Received - -```solidity -function onERC721Received(address operator, address from, uint256 tokenId, bytes data) external nonpayable returns (bytes4) -``` - - - -*Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} by `operator` from `from`, this function is called. It must return its Solidity selector to confirm the token transfer. If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| from | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | undefined | - - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.md b/docs/elin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.md deleted file mode 100644 index 6283bfe3..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.md +++ /dev/null @@ -1,272 +0,0 @@ -# IERC721Upgradeable - - - - - - - -*Required interface of an ERC721 compliant contract.* - -## Methods - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256 balance) -``` - - - -*Returns the number of tokens in ``owner``'s account.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| balance | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address operator) -``` - - - -*Returns the account approved for `tokenId` token. Requirements: - `tokenId` must exist.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*Returns if the `operator` is allowed to manage all of the assets of `owner`. See {setApprovalForAll}* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address owner) -``` - - - -*Returns the owner of the `tokenId` token. Requirements: - `tokenId` must exist.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool _approved) external nonpayable -``` - - - -*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 caller. Emits an {ApprovalForAll} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| _approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.md b/docs/elin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.md deleted file mode 100644 index 3d4830e1..00000000 --- a/docs/elin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.md +++ /dev/null @@ -1,328 +0,0 @@ -# IERC721MetadataUpgradeable - - - -> ERC-721 Non-Fungible Token Standard, optional metadata extension - - - -*See https://eips.ethereum.org/EIPS/eip-721* - -## Methods - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256 balance) -``` - - - -*Returns the number of tokens in ``owner``'s account.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| balance | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address operator) -``` - - - -*Returns the account approved for `tokenId` token. Requirements: - `tokenId` must exist.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*Returns if the `operator` is allowed to manage all of the assets of `owner`. See {setApprovalForAll}* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the token collection name.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address owner) -``` - - - -*Returns the owner of the `tokenId` token. Requirements: - `tokenId` must exist.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool _approved) external nonpayable -``` - - - -*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 caller. Emits an {ApprovalForAll} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| _approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the token collection symbol.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### tokenURI - -```solidity -function tokenURI(uint256 tokenId) external view returns (string) -``` - - - -*Returns the Uniform Resource Identifier (URI) for `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/utils/AddressUpgradeable.md b/docs/elin/contracts-upgradeable/utils/AddressUpgradeable.md deleted file mode 100644 index 456cdd15..00000000 --- a/docs/elin/contracts-upgradeable/utils/AddressUpgradeable.md +++ /dev/null @@ -1,12 +0,0 @@ -# AddressUpgradeable - - - - - - - -*Collection of functions related to the address type* - - - diff --git a/docs/elin/contracts-upgradeable/utils/ArraysUpgradeable.md b/docs/elin/contracts-upgradeable/utils/ArraysUpgradeable.md deleted file mode 100644 index 3a22b8fc..00000000 --- a/docs/elin/contracts-upgradeable/utils/ArraysUpgradeable.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArraysUpgradeable - - - - - - - -*Collection of functions related to array types.* - - - diff --git a/docs/elin/contracts-upgradeable/utils/ContextUpgradeable.md b/docs/elin/contracts-upgradeable/utils/ContextUpgradeable.md deleted file mode 100644 index 139f0105..00000000 --- a/docs/elin/contracts-upgradeable/utils/ContextUpgradeable.md +++ /dev/null @@ -1,31 +0,0 @@ -# ContextUpgradeable - - - - - - - -*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.* - - -## Events - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/utils/CountersUpgradeable.md b/docs/elin/contracts-upgradeable/utils/CountersUpgradeable.md deleted file mode 100644 index 62599cad..00000000 --- a/docs/elin/contracts-upgradeable/utils/CountersUpgradeable.md +++ /dev/null @@ -1,12 +0,0 @@ -# CountersUpgradeable - -*Matt Condon (@shrugs)* - -> Counters - - - -*Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number of elements in a mapping, issuing ERC721 ids, or counting request ids. Include with `using Counters for Counters.Counter;`* - - - diff --git a/docs/elin/contracts-upgradeable/utils/StorageSlotUpgradeable.md b/docs/elin/contracts-upgradeable/utils/StorageSlotUpgradeable.md deleted file mode 100644 index 3c517200..00000000 --- a/docs/elin/contracts-upgradeable/utils/StorageSlotUpgradeable.md +++ /dev/null @@ -1,12 +0,0 @@ -# StorageSlotUpgradeable - - - - - - - -*Library for reading and writing primitive types to specific storage slots. Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. This library helps with reading and writing to such slots without the need for inline assembly. The functions in this library return Slot structs that contain a `value` member that can be used to read or write. Example usage to set ERC1967 implementation slot: ``` contract ERC1967 { bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; function _getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } } ``` _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._* - - - diff --git a/docs/elin/contracts-upgradeable/utils/StringsUpgradeable.md b/docs/elin/contracts-upgradeable/utils/StringsUpgradeable.md deleted file mode 100644 index 84464ba8..00000000 --- a/docs/elin/contracts-upgradeable/utils/StringsUpgradeable.md +++ /dev/null @@ -1,12 +0,0 @@ -# StringsUpgradeable - - - - - - - -*String operations.* - - - diff --git a/docs/elin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.md b/docs/elin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.md deleted file mode 100644 index 0b332b9a..00000000 --- a/docs/elin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.md +++ /dev/null @@ -1,56 +0,0 @@ -# ERC165Upgradeable - - - - - - - -*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); } ``` Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.* - -## Methods - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - - - diff --git a/docs/elin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.md b/docs/elin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.md deleted file mode 100644 index 40ec0512..00000000 --- a/docs/elin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.md +++ /dev/null @@ -1,37 +0,0 @@ -# IERC165Upgradeable - - - - - - - -*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}.* - -## Methods - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - - diff --git a/docs/elin/contracts-upgradeable/utils/math/MathUpgradeable.md b/docs/elin/contracts-upgradeable/utils/math/MathUpgradeable.md deleted file mode 100644 index 9c18c68b..00000000 --- a/docs/elin/contracts-upgradeable/utils/math/MathUpgradeable.md +++ /dev/null @@ -1,12 +0,0 @@ -# MathUpgradeable - - - - - - - -*Standard math utilities missing in the Solidity language.* - - - diff --git a/docs/elin/contracts/access/AccessControl.md b/docs/elin/contracts/access/AccessControl.md deleted file mode 100644 index 2b15d198..00000000 --- a/docs/elin/contracts/access/AccessControl.md +++ /dev/null @@ -1,207 +0,0 @@ -# AccessControl - - - - - - - -*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: ``` bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); ``` Roles can be used to represent a set of permissions. To restrict access to a function call, use {hasRole}: ``` function foo() public { require(hasRole(MY_ROLE, msg.sender)); ... } ``` Roles can be granted and revoked dynamically via the {grantRole} and {revokeRole} functions. Each role has an associated admin role, and only accounts that have a role's admin role can call {grantRole} and {revokeRole}. By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means that only accounts with this role will be able to grant or revoke other roles. More complex role relationships can be created by using {_setRoleAdmin}. WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to grant and revoke this role. Extra precautions should be taken to secure accounts that have been granted it.* - -## Methods - -### DEFAULT_ADMIN_ROLE - -```solidity -function DEFAULT_ADMIN_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getRoleAdmin - -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32) -``` - - - -*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### grantRole - -```solidity -function grantRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### hasRole - -```solidity -function hasRole(bytes32 role, address account) external view returns (bool) -``` - - - -*Returns `true` if `account` has been granted `role`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### renounceRole - -```solidity -function renounceRole(bytes32 role, address account) external nonpayable -``` - - - -*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 `account`. May emit a {RoleRevoked} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### revokeRole - -```solidity -function revokeRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### RoleAdminChanged - -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -``` - - - -*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| previousAdminRole `indexed` | bytes32 | undefined | -| newAdminRole `indexed` | bytes32 | undefined | - -### RoleGranted - -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### RoleRevoked - -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*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`)* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - - - diff --git a/docs/elin/contracts/access/AccessControlEnumerable.md b/docs/elin/contracts/access/AccessControlEnumerable.md deleted file mode 100644 index 4da1f793..00000000 --- a/docs/elin/contracts/access/AccessControlEnumerable.md +++ /dev/null @@ -1,252 +0,0 @@ -# AccessControlEnumerable - - - - - - - -*Extension of {AccessControl} that allows enumerating the members of each role.* - -## Methods - -### DEFAULT_ADMIN_ROLE - -```solidity -function DEFAULT_ADMIN_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getRoleAdmin - -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32) -``` - - - -*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getRoleMember - -```solidity -function getRoleMember(bytes32 role, uint256 index) external view returns (address) -``` - - - -*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### getRoleMemberCount - -```solidity -function getRoleMemberCount(bytes32 role) external view returns (uint256) -``` - - - -*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### grantRole - -```solidity -function grantRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### hasRole - -```solidity -function hasRole(bytes32 role, address account) external view returns (bool) -``` - - - -*Returns `true` if `account` has been granted `role`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### renounceRole - -```solidity -function renounceRole(bytes32 role, address account) external nonpayable -``` - - - -*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 `account`. May emit a {RoleRevoked} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### revokeRole - -```solidity -function revokeRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### RoleAdminChanged - -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -``` - - - -*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| previousAdminRole `indexed` | bytes32 | undefined | -| newAdminRole `indexed` | bytes32 | undefined | - -### RoleGranted - -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### RoleRevoked - -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*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`)* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - - - diff --git a/docs/elin/contracts/access/IAccessControl.md b/docs/elin/contracts/access/IAccessControl.md deleted file mode 100644 index 1916d28b..00000000 --- a/docs/elin/contracts/access/IAccessControl.md +++ /dev/null @@ -1,168 +0,0 @@ -# IAccessControl - - - - - - - -*External interface of AccessControl declared to support ERC165 detection.* - -## Methods - -### getRoleAdmin - -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32) -``` - - - -*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {AccessControl-_setRoleAdmin}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### grantRole - -```solidity -function grantRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### hasRole - -```solidity -function hasRole(bytes32 role, address account) external view returns (bool) -``` - - - -*Returns `true` if `account` has been granted `role`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### renounceRole - -```solidity -function renounceRole(bytes32 role, address account) external nonpayable -``` - - - -*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### revokeRole - -```solidity -function revokeRole(bytes32 role, address account) external nonpayable -``` - - - -*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - - - -## Events - -### RoleAdminChanged - -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -``` - - - -*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| previousAdminRole `indexed` | bytes32 | undefined | -| newAdminRole `indexed` | bytes32 | undefined | - -### RoleGranted - -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### RoleRevoked - -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*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`)* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - - - diff --git a/docs/elin/contracts/access/IAccessControlEnumerable.md b/docs/elin/contracts/access/IAccessControlEnumerable.md deleted file mode 100644 index b3ee7e77..00000000 --- a/docs/elin/contracts/access/IAccessControlEnumerable.md +++ /dev/null @@ -1,213 +0,0 @@ -# IAccessControlEnumerable - - - - - - - -*External interface of AccessControlEnumerable declared to support ERC165 detection.* - -## Methods - -### getRoleAdmin - -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32) -``` - - - -*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {AccessControl-_setRoleAdmin}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getRoleMember - -```solidity -function getRoleMember(bytes32 role, uint256 index) external view returns (address) -``` - - - -*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### getRoleMemberCount - -```solidity -function getRoleMemberCount(bytes32 role) external view returns (uint256) -``` - - - -*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### grantRole - -```solidity -function grantRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### hasRole - -```solidity -function hasRole(bytes32 role, address account) external view returns (bool) -``` - - - -*Returns `true` if `account` has been granted `role`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### renounceRole - -```solidity -function renounceRole(bytes32 role, address account) external nonpayable -``` - - - -*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### revokeRole - -```solidity -function revokeRole(bytes32 role, address account) external nonpayable -``` - - - -*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - - - -## Events - -### RoleAdminChanged - -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -``` - - - -*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| previousAdminRole `indexed` | bytes32 | undefined | -| newAdminRole `indexed` | bytes32 | undefined | - -### RoleGranted - -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### RoleRevoked - -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*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`)* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - - - diff --git a/docs/elin/contracts/access/Ownable.md b/docs/elin/contracts/access/Ownable.md deleted file mode 100644 index ac397342..00000000 --- a/docs/elin/contracts/access/Ownable.md +++ /dev/null @@ -1,79 +0,0 @@ -# Ownable - - - - - - - -*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.* - -## Methods - -### owner - -```solidity -function owner() external view returns (address) -``` - - - -*Returns the address of the current owner.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### renounceOwnership - -```solidity -function renounceOwnership() external nonpayable -``` - - - -*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.* - - -### transferOwnership - -```solidity -function transferOwnership(address newOwner) external nonpayable -``` - - - -*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| newOwner | address | undefined | - - - -## Events - -### OwnershipTransferred - -```solidity -event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - - - diff --git a/docs/elin/contracts/access/Ownable2Step.md b/docs/elin/contracts/access/Ownable2Step.md deleted file mode 100644 index 9ea49e81..00000000 --- a/docs/elin/contracts/access/Ownable2Step.md +++ /dev/null @@ -1,124 +0,0 @@ -# Ownable2Step - - - - - - - -*Contract module which provides 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} and {acceptOwnership}. This module is used through inheritance. It will make available all functions from parent (Ownable).* - -## Methods - -### acceptOwnership - -```solidity -function acceptOwnership() external nonpayable -``` - - - -*The new owner accepts the ownership transfer.* - - -### owner - -```solidity -function owner() external view returns (address) -``` - - - -*Returns the address of the current owner.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### pendingOwner - -```solidity -function pendingOwner() external view returns (address) -``` - - - -*Returns the address of the pending owner.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### renounceOwnership - -```solidity -function renounceOwnership() external nonpayable -``` - - - -*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.* - - -### transferOwnership - -```solidity -function transferOwnership(address newOwner) external nonpayable -``` - - - -*Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| newOwner | address | undefined | - - - -## Events - -### OwnershipTransferStarted - -```solidity -event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - -### OwnershipTransferred - -```solidity -event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - - - diff --git a/docs/elin/contracts/proxy/Clones.md b/docs/elin/contracts/proxy/Clones.md deleted file mode 100644 index 05da81c8..00000000 --- a/docs/elin/contracts/proxy/Clones.md +++ /dev/null @@ -1,12 +0,0 @@ -# Clones - - - - - - - -*https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for deploying minimal proxy contracts, also known as "clones". > To simply and cheaply clone contract functionality in an immutable way, this standard specifies > a minimal bytecode implementation that delegates all calls to a known, fixed address. The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the deterministic method. _Available since v3.4._* - - - diff --git a/docs/elin/contracts/proxy/utils/Initializable.md b/docs/elin/contracts/proxy/utils/Initializable.md deleted file mode 100644 index 0421ee00..00000000 --- a/docs/elin/contracts/proxy/utils/Initializable.md +++ /dev/null @@ -1,31 +0,0 @@ -# Initializable - - - - - - - -*This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. The initialization functions use a version number. Once a version number is used, it is consumed and cannot be reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in case an upgrade adds a module that needs to be initialized. For example: [.hljs-theme-light.nopadding] ``` contract MyToken is ERC20Upgradeable { function initialize() initializer public { __ERC20_init("MyToken", "MTK"); } } contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { function initializeV2() reinitializer(2) public { __ERC20Permit_init("MyToken"); } } ``` TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. [CAUTION] ==== Avoid leaving a contract uninitialized. An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: [.hljs-theme-light.nopadding] ```* - - -## Events - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - - - diff --git a/docs/elin/contracts/security/Pausable.md b/docs/elin/contracts/security/Pausable.md deleted file mode 100644 index 6ca7c5a1..00000000 --- a/docs/elin/contracts/security/Pausable.md +++ /dev/null @@ -1,67 +0,0 @@ -# Pausable - - - - - - - -*Contract module which allows children to implement an emergency stop mechanism that can be triggered by an authorized account. This module is used through inheritance. It will make available the modifiers `whenNotPaused` and `whenPaused`, which can be applied to the functions of your contract. Note that they will not be pausable by simply including this module, only once the modifiers are put in place.* - -## Methods - -### paused - -```solidity -function paused() external view returns (bool) -``` - - - -*Returns true if the contract is paused, and false otherwise.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Paused - -```solidity -event Paused(address account) -``` - - - -*Emitted when the pause is triggered by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - - - -*Emitted when the pause is lifted by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - - - diff --git a/docs/elin/contracts/token/ERC1155/ERC1155.md b/docs/elin/contracts/token/ERC1155/ERC1155.md deleted file mode 100644 index aeda1a02..00000000 --- a/docs/elin/contracts/token/ERC1155/ERC1155.md +++ /dev/null @@ -1,263 +0,0 @@ -# ERC1155 - - - - - - - -*Implementation of the basic standard multi-token. See https://eips.ethereum.org/EIPS/eip-1155 Originally based on code by Enjin: https://github.com/enjin/erc-1155 _Available since v3.1._* - -## Methods - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - - - -*See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - - - -*See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256[] | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - - - -*See {IERC1155-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeBatchTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC1155-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### uri - -```solidity -function uri(uint256) external view returns (string) -``` - - - -*See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\{id\}` substring with the actual token type ID.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - - - -## Events - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - - - -*Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - - - -*Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - - - -*Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - - - -*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}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| value | string | undefined | -| id `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC1155/IERC1155.md b/docs/elin/contracts/token/ERC1155/IERC1155.md deleted file mode 100644 index 9c506b08..00000000 --- a/docs/elin/contracts/token/ERC1155/IERC1155.md +++ /dev/null @@ -1,241 +0,0 @@ -# IERC1155 - - - - - - - -*Required interface of an ERC1155 compliant contract, as defined in the https://eips.ethereum.org/EIPS/eip-1155[EIP]. _Available since v3.1._* - -## Methods - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - - - -*Returns the amount of tokens of token type `id` owned by `account`. Requirements: - `account` cannot be the zero address.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - - - -*xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. Requirements: - `accounts` and `ids` must have the same length.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256[] | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - - - -*Returns true if `operator` is approved to transfer ``account``'s tokens. See {setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*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 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - - - -*Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - - - -*Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - - - -*Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - - - -*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}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| value | string | undefined | -| id `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC1155/IERC1155Receiver.md b/docs/elin/contracts/token/ERC1155/IERC1155Receiver.md deleted file mode 100644 index 7730100a..00000000 --- a/docs/elin/contracts/token/ERC1155/IERC1155Receiver.md +++ /dev/null @@ -1,89 +0,0 @@ -# IERC1155Receiver - - - - - - - -*_Available since v3.1._* - -## Methods - -### onERC1155BatchReceived - -```solidity -function onERC1155BatchReceived(address operator, address from, uint256[] ids, uint256[] values, bytes data) external nonpayable returns (bytes4) -``` - - - -*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. NOTE: To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector).* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | The address which initiated the batch transfer (i.e. msg.sender) | -| from | address | The address which previously owned the token | -| ids | uint256[] | An array containing ids of each token being transferred (order and length must match values array) | -| values | uint256[] | An array containing amounts of each token being transferred (order and length must match ids array) | -| data | bytes | Additional data with no specified format | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed | - -### onERC1155Received - -```solidity -function onERC1155Received(address operator, address from, uint256 id, uint256 value, bytes data) external nonpayable returns (bytes4) -``` - - - -*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. NOTE: To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector).* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | The address which initiated the transfer (i.e. msg.sender) | -| from | address | The address which previously owned the token | -| id | uint256 | The ID of the token being transferred | -| value | uint256 | The amount of tokens being transferred | -| data | bytes | Additional data with no specified format | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - - diff --git a/docs/elin/contracts/token/ERC1155/extensions/ERC1155Burnable.md b/docs/elin/contracts/token/ERC1155/extensions/ERC1155Burnable.md deleted file mode 100644 index 78b49de1..00000000 --- a/docs/elin/contracts/token/ERC1155/extensions/ERC1155Burnable.md +++ /dev/null @@ -1,299 +0,0 @@ -# ERC1155Burnable - - - - - - - -*Extension of {ERC1155} that allows token holders to destroy both their own tokens and those that they have been approved to use. _Available since v3.1._* - -## Methods - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - - - -*See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - - - -*See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256[] | undefined | - -### burn - -```solidity -function burn(address account, uint256 id, uint256 value) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### burnBatch - -```solidity -function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - - - -*See {IERC1155-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeBatchTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC1155-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### uri - -```solidity -function uri(uint256) external view returns (string) -``` - - - -*See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\{id\}` substring with the actual token type ID.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - - - -## Events - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - - - -*Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - - - -*Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - - - -*Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - - - -*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}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| value | string | undefined | -| id `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC1155/extensions/ERC1155Pausable.md b/docs/elin/contracts/token/ERC1155/extensions/ERC1155Pausable.md deleted file mode 100644 index 099dea54..00000000 --- a/docs/elin/contracts/token/ERC1155/extensions/ERC1155Pausable.md +++ /dev/null @@ -1,312 +0,0 @@ -# ERC1155Pausable - - - - - - - -*ERC1155 token with pausable token transfers, minting and burning. Useful for scenarios such as preventing trades until the end of an evaluation period, or having an emergency switch for freezing all token transfers in the event of a large bug. IMPORTANT: This contract does not include public pause and unpause functions. In addition to inheriting this contract, you must define both functions, invoking the {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate access control, e.g. using {AccessControl} or {Ownable}. Not doing so will make the contract unpausable. _Available since v3.1._* - -## Methods - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - - - -*See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - - - -*See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256[] | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - - - -*See {IERC1155-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### paused - -```solidity -function paused() external view returns (bool) -``` - - - -*Returns true if the contract is paused, and false otherwise.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeBatchTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC1155-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### uri - -```solidity -function uri(uint256) external view returns (string) -``` - - - -*See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\{id\}` substring with the actual token type ID.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - - - -## Events - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - - - -*Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - - - -*Emitted when the pause is triggered by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - - - -*Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - - - -*Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - - - -*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}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| value | string | undefined | -| id `indexed` | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - - - -*Emitted when the pause is lifted by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - - - diff --git a/docs/elin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.md b/docs/elin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.md deleted file mode 100644 index f1c164dc..00000000 --- a/docs/elin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.md +++ /dev/null @@ -1,263 +0,0 @@ -# IERC1155MetadataURI - - - - - - - -*Interface of the optional ERC1155MetadataExtension interface, as defined in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. _Available since v3.1._* - -## Methods - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - - - -*Returns the amount of tokens of token type `id` owned by `account`. Requirements: - `account` cannot be the zero address.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - - - -*xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. Requirements: - `accounts` and `ids` must have the same length.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256[] | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - - - -*Returns true if `operator` is approved to transfer ``account``'s tokens. See {setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*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 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### uri - -```solidity -function uri(uint256 id) external view returns (string) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - - - -## Events - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - - - -*Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - - - -*Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - - - -*Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - - - -*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}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| value | string | undefined | -| id `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.md b/docs/elin/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.md deleted file mode 100644 index a01a4855..00000000 --- a/docs/elin/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.md +++ /dev/null @@ -1,654 +0,0 @@ -# ERC1155PresetMinterPauser - - - - - - - -*{ERC1155} token, including: - ability for holders to burn (destroy) their tokens - a minter role that allows for token minting (creation) - a pauser role that allows to stop all token transfers This contract uses {AccessControl} to lock permissioned functions using the different roles - head to its documentation for details. The account that deploys the contract will be granted the minter and pauser roles, as well as the default admin role, which will let it grant both minter and pauser roles to other accounts. _Deprecated in favor of https://wizard.openzeppelin.com/[Contracts Wizard]._* - -## Methods - -### DEFAULT_ADMIN_ROLE - -```solidity -function DEFAULT_ADMIN_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### MINTER_ROLE - -```solidity -function MINTER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### PAUSER_ROLE - -```solidity -function PAUSER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - - - -*See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - - - -*See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256[] | undefined | - -### burn - -```solidity -function burn(address account, uint256 id, uint256 value) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### burnBatch - -```solidity -function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### getRoleAdmin - -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32) -``` - - - -*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getRoleMember - -```solidity -function getRoleMember(bytes32 role, uint256 index) external view returns (address) -``` - - - -*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### getRoleMemberCount - -```solidity -function getRoleMemberCount(bytes32 role) external view returns (uint256) -``` - - - -*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### grantRole - -```solidity -function grantRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### hasRole - -```solidity -function hasRole(bytes32 role, address account) external view returns (bool) -``` - - - -*Returns `true` if `account` has been granted `role`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - - - -*See {IERC1155-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### mint - -```solidity -function mint(address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*Creates `amount` new tokens for `to`, of token type `id`. See {ERC1155-_mint}. Requirements: - the caller must have the `MINTER_ROLE`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### mintBatch - -```solidity -function mintBatch(address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*xref:ROOT:erc1155.adoc#batch-operations[Batched] variant of {mint}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### pause - -```solidity -function pause() external nonpayable -``` - - - -*Pauses all token transfers. See {ERC1155Pausable} and {Pausable-_pause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - -### paused - -```solidity -function paused() external view returns (bool) -``` - - - -*Returns true if the contract is paused, and false otherwise.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### renounceRole - -```solidity -function renounceRole(bytes32 role, address account) external nonpayable -``` - - - -*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 `account`. May emit a {RoleRevoked} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### revokeRole - -```solidity -function revokeRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeBatchTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC1155-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### unpause - -```solidity -function unpause() external nonpayable -``` - - - -*Unpauses all token transfers. See {ERC1155Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - -### uri - -```solidity -function uri(uint256) external view returns (string) -``` - - - -*See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\{id\}` substring with the actual token type ID.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - - - -## Events - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - - - -*Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - - - -*Emitted when the pause is triggered by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -### RoleAdminChanged - -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -``` - - - -*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| previousAdminRole `indexed` | bytes32 | undefined | -| newAdminRole `indexed` | bytes32 | undefined | - -### RoleGranted - -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### RoleRevoked - -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*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`)* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - - - -*Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - - - -*Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - - - -*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}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| value | string | undefined | -| id `indexed` | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - - - -*Emitted when the pause is lifted by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - - - diff --git a/docs/elin/contracts/token/ERC1155/utils/ERC1155Holder.md b/docs/elin/contracts/token/ERC1155/utils/ERC1155Holder.md deleted file mode 100644 index c5f0d106..00000000 --- a/docs/elin/contracts/token/ERC1155/utils/ERC1155Holder.md +++ /dev/null @@ -1,89 +0,0 @@ -# ERC1155Holder - - - - - -Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be stuck. - -*_Available since v3.1._* - -## Methods - -### onERC1155BatchReceived - -```solidity -function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external nonpayable returns (bytes4) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | -| _1 | address | undefined | -| _2 | uint256[] | undefined | -| _3 | uint256[] | undefined | -| _4 | bytes | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | undefined | - -### onERC1155Received - -```solidity -function onERC1155Received(address, address, uint256, uint256, bytes) external nonpayable returns (bytes4) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | -| _1 | address | undefined | -| _2 | uint256 | undefined | -| _3 | uint256 | undefined | -| _4 | bytes | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - - diff --git a/docs/elin/contracts/token/ERC1155/utils/ERC1155Receiver.md b/docs/elin/contracts/token/ERC1155/utils/ERC1155Receiver.md deleted file mode 100644 index 61a89d5c..00000000 --- a/docs/elin/contracts/token/ERC1155/utils/ERC1155Receiver.md +++ /dev/null @@ -1,89 +0,0 @@ -# ERC1155Receiver - - - - - - - -*_Available since v3.1._* - -## Methods - -### onERC1155BatchReceived - -```solidity -function onERC1155BatchReceived(address operator, address from, uint256[] ids, uint256[] values, bytes data) external nonpayable returns (bytes4) -``` - - - -*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. NOTE: To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector).* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | The address which initiated the batch transfer (i.e. msg.sender) | -| from | address | The address which previously owned the token | -| ids | uint256[] | An array containing ids of each token being transferred (order and length must match values array) | -| values | uint256[] | An array containing amounts of each token being transferred (order and length must match ids array) | -| data | bytes | Additional data with no specified format | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed | - -### onERC1155Received - -```solidity -function onERC1155Received(address operator, address from, uint256 id, uint256 value, bytes data) external nonpayable returns (bytes4) -``` - - - -*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. NOTE: To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector).* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | The address which initiated the transfer (i.e. msg.sender) | -| from | address | The address which previously owned the token | -| id | uint256 | The ID of the token being transferred | -| value | uint256 | The amount of tokens being transferred | -| data | bytes | Additional data with no specified format | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - - diff --git a/docs/elin/contracts/token/ERC20/ERC20.md b/docs/elin/contracts/token/ERC20/ERC20.md deleted file mode 100644 index 35250e1b..00000000 --- a/docs/elin/contracts/token/ERC20/ERC20.md +++ /dev/null @@ -1,283 +0,0 @@ -# ERC20 - - - - - - - -*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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How to implement supply mechanisms]. 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. Finally, the non-standard {decreaseAllowance} and {increaseAllowance} functions have been added to mitigate the well-known issues around setting allowances. See {IERC20-approve}.* - -## Methods - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*See {IERC20-allowance}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-approve}. NOTE: If `amount` 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*See {IERC20-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### decimals - -```solidity -function decimals() external view returns (uint8) -``` - - - -*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 this function is 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}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint8 | undefined | - -### decreaseAllowance - -```solidity -function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool) -``` - - - -*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`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| subtractedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### increaseAllowance - -```solidity -function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| addedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the name of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the symbol of the token, usually a shorter version of the name.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*See {IERC20-totalSupply}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*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 `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC20/IERC20.md b/docs/elin/contracts/token/ERC20/IERC20.md deleted file mode 100644 index 84d114ba..00000000 --- a/docs/elin/contracts/token/ERC20/IERC20.md +++ /dev/null @@ -1,186 +0,0 @@ -# IERC20 - - - - - - - -*Interface of the ERC20 standard as defined in the EIP.* - -## Methods - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*Returns the amount of tokens owned by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*Returns the amount of tokens in existence.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC20/extensions/ERC20Burnable.md b/docs/elin/contracts/token/ERC20/extensions/ERC20Burnable.md deleted file mode 100644 index 0dfd97fe..00000000 --- a/docs/elin/contracts/token/ERC20/extensions/ERC20Burnable.md +++ /dev/null @@ -1,316 +0,0 @@ -# ERC20Burnable - - - - - - - -*Extension of {ERC20} that allows token holders to destroy both their own tokens and those that they have an allowance for, in a way that can be recognized off-chain (via event analysis).* - -## Methods - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*See {IERC20-allowance}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-approve}. NOTE: If `amount` 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*See {IERC20-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### burn - -```solidity -function burn(uint256 amount) external nonpayable -``` - - - -*Destroys `amount` tokens from the caller. See {ERC20-_burn}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| amount | uint256 | undefined | - -### burnFrom - -```solidity -function burnFrom(address account, uint256 amount) external nonpayable -``` - - - -*Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| amount | uint256 | undefined | - -### decimals - -```solidity -function decimals() external view returns (uint8) -``` - - - -*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 this function is 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}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint8 | undefined | - -### decreaseAllowance - -```solidity -function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool) -``` - - - -*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`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| subtractedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### increaseAllowance - -```solidity -function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| addedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the name of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the symbol of the token, usually a shorter version of the name.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*See {IERC20-totalSupply}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*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 `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC20/extensions/ERC20Pausable.md b/docs/elin/contracts/token/ERC20/extensions/ERC20Pausable.md deleted file mode 100644 index 083f2106..00000000 --- a/docs/elin/contracts/token/ERC20/extensions/ERC20Pausable.md +++ /dev/null @@ -1,332 +0,0 @@ -# ERC20Pausable - - - - - - - -*ERC20 token with pausable token transfers, minting and burning. Useful for scenarios such as preventing trades until the end of an evaluation period, or having an emergency switch for freezing all token transfers in the event of a large bug. IMPORTANT: This contract does not include public pause and unpause functions. In addition to inheriting this contract, you must define both functions, invoking the {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate access control, e.g. using {AccessControl} or {Ownable}. Not doing so will make the contract unpausable.* - -## Methods - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*See {IERC20-allowance}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-approve}. NOTE: If `amount` 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*See {IERC20-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### decimals - -```solidity -function decimals() external view returns (uint8) -``` - - - -*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 this function is 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}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint8 | undefined | - -### decreaseAllowance - -```solidity -function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool) -``` - - - -*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`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| subtractedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### increaseAllowance - -```solidity -function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| addedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the name of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### paused - -```solidity -function paused() external view returns (bool) -``` - - - -*Returns true if the contract is paused, and false otherwise.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the symbol of the token, usually a shorter version of the name.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*See {IERC20-totalSupply}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*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 `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - - - -*Emitted when the pause is triggered by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - - - -*Emitted when the pause is lifted by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - - - diff --git a/docs/elin/contracts/token/ERC20/extensions/IERC20Metadata.md b/docs/elin/contracts/token/ERC20/extensions/IERC20Metadata.md deleted file mode 100644 index 6fb73e3f..00000000 --- a/docs/elin/contracts/token/ERC20/extensions/IERC20Metadata.md +++ /dev/null @@ -1,237 +0,0 @@ -# IERC20Metadata - - - - - - - -*Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._* - -## Methods - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*Returns the amount of tokens owned by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### decimals - -```solidity -function decimals() external view returns (uint8) -``` - - - -*Returns the decimals places of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint8 | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the name of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the symbol of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*Returns the amount of tokens in existence.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC20/extensions/IERC20Permit.md b/docs/elin/contracts/token/ERC20/extensions/IERC20Permit.md deleted file mode 100644 index 5a8ae501..00000000 --- a/docs/elin/contracts/token/ERC20/extensions/IERC20Permit.md +++ /dev/null @@ -1,76 +0,0 @@ -# IERC20Permit - - - - - - - -*Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't need to send a transaction, and thus is not required to hold Ether at all.* - -## Methods - -### DOMAIN_SEPARATOR - -```solidity -function DOMAIN_SEPARATOR() external view returns (bytes32) -``` - - - -*Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### nonces - -```solidity -function nonces(address owner) external view returns (uint256) -``` - - - -*Returns the current nonce for `owner`. This value must be included whenever a signature is generated for {permit}. Every successful call to {permit} increases ``owner``'s nonce by one. This prevents a signature from being used multiple times.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### permit - -```solidity -function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable -``` - - - -*Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section].* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | -| value | uint256 | undefined | -| deadline | uint256 | undefined | -| v | uint8 | undefined | -| r | bytes32 | undefined | -| s | bytes32 | undefined | - - - - diff --git a/docs/elin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.md b/docs/elin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.md deleted file mode 100644 index 7b0b4275..00000000 --- a/docs/elin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.md +++ /dev/null @@ -1,672 +0,0 @@ -# ERC20PresetMinterPauser - - - - - - - -*{ERC20} token, including: - ability for holders to burn (destroy) their tokens - a minter role that allows for token minting (creation) - a pauser role that allows to stop all token transfers This contract uses {AccessControl} to lock permissioned functions using the different roles - head to its documentation for details. The account that deploys the contract will be granted the minter and pauser roles, as well as the default admin role, which will let it grant both minter and pauser roles to other accounts. _Deprecated in favor of https://wizard.openzeppelin.com/[Contracts Wizard]._* - -## Methods - -### DEFAULT_ADMIN_ROLE - -```solidity -function DEFAULT_ADMIN_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### MINTER_ROLE - -```solidity -function MINTER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### PAUSER_ROLE - -```solidity -function PAUSER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*See {IERC20-allowance}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-approve}. NOTE: If `amount` 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*See {IERC20-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### burn - -```solidity -function burn(uint256 amount) external nonpayable -``` - - - -*Destroys `amount` tokens from the caller. See {ERC20-_burn}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| amount | uint256 | undefined | - -### burnFrom - -```solidity -function burnFrom(address account, uint256 amount) external nonpayable -``` - - - -*Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| amount | uint256 | undefined | - -### decimals - -```solidity -function decimals() external view returns (uint8) -``` - - - -*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 this function is 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}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint8 | undefined | - -### decreaseAllowance - -```solidity -function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool) -``` - - - -*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`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| subtractedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### getRoleAdmin - -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32) -``` - - - -*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getRoleMember - -```solidity -function getRoleMember(bytes32 role, uint256 index) external view returns (address) -``` - - - -*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### getRoleMemberCount - -```solidity -function getRoleMemberCount(bytes32 role) external view returns (uint256) -``` - - - -*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### grantRole - -```solidity -function grantRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### hasRole - -```solidity -function hasRole(bytes32 role, address account) external view returns (bool) -``` - - - -*Returns `true` if `account` has been granted `role`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### increaseAllowance - -```solidity -function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| addedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### mint - -```solidity -function mint(address to, uint256 amount) external nonpayable -``` - - - -*Creates `amount` new tokens for `to`. See {ERC20-_mint}. Requirements: - the caller must have the `MINTER_ROLE`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the name of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### pause - -```solidity -function pause() external nonpayable -``` - - - -*Pauses all token transfers. See {ERC20Pausable} and {Pausable-_pause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - -### paused - -```solidity -function paused() external view returns (bool) -``` - - - -*Returns true if the contract is paused, and false otherwise.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### renounceRole - -```solidity -function renounceRole(bytes32 role, address account) external nonpayable -``` - - - -*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 `account`. May emit a {RoleRevoked} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### revokeRole - -```solidity -function revokeRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the symbol of the token, usually a shorter version of the name.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*See {IERC20-totalSupply}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*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 `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### unpause - -```solidity -function unpause() external nonpayable -``` - - - -*Unpauses all token transfers. See {ERC20Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - - - -*Emitted when the pause is triggered by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -### RoleAdminChanged - -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -``` - - - -*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| previousAdminRole `indexed` | bytes32 | undefined | -| newAdminRole `indexed` | bytes32 | undefined | - -### RoleGranted - -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### RoleRevoked - -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*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`)* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - - - -*Emitted when the pause is lifted by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - - - diff --git a/docs/elin/contracts/token/ERC20/utils/SafeERC20.md b/docs/elin/contracts/token/ERC20/utils/SafeERC20.md deleted file mode 100644 index 80367d00..00000000 --- a/docs/elin/contracts/token/ERC20/utils/SafeERC20.md +++ /dev/null @@ -1,12 +0,0 @@ -# SafeERC20 - - - -> SafeERC20 - - - -*Wrappers around ERC20 operations that throw on failure (when the token contract returns false). Tokens that return no value (and instead revert or throw on failure) are also supported, non-reverting calls are assumed to be successful. To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, which allows you to call the safe operations as `token.safeTransfer(...)`, etc.* - - - diff --git a/docs/elin/contracts/token/ERC721/ERC721.md b/docs/elin/contracts/token/ERC721/ERC721.md deleted file mode 100644 index 7834050a..00000000 --- a/docs/elin/contracts/token/ERC721/ERC721.md +++ /dev/null @@ -1,328 +0,0 @@ -# ERC721 - - - - - - - -*Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including the Metadata extension, but not including the Enumerable extension, which is available separately as {ERC721Enumerable}.* - -## Methods - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-approve}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256) -``` - - - -*See {IERC721-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-getApproved}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*See {IERC721-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*See {IERC721Metadata-name}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-ownerOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC721-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*See {IERC721Metadata-symbol}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### tokenURI - -```solidity -function tokenURI(uint256 tokenId) external view returns (string) -``` - - - -*See {IERC721Metadata-tokenURI}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-transferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC721/IERC721.md b/docs/elin/contracts/token/ERC721/IERC721.md deleted file mode 100644 index f9ba6fe1..00000000 --- a/docs/elin/contracts/token/ERC721/IERC721.md +++ /dev/null @@ -1,272 +0,0 @@ -# IERC721 - - - - - - - -*Required interface of an ERC721 compliant contract.* - -## Methods - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256 balance) -``` - - - -*Returns the number of tokens in ``owner``'s account.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| balance | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address operator) -``` - - - -*Returns the account approved for `tokenId` token. Requirements: - `tokenId` must exist.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*Returns if the `operator` is allowed to manage all of the assets of `owner`. See {setApprovalForAll}* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address owner) -``` - - - -*Returns the owner of the `tokenId` token. Requirements: - `tokenId` must exist.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool _approved) external nonpayable -``` - - - -*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 caller. Emits an {ApprovalForAll} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| _approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC721/IERC721Receiver.md b/docs/elin/contracts/token/ERC721/IERC721Receiver.md deleted file mode 100644 index 81b976a9..00000000 --- a/docs/elin/contracts/token/ERC721/IERC721Receiver.md +++ /dev/null @@ -1,40 +0,0 @@ -# IERC721Receiver - - - -> ERC721 token receiver interface - - - -*Interface for any contract that wants to support safeTransfers from ERC721 asset contracts.* - -## Methods - -### onERC721Received - -```solidity -function onERC721Received(address operator, address from, uint256 tokenId, bytes data) external nonpayable returns (bytes4) -``` - - - -*Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} by `operator` from `from`, this function is called. It must return its Solidity selector to confirm the token transfer. If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| from | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | undefined | - - - - diff --git a/docs/elin/contracts/token/ERC721/extensions/ERC721Burnable.md b/docs/elin/contracts/token/ERC721/extensions/ERC721Burnable.md deleted file mode 100644 index 672f9f1c..00000000 --- a/docs/elin/contracts/token/ERC721/extensions/ERC721Burnable.md +++ /dev/null @@ -1,344 +0,0 @@ -# ERC721Burnable - - - -> ERC721 Burnable Token - - - -*ERC721 Token that can be burned (destroyed).* - -## Methods - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-approve}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256) -``` - - - -*See {IERC721-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### burn - -```solidity -function burn(uint256 tokenId) external nonpayable -``` - - - -*Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-getApproved}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*See {IERC721-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*See {IERC721Metadata-name}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-ownerOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC721-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*See {IERC721Metadata-symbol}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### tokenURI - -```solidity -function tokenURI(uint256 tokenId) external view returns (string) -``` - - - -*See {IERC721Metadata-tokenURI}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-transferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC721/extensions/ERC721Enumerable.md b/docs/elin/contracts/token/ERC721/extensions/ERC721Enumerable.md deleted file mode 100644 index 34a5d0df..00000000 --- a/docs/elin/contracts/token/ERC721/extensions/ERC721Enumerable.md +++ /dev/null @@ -1,390 +0,0 @@ -# ERC721Enumerable - - - - - - - -*This implements an optional extension of {ERC721} defined in the EIP that adds enumerability of all the token ids in the contract as well as all token ids owned by each account.* - -## Methods - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-approve}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256) -``` - - - -*See {IERC721-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-getApproved}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*See {IERC721-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*See {IERC721Metadata-name}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-ownerOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC721-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*See {IERC721Metadata-symbol}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### tokenByIndex - -```solidity -function tokenByIndex(uint256 index) external view returns (uint256) -``` - - - -*See {IERC721Enumerable-tokenByIndex}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### tokenOfOwnerByIndex - -```solidity -function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256) -``` - - - -*See {IERC721Enumerable-tokenOfOwnerByIndex}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### tokenURI - -```solidity -function tokenURI(uint256 tokenId) external view returns (string) -``` - - - -*See {IERC721Metadata-tokenURI}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*See {IERC721Enumerable-totalSupply}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-transferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC721/extensions/ERC721Pausable.md b/docs/elin/contracts/token/ERC721/extensions/ERC721Pausable.md deleted file mode 100644 index cd752c00..00000000 --- a/docs/elin/contracts/token/ERC721/extensions/ERC721Pausable.md +++ /dev/null @@ -1,377 +0,0 @@ -# ERC721Pausable - - - - - - - -*ERC721 token with pausable token transfers, minting and burning. Useful for scenarios such as preventing trades until the end of an evaluation period, or having an emergency switch for freezing all token transfers in the event of a large bug. IMPORTANT: This contract does not include public pause and unpause functions. In addition to inheriting this contract, you must define both functions, invoking the {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate access control, e.g. using {AccessControl} or {Ownable}. Not doing so will make the contract unpausable.* - -## Methods - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-approve}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256) -``` - - - -*See {IERC721-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-getApproved}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*See {IERC721-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*See {IERC721Metadata-name}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-ownerOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### paused - -```solidity -function paused() external view returns (bool) -``` - - - -*Returns true if the contract is paused, and false otherwise.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC721-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*See {IERC721Metadata-symbol}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### tokenURI - -```solidity -function tokenURI(uint256 tokenId) external view returns (string) -``` - - - -*See {IERC721Metadata-tokenURI}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-transferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - - - -*Emitted when the pause is triggered by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - - - -*Emitted when the pause is lifted by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - - - diff --git a/docs/elin/contracts/token/ERC721/extensions/IERC721Enumerable.md b/docs/elin/contracts/token/ERC721/extensions/IERC721Enumerable.md deleted file mode 100644 index 0e37607c..00000000 --- a/docs/elin/contracts/token/ERC721/extensions/IERC721Enumerable.md +++ /dev/null @@ -1,334 +0,0 @@ -# IERC721Enumerable - - - -> ERC-721 Non-Fungible Token Standard, optional enumeration extension - - - -*See https://eips.ethereum.org/EIPS/eip-721* - -## Methods - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256 balance) -``` - - - -*Returns the number of tokens in ``owner``'s account.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| balance | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address operator) -``` - - - -*Returns the account approved for `tokenId` token. Requirements: - `tokenId` must exist.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*Returns if the `operator` is allowed to manage all of the assets of `owner`. See {setApprovalForAll}* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address owner) -``` - - - -*Returns the owner of the `tokenId` token. Requirements: - `tokenId` must exist.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool _approved) external nonpayable -``` - - - -*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 caller. Emits an {ApprovalForAll} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| _approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### tokenByIndex - -```solidity -function tokenByIndex(uint256 index) external view returns (uint256) -``` - - - -*Returns a token ID at a given `index` of all the tokens stored by the contract. Use along with {totalSupply} to enumerate all tokens.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### tokenOfOwnerByIndex - -```solidity -function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*Returns the total amount of tokens stored by the contract.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC721/extensions/IERC721Metadata.md b/docs/elin/contracts/token/ERC721/extensions/IERC721Metadata.md deleted file mode 100644 index 4bbbadc7..00000000 --- a/docs/elin/contracts/token/ERC721/extensions/IERC721Metadata.md +++ /dev/null @@ -1,328 +0,0 @@ -# IERC721Metadata - - - -> ERC-721 Non-Fungible Token Standard, optional metadata extension - - - -*See https://eips.ethereum.org/EIPS/eip-721* - -## Methods - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256 balance) -``` - - - -*Returns the number of tokens in ``owner``'s account.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| balance | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address operator) -``` - - - -*Returns the account approved for `tokenId` token. Requirements: - `tokenId` must exist.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*Returns if the `operator` is allowed to manage all of the assets of `owner`. See {setApprovalForAll}* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the token collection name.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address owner) -``` - - - -*Returns the owner of the `tokenId` token. Requirements: - `tokenId` must exist.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool _approved) external nonpayable -``` - - - -*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 caller. Emits an {ApprovalForAll} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| _approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the token collection symbol.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### tokenURI - -```solidity -function tokenURI(uint256 tokenId) external view returns (string) -``` - - - -*Returns the Uniform Resource Identifier (URI) for `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - - - diff --git a/docs/elin/contracts/token/ERC721/presets/ERC721PresetMinterPauserAutoId.md b/docs/elin/contracts/token/ERC721/presets/ERC721PresetMinterPauserAutoId.md deleted file mode 100644 index 57270c9b..00000000 --- a/docs/elin/contracts/token/ERC721/presets/ERC721PresetMinterPauserAutoId.md +++ /dev/null @@ -1,739 +0,0 @@ -# ERC721PresetMinterPauserAutoId - - - - - - - -*{ERC721} token, including: - ability for holders to burn (destroy) their tokens - a minter role that allows for token minting (creation) - a pauser role that allows to stop all token transfers - token ID and URI autogeneration This contract uses {AccessControl} to lock permissioned functions using the different roles - head to its documentation for details. The account that deploys the contract will be granted the minter and pauser roles, as well as the default admin role, which will let it grant both minter and pauser roles to other accounts. _Deprecated in favor of https://wizard.openzeppelin.com/[Contracts Wizard]._* - -## Methods - -### DEFAULT_ADMIN_ROLE - -```solidity -function DEFAULT_ADMIN_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### MINTER_ROLE - -```solidity -function MINTER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### PAUSER_ROLE - -```solidity -function PAUSER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-approve}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256) -``` - - - -*See {IERC721-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### burn - -```solidity -function burn(uint256 tokenId) external nonpayable -``` - - - -*Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-getApproved}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### getRoleAdmin - -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32) -``` - - - -*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getRoleMember - -```solidity -function getRoleMember(bytes32 role, uint256 index) external view returns (address) -``` - - - -*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### getRoleMemberCount - -```solidity -function getRoleMemberCount(bytes32 role) external view returns (uint256) -``` - - - -*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### grantRole - -```solidity -function grantRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### hasRole - -```solidity -function hasRole(bytes32 role, address account) external view returns (bool) -``` - - - -*Returns `true` if `account` has been granted `role`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*See {IERC721-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### mint - -```solidity -function mint(address to) external nonpayable -``` - - - -*Creates a new token for `to`. Its token ID will be automatically assigned (and available on the emitted {IERC721-Transfer} event), and the token URI autogenerated based on the base URI passed at construction. See {ERC721-_mint}. Requirements: - the caller must have the `MINTER_ROLE`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*See {IERC721Metadata-name}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-ownerOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### pause - -```solidity -function pause() external nonpayable -``` - - - -*Pauses all token transfers. See {ERC721Pausable} and {Pausable-_pause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - -### paused - -```solidity -function paused() external view returns (bool) -``` - - - -*Returns true if the contract is paused, and false otherwise.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### renounceRole - -```solidity -function renounceRole(bytes32 role, address account) external nonpayable -``` - - - -*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 `account`. May emit a {RoleRevoked} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### revokeRole - -```solidity -function revokeRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC721-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*See {IERC721Metadata-symbol}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### tokenByIndex - -```solidity -function tokenByIndex(uint256 index) external view returns (uint256) -``` - - - -*See {IERC721Enumerable-tokenByIndex}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### tokenOfOwnerByIndex - -```solidity -function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256) -``` - - - -*See {IERC721Enumerable-tokenOfOwnerByIndex}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### tokenURI - -```solidity -function tokenURI(uint256 tokenId) external view returns (string) -``` - - - -*See {IERC721Metadata-tokenURI}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*See {IERC721Enumerable-totalSupply}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-transferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### unpause - -```solidity -function unpause() external nonpayable -``` - - - -*Unpauses all token transfers. See {ERC721Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - - - -*Emitted when the pause is triggered by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -### RoleAdminChanged - -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -``` - - - -*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| previousAdminRole `indexed` | bytes32 | undefined | -| newAdminRole `indexed` | bytes32 | undefined | - -### RoleGranted - -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### RoleRevoked - -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*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`)* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - - - -*Emitted when the pause is lifted by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - - - diff --git a/docs/elin/contracts/token/ERC721/utils/ERC721Holder.md b/docs/elin/contracts/token/ERC721/utils/ERC721Holder.md deleted file mode 100644 index 581df219..00000000 --- a/docs/elin/contracts/token/ERC721/utils/ERC721Holder.md +++ /dev/null @@ -1,40 +0,0 @@ -# ERC721Holder - - - - - - - -*Implementation of the {IERC721Receiver} interface. Accepts all token transfers. Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.* - -## Methods - -### onERC721Received - -```solidity -function onERC721Received(address, address, uint256, bytes) external nonpayable returns (bytes4) -``` - - - -*See {IERC721Receiver-onERC721Received}. Always returns `IERC721Receiver.onERC721Received.selector`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | -| _1 | address | undefined | -| _2 | uint256 | undefined | -| _3 | bytes | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | undefined | - - - - diff --git a/docs/elin/contracts/utils/Address.md b/docs/elin/contracts/utils/Address.md deleted file mode 100644 index 927f4068..00000000 --- a/docs/elin/contracts/utils/Address.md +++ /dev/null @@ -1,12 +0,0 @@ -# Address - - - - - - - -*Collection of functions related to the address type* - - - diff --git a/docs/elin/contracts/utils/Context.md b/docs/elin/contracts/utils/Context.md deleted file mode 100644 index 4ab2a354..00000000 --- a/docs/elin/contracts/utils/Context.md +++ /dev/null @@ -1,12 +0,0 @@ -# Context - - - - - - - -*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.* - - - diff --git a/docs/elin/contracts/utils/Counters.md b/docs/elin/contracts/utils/Counters.md deleted file mode 100644 index a20f0630..00000000 --- a/docs/elin/contracts/utils/Counters.md +++ /dev/null @@ -1,12 +0,0 @@ -# Counters - -*Matt Condon (@shrugs)* - -> Counters - - - -*Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number of elements in a mapping, issuing ERC721 ids, or counting request ids. Include with `using Counters for Counters.Counter;`* - - - diff --git a/docs/elin/contracts/utils/Strings.md b/docs/elin/contracts/utils/Strings.md deleted file mode 100644 index f85055d6..00000000 --- a/docs/elin/contracts/utils/Strings.md +++ /dev/null @@ -1,12 +0,0 @@ -# Strings - - - - - - - -*String operations.* - - - diff --git a/docs/elin/contracts/utils/cryptography/ECDSA.md b/docs/elin/contracts/utils/cryptography/ECDSA.md deleted file mode 100644 index d4fef040..00000000 --- a/docs/elin/contracts/utils/cryptography/ECDSA.md +++ /dev/null @@ -1,12 +0,0 @@ -# ECDSA - - - - - - - -*Elliptic Curve Digital Signature Algorithm (ECDSA) operations. These functions can be used to verify that a message was signed by the holder of the private keys of a given address.* - - - diff --git a/docs/elin/contracts/utils/introspection/ERC165.md b/docs/elin/contracts/utils/introspection/ERC165.md deleted file mode 100644 index df8950ab..00000000 --- a/docs/elin/contracts/utils/introspection/ERC165.md +++ /dev/null @@ -1,37 +0,0 @@ -# ERC165 - - - - - - - -*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); } ``` Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.* - -## Methods - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - - diff --git a/docs/elin/contracts/utils/introspection/IERC165.md b/docs/elin/contracts/utils/introspection/IERC165.md deleted file mode 100644 index 71a9f6e6..00000000 --- a/docs/elin/contracts/utils/introspection/IERC165.md +++ /dev/null @@ -1,37 +0,0 @@ -# IERC165 - - - - - - - -*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}.* - -## Methods - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - - - - diff --git a/docs/elin/contracts/utils/math/Math.md b/docs/elin/contracts/utils/math/Math.md deleted file mode 100644 index fe38acd7..00000000 --- a/docs/elin/contracts/utils/math/Math.md +++ /dev/null @@ -1,12 +0,0 @@ -# Math - - - - - - - -*Standard math utilities missing in the Solidity language.* - - - diff --git a/docs/elin/contracts/utils/structs/EnumerableSet.md b/docs/elin/contracts/utils/structs/EnumerableSet.md deleted file mode 100644 index 3fffb679..00000000 --- a/docs/elin/contracts/utils/structs/EnumerableSet.md +++ /dev/null @@ -1,12 +0,0 @@ -# EnumerableSet - - - - - - - -*Library for managing https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive types. Sets have the following properties: - Elements are added, removed, and checked for existence in constant time (O(1)). - Elements are enumerated in O(n). No guarantees are made on the ordering. ``` contract Example { // Add the library methods using EnumerableSet for EnumerableSet.AddressSet; // Declare a set state variable EnumerableSet.AddressSet private mySet; } ``` As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) and `uint256` (`UintSet`) are supported. [WARNING] ==== Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. ====* - - - diff --git a/docs/interfaces/child/IChildERC1155.md b/docs/interfaces/child/IChildERC1155.md index b62ab6c4..ca9efa32 100644 --- a/docs/interfaces/child/IChildERC1155.md +++ b/docs/interfaces/child/IChildERC1155.md @@ -78,7 +78,7 @@ Burns an NFT tokens from a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### burnBatch @@ -166,7 +166,7 @@ Mints an NFT token to a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### mintBatch diff --git a/docs/interfaces/child/IChildERC20.md b/docs/interfaces/child/IChildERC20.md index 77289302..2560c9da 100644 --- a/docs/interfaces/child/IChildERC20.md +++ b/docs/interfaces/child/IChildERC20.md @@ -99,7 +99,7 @@ Burns an amount of tokens from a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### decimals @@ -158,7 +158,7 @@ Mints an amount of tokens to a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### name diff --git a/docs/interfaces/child/IChildERC721.md b/docs/interfaces/child/IChildERC721.md index 93c78ceb..2ccf8e0d 100644 --- a/docs/interfaces/child/IChildERC721.md +++ b/docs/interfaces/child/IChildERC721.md @@ -70,7 +70,7 @@ Burns an NFT tokens from a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### burnBatch @@ -179,7 +179,7 @@ Mints an NFT token to a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### mintBatch @@ -317,7 +317,7 @@ function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) ### setApprovalForAll ```solidity -function setApprovalForAll(address operator, bool _approved) external nonpayable +function setApprovalForAll(address operator, bool approved) external nonpayable ``` @@ -329,7 +329,7 @@ function setApprovalForAll(address operator, bool _approved) external nonpayable | Name | Type | Description | |---|---|---| | operator | address | undefined | -| _approved | bool | undefined | +| approved | bool | undefined | ### supportsInterface diff --git a/docs/interfaces/child/INativeERC20.md b/docs/interfaces/child/INativeERC20.md index bd747084..76391b7c 100644 --- a/docs/interfaces/child/INativeERC20.md +++ b/docs/interfaces/child/INativeERC20.md @@ -99,7 +99,7 @@ Burns an amount of tokens from a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### decimals @@ -121,7 +121,7 @@ function decimals() external view returns (uint8) ### initialize ```solidity -function initialize(address predicate_, address rootToken_, string name_, string symbol_, uint8 decimals_) external nonpayable +function initialize(address predicate_, address rootToken_, string name_, string symbol_, uint8 decimals_, uint256 tokenSupply_) external nonpayable ``` @@ -137,6 +137,7 @@ function initialize(address predicate_, address rootToken_, string name_, string | name_ | string | undefined | | symbol_ | string | undefined | | decimals_ | uint8 | undefined | +| tokenSupply_ | uint256 | undefined | ### mint @@ -159,7 +160,7 @@ Mints an amount of tokens to a particular address | Name | Type | Description | |---|---|---| -| _0 | bool | bool Returns true if function call is succesful | +| _0 | bool | bool Returns true if function call is successful | ### name @@ -201,7 +202,7 @@ Returns predicate address controlling the child token function rootToken() external view returns (address) ``` -Returns predicate address controlling the child token +Returns corresponding root token address for the child native token @@ -210,7 +211,7 @@ Returns predicate address controlling the child token | Name | Type | Description | |---|---|---| -| _0 | address | address Returns the address of the predicate | +| _0 | address | address Returns the root token address | ### symbol diff --git a/docs/interfaces/child/validator/IRewardPool.md b/docs/interfaces/child/validator/IRewardPool.md index f2f7f496..12835dce 100644 --- a/docs/interfaces/child/validator/IRewardPool.md +++ b/docs/interfaces/child/validator/IRewardPool.md @@ -13,7 +13,7 @@ Distributes rewards to validators for committed epochs ### distributeRewardFor ```solidity -function distributeRewardFor(uint256 epochId, Uptime[] uptime) external nonpayable +function distributeRewardFor(uint256 epochId, Uptime[] uptime, uint256 epochSize) external nonpayable ``` @@ -26,6 +26,7 @@ function distributeRewardFor(uint256 epochId, Uptime[] uptime) external nonpayab |---|---|---| | epochId | uint256 | undefined | | uptime | Uptime[] | undefined | +| epochSize | uint256 | undefined | ### paidRewardPerEpoch diff --git a/docs/interfaces/child/validator/IValidatorSet.md b/docs/interfaces/child/validator/IValidatorSet.md index 504c3d09..c6bbd39a 100644 --- a/docs/interfaces/child/validator/IValidatorSet.md +++ b/docs/interfaces/child/validator/IValidatorSet.md @@ -10,23 +10,6 @@ Manages voting power for validators and commits epochs for child chains ## Methods -### EPOCH_SIZE - -```solidity -function EPOCH_SIZE() external view returns (uint256) -``` - -amount of blocks in an epoch - -*when an epoch is committed a multiple of this number of blocks must be committed* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - ### balanceOfAt ```solidity @@ -53,7 +36,7 @@ returns a validator balance for a given epoch ### commitEpoch ```solidity -function commitEpoch(uint256 id, Epoch epoch) external nonpayable +function commitEpoch(uint256 id, Epoch epoch, uint256 epochSize) external nonpayable ``` @@ -66,6 +49,7 @@ function commitEpoch(uint256 id, Epoch epoch) external nonpayable |---|---|---| | id | uint256 | undefined | | epoch | Epoch | undefined | +| epochSize | uint256 | undefined | ### onStateReceive @@ -107,6 +91,22 @@ Calculates how much is yet to become withdrawable for account. |---|---|---| | _0 | uint256 | Amount not yet withdrawable (in MATIC wei) | +### slash + +```solidity +function slash(address[] validators) external nonpayable +``` + +initialises slashing process + +*system call,given list of validators are slashed on L2 subsequently after their stake is slashed on L1* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| validators | address[] | list of validators to be slashed | + ### totalBlocks ```solidity @@ -226,7 +226,7 @@ event NewEpoch(uint256 indexed id, uint256 indexed startBlock, uint256 indexed e ### Slashed ```solidity -event Slashed(uint256 indexed validator, uint256 amount) +event Slashed(uint256 indexed exitId, address[] validators) ``` @@ -237,8 +237,8 @@ event Slashed(uint256 indexed validator, uint256 amount) | Name | Type | Description | |---|---|---| -| validator `indexed` | uint256 | undefined | -| amount | uint256 | undefined | +| exitId `indexed` | uint256 | undefined | +| validators | address[] | undefined | ### Withdrawal diff --git a/docs/interfaces/root/IExitHelper.md b/docs/interfaces/root/IExitHelper.md index d84afed9..119be1f1 100644 --- a/docs/interfaces/root/IExitHelper.md +++ b/docs/interfaces/root/IExitHelper.md @@ -26,6 +26,23 @@ function batchExit(IExitHelper.BatchExitInput[] inputs) external nonpayable |---|---|---| | inputs | IExitHelper.BatchExitInput[] | undefined | +### caller + +```solidity +function caller() external view returns (address) +``` + +Returns the address that called the exit function + +*only available in the context of the exit function* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | address of the caller | + ### exit ```solidity diff --git a/docs/interfaces/root/staking/ICustomSupernetManager.md b/docs/interfaces/root/staking/ICustomSupernetManager.md index 4d60589a..5eabe384 100644 --- a/docs/interfaces/root/staking/ICustomSupernetManager.md +++ b/docs/interfaces/root/staking/ICustomSupernetManager.md @@ -204,7 +204,7 @@ event StakingEnabled() ### ValidatorDeactivated ```solidity -event ValidatorDeactivated(address validator) +event ValidatorDeactivated(address indexed validator) ``` @@ -215,7 +215,7 @@ event ValidatorDeactivated(address validator) | Name | Type | Description | |---|---|---| -| validator | address | undefined | +| validator `indexed` | address | undefined | ### ValidatorRegistered diff --git a/docs/lib/AccessList.md b/docs/lib/AccessList.md index 695e525c..23250514 100644 --- a/docs/lib/AccessList.md +++ b/docs/lib/AccessList.md @@ -216,7 +216,7 @@ function renounceOwnership() external nonpayable -*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.* +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* ### setAllowList diff --git a/docs/lib/ChildManagerLib.md b/docs/lib/ChildManagerLib.md deleted file mode 100644 index 2c9b6934..00000000 --- a/docs/lib/ChildManagerLib.md +++ /dev/null @@ -1,12 +0,0 @@ -# ChildManagerLib - - - - - - - - - - - diff --git a/docs/lib/StakeManagerLib.md b/docs/lib/StakeManagerLib.md deleted file mode 100644 index 3e72d4c1..00000000 --- a/docs/lib/StakeManagerLib.md +++ /dev/null @@ -1,12 +0,0 @@ -# StakeManagerLib - - - - - - - - - - - diff --git a/docs/mocks/MockClones.md b/docs/mocks/MockClones.md deleted file mode 100644 index 074cea3c..00000000 --- a/docs/mocks/MockClones.md +++ /dev/null @@ -1,39 +0,0 @@ -# MockClones - - - - - - - -*https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for deploying minimal proxy contracts, also known as "clones". > To simply and cheaply clone contract functionality in an immutable way, this standard specifies > a minimal bytecode implementation that delegates all calls to a known, fixed address. The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the deterministic method. _Available since v3.4._* - -## Methods - -### predictDeterministicAddress - -```solidity -function predictDeterministicAddress(address implementation, bytes32 salt, address deployer) external pure returns (address predicted) -``` - - - -*Computes the address of a clone deployed using {Clones-cloneDeterministic}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| implementation | address | undefined | -| salt | bytes32 | undefined | -| deployer | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| predicted | address | undefined | - - - - diff --git a/docs/mocks/MockERC1155.md b/docs/mocks/MockERC1155.md deleted file mode 100644 index 90474dba..00000000 --- a/docs/mocks/MockERC1155.md +++ /dev/null @@ -1,654 +0,0 @@ -# MockERC1155 - - - - - - - - - -## Methods - -### DEFAULT_ADMIN_ROLE - -```solidity -function DEFAULT_ADMIN_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### MINTER_ROLE - -```solidity -function MINTER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### PAUSER_ROLE - -```solidity -function PAUSER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - - - -*See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - - - -*See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256[] | undefined | - -### burn - -```solidity -function burn(address account, uint256 id, uint256 value) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### burnBatch - -```solidity -function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### getRoleAdmin - -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32) -``` - - - -*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getRoleMember - -```solidity -function getRoleMember(bytes32 role, uint256 index) external view returns (address) -``` - - - -*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### getRoleMemberCount - -```solidity -function getRoleMemberCount(bytes32 role) external view returns (uint256) -``` - - - -*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### grantRole - -```solidity -function grantRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### hasRole - -```solidity -function hasRole(bytes32 role, address account) external view returns (bool) -``` - - - -*Returns `true` if `account` has been granted `role`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - - - -*See {IERC1155-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### mint - -```solidity -function mint(address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*Creates `amount` new tokens for `to`, of token type `id`. See {ERC1155-_mint}. Requirements: - the caller must have the `MINTER_ROLE`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### mintBatch - -```solidity -function mintBatch(address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*xref:ROOT:erc1155.adoc#batch-operations[Batched] variant of {mint}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### pause - -```solidity -function pause() external nonpayable -``` - - - -*Pauses all token transfers. See {ERC1155Pausable} and {Pausable-_pause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - -### paused - -```solidity -function paused() external view returns (bool) -``` - - - -*Returns true if the contract is paused, and false otherwise.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### renounceRole - -```solidity -function renounceRole(bytes32 role, address account) external nonpayable -``` - - - -*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 `account`. May emit a {RoleRevoked} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### revokeRole - -```solidity -function revokeRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeBatchTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - - - -*See {IERC1155-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC1155-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### unpause - -```solidity -function unpause() external nonpayable -``` - - - -*Unpauses all token transfers. See {ERC1155Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - -### uri - -```solidity -function uri(uint256) external view returns (string) -``` - - - -*See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\{id\}` substring with the actual token type ID.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - - - -## Events - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - - - -*Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - - - -*Emitted when the pause is triggered by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -### RoleAdminChanged - -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -``` - - - -*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| previousAdminRole `indexed` | bytes32 | undefined | -| newAdminRole `indexed` | bytes32 | undefined | - -### RoleGranted - -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### RoleRevoked - -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*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`)* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - - - -*Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - - - -*Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - - - -*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}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| value | string | undefined | -| id `indexed` | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - - - -*Emitted when the pause is lifted by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - - - diff --git a/docs/mocks/MockERC20.md b/docs/mocks/MockERC20.md deleted file mode 100644 index d6908dd7..00000000 --- a/docs/mocks/MockERC20.md +++ /dev/null @@ -1,672 +0,0 @@ -# MockERC20 - - - - - - - - - -## Methods - -### DEFAULT_ADMIN_ROLE - -```solidity -function DEFAULT_ADMIN_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### MINTER_ROLE - -```solidity -function MINTER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### PAUSER_ROLE - -```solidity -function PAUSER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### allowance - -```solidity -function allowance(address owner, address spender) external view returns (uint256) -``` - - - -*See {IERC20-allowance}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| spender | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### approve - -```solidity -function approve(address spender, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-approve}. NOTE: If `amount` 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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### balanceOf - -```solidity -function balanceOf(address account) external view returns (uint256) -``` - - - -*See {IERC20-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### burn - -```solidity -function burn(uint256 amount) external nonpayable -``` - - - -*Destroys `amount` tokens from the caller. See {ERC20-_burn}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| amount | uint256 | undefined | - -### burnFrom - -```solidity -function burnFrom(address account, uint256 amount) external nonpayable -``` - - - -*Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | -| amount | uint256 | undefined | - -### decimals - -```solidity -function decimals() external view returns (uint8) -``` - - - -*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 this function is 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}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint8 | undefined | - -### decreaseAllowance - -```solidity -function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool) -``` - - - -*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`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| subtractedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### getRoleAdmin - -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32) -``` - - - -*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getRoleMember - -```solidity -function getRoleMember(bytes32 role, uint256 index) external view returns (address) -``` - - - -*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### getRoleMemberCount - -```solidity -function getRoleMemberCount(bytes32 role) external view returns (uint256) -``` - - - -*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### grantRole - -```solidity -function grantRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### hasRole - -```solidity -function hasRole(bytes32 role, address account) external view returns (bool) -``` - - - -*Returns `true` if `account` has been granted `role`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### increaseAllowance - -```solidity -function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool) -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| spender | address | undefined | -| addedValue | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### mint - -```solidity -function mint(address to, uint256 amount) external nonpayable -``` - - - -*Creates `amount` new tokens for `to`. See {ERC20-_mint}. Requirements: - the caller must have the `MINTER_ROLE`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*Returns the name of the token.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### pause - -```solidity -function pause() external nonpayable -``` - - - -*Pauses all token transfers. See {ERC20Pausable} and {Pausable-_pause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - -### paused - -```solidity -function paused() external view returns (bool) -``` - - - -*Returns true if the contract is paused, and false otherwise.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### renounceRole - -```solidity -function renounceRole(bytes32 role, address account) external nonpayable -``` - - - -*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 `account`. May emit a {RoleRevoked} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### revokeRole - -```solidity -function revokeRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*Returns the symbol of the token, usually a shorter version of the name.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*See {IERC20-totalSupply}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transfer - -```solidity -function transfer(address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool) -``` - - - -*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 `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| amount | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### unpause - -```solidity -function unpause() external nonpayable -``` - - - -*Unpauses all token transfers. See {ERC20Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value) -``` - - - -*Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| spender `indexed` | address | undefined | -| value | uint256 | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - - - -*Emitted when the pause is triggered by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -### RoleAdminChanged - -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -``` - - - -*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| previousAdminRole `indexed` | bytes32 | undefined | -| newAdminRole `indexed` | bytes32 | undefined | - -### RoleGranted - -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### RoleRevoked - -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*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`)* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value) -``` - - - -*Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| value | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - - - -*Emitted when the pause is lifted by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - - - diff --git a/docs/mocks/MockERC721.md b/docs/mocks/MockERC721.md deleted file mode 100644 index c959e8d4..00000000 --- a/docs/mocks/MockERC721.md +++ /dev/null @@ -1,739 +0,0 @@ -# MockERC721 - - - - - - - - - -## Methods - -### DEFAULT_ADMIN_ROLE - -```solidity -function DEFAULT_ADMIN_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### MINTER_ROLE - -```solidity -function MINTER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### PAUSER_ROLE - -```solidity -function PAUSER_ROLE() external view returns (bytes32) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### approve - -```solidity -function approve(address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-approve}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | -| tokenId | uint256 | undefined | - -### balanceOf - -```solidity -function balanceOf(address owner) external view returns (uint256) -``` - - - -*See {IERC721-balanceOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### burn - -```solidity -function burn(uint256 tokenId) external nonpayable -``` - - - -*Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -### getApproved - -```solidity -function getApproved(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-getApproved}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### getRoleAdmin - -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32) -``` - - - -*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - -### getRoleMember - -```solidity -function getRoleMember(bytes32 role, uint256 index) external view returns (address) -``` - - - -*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### getRoleMemberCount - -```solidity -function getRoleMemberCount(bytes32 role) external view returns (uint256) -``` - - - -*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### grantRole - -```solidity -function grantRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### hasRole - -```solidity -function hasRole(bytes32 role, address account) external view returns (bool) -``` - - - -*Returns `true` if `account` has been granted `role`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address owner, address operator) external view returns (bool) -``` - - - -*See {IERC721-isApprovedForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### mint - -```solidity -function mint(address to) external nonpayable -``` - - - -*Creates a new token for `to`. Its token ID will be automatically assigned (and available on the emitted {IERC721-Transfer} event), and the token URI autogenerated based on the base URI passed at construction. See {ERC721-_mint}. Requirements: - the caller must have the `MINTER_ROLE`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| to | address | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - - - -*See {IERC721Metadata-name}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenId) external view returns (address) -``` - - - -*See {IERC721-ownerOf}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | - -### pause - -```solidity -function pause() external nonpayable -``` - - - -*Pauses all token transfers. See {ERC721Pausable} and {Pausable-_pause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - -### paused - -```solidity -function paused() external view returns (bool) -``` - - - -*Returns true if the contract is paused, and false otherwise.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### renounceRole - -```solidity -function renounceRole(bytes32 role, address account) external nonpayable -``` - - - -*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 `account`. May emit a {RoleRevoked} event.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### revokeRole - -```solidity -function revokeRole(bytes32 role, address account) external nonpayable -``` - - - -*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.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role | bytes32 | undefined | -| account | address | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable -``` - - - -*See {IERC721-safeTransferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - - - -*See {IERC721-setApprovalForAll}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - - - -*See {IERC165-supportsInterface}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | - -### symbol - -```solidity -function symbol() external view returns (string) -``` - - - -*See {IERC721Metadata-symbol}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### tokenByIndex - -```solidity -function tokenByIndex(uint256 index) external view returns (uint256) -``` - - - -*See {IERC721Enumerable-tokenByIndex}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### tokenOfOwnerByIndex - -```solidity -function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256) -``` - - - -*See {IERC721Enumerable-tokenOfOwnerByIndex}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | -| index | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### tokenURI - -```solidity -function tokenURI(uint256 tokenId) external view returns (string) -``` - - - -*See {IERC721Metadata-tokenURI}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | - -### totalSupply - -```solidity -function totalSupply() external view returns (uint256) -``` - - - -*See {IERC721Enumerable-totalSupply}.* - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### transferFrom - -```solidity -function transferFrom(address from, address to, uint256 tokenId) external nonpayable -``` - - - -*See {IERC721-transferFrom}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from | address | undefined | -| to | address | undefined | -| tokenId | uint256 | undefined | - -### unpause - -```solidity -function unpause() external nonpayable -``` - - - -*Unpauses all token transfers. See {ERC721Pausable} and {Pausable-_unpause}. Requirements: - the caller must have the `PAUSER_ROLE`.* - - - - -## Events - -### Approval - -```solidity -event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -``` - - - -*Emitted when `owner` enables `approved` to manage the `tokenId` token.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| approved `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -``` - - - -*Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| owner `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - - - -*Emitted when the pause is triggered by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - -### RoleAdminChanged - -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -``` - - - -*Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this. _Available since v3.1._* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| previousAdminRole `indexed` | bytes32 | undefined | -| newAdminRole `indexed` | bytes32 | undefined | - -### RoleGranted - -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### RoleRevoked - -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -``` - - - -*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`)* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| role `indexed` | bytes32 | undefined | -| account `indexed` | address | undefined | -| sender `indexed` | address | undefined | - -### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -``` - - - -*Emitted when `tokenId` token is transferred from `from` to `to`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| tokenId `indexed` | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - - - -*Emitted when the pause is lifted by `account`.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| account | address | undefined | - - - diff --git a/docs/mocks/MockNativeERC20Transfer.md b/docs/mocks/MockNativeERC20Transfer.md deleted file mode 100644 index e01635a0..00000000 --- a/docs/mocks/MockNativeERC20Transfer.md +++ /dev/null @@ -1,33 +0,0 @@ -# MockNativeERC20Transfer - - - - - - - - - -## Methods - -### transferFrom - -```solidity -function transferFrom(address token, address receiver, uint256 amount) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| token | address | undefined | -| receiver | address | undefined | -| amount | uint256 | undefined | - - - - diff --git a/docs/mocks/MockSupernetManager.md b/docs/mocks/MockSupernetManager.md deleted file mode 100644 index a9b8af16..00000000 --- a/docs/mocks/MockSupernetManager.md +++ /dev/null @@ -1,100 +0,0 @@ -# MockSupernetManager - - - - - - - - - -## Methods - -### id - -```solidity -function id() external view returns (uint256) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### initialize - -```solidity -function initialize(address stakeManager) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| stakeManager | address | undefined | - -### onInit - -```solidity -function onInit(uint256 id_) external nonpayable -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| id_ | uint256 | undefined | - -### onStake - -```solidity -function onStake(address validator, uint256 amount) external nonpayable -``` - -called when a validator stakes - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| validator | address | undefined | -| amount | uint256 | undefined | - - - -## Events - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - - - -*Triggered when the contract has been initialized or reinitialized.* - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - - - diff --git a/docs/mocks/StateReceivingContract.md b/docs/mocks/StateReceivingContract.md deleted file mode 100644 index 9bdcddb9..00000000 --- a/docs/mocks/StateReceivingContract.md +++ /dev/null @@ -1,56 +0,0 @@ -# StateReceivingContract - - - - - - - - - -## Methods - -### counter - -```solidity -function counter() external view returns (uint256) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### onStateReceive - -```solidity -function onStateReceive(uint256, address, bytes data) external nonpayable returns (bytes32) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | -| _1 | address | undefined | -| data | bytes | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | - - - - diff --git a/docs/root/ChildMintableERC1155Predicate.md b/docs/root/ChildMintableERC1155Predicate.md index 4eacef7f..c3e6685b 100644 --- a/docs/root/ChildMintableERC1155Predicate.md +++ b/docs/root/ChildMintableERC1155Predicate.md @@ -135,7 +135,7 @@ function exitHelper() external view returns (address) function initialize(address newStateSender, address newExitHelper, address newRootERC1155Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for ChildERC1155Predicate +Initialization function for ChildMintableERC1155Predicate *Can only be called once.* @@ -143,8 +143,8 @@ Initilization function for ChildERC1155Predicate | Name | Type | Description | |---|---|---| -| newStateSender | address | Address of L2StateSender to send exit information to | -| newExitHelper | address | Address of StateReceiver to receive deposit information from | +| newStateSender | address | Address of StateSender to send exit information to | +| newExitHelper | address | Address of ExitHelper to receive deposit information from | | newRootERC1155Predicate | address | Address of root ERC1155 predicate to communicate with | | newChildTokenTemplate | address | Address of child token implementation to deploy clones of | diff --git a/docs/root/ChildMintableERC20Predicate.md b/docs/root/ChildMintableERC20Predicate.md index 536c5f2d..d193ed01 100644 --- a/docs/root/ChildMintableERC20Predicate.md +++ b/docs/root/ChildMintableERC20Predicate.md @@ -101,7 +101,7 @@ function exitHelper() external view returns (address) function initialize(address newStateSender, address newExitHelper, address newRootERC20Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for RootERC20Predicate +Initialization function for ChildMintableERC20Predicate *Can only be called once.* @@ -111,7 +111,7 @@ Initilization function for RootERC20Predicate |---|---|---| | newStateSender | address | Address of StateSender to send deposit information to | | newExitHelper | address | Address of ExitHelper to receive withdrawal information from | -| newRootERC20Predicate | address | Address of child ERC20 predicate to communicate with | +| newRootERC20Predicate | address | Address of root ERC20 predicate to communicate with | | newChildTokenTemplate | address | undefined | ### onL2StateReceive diff --git a/docs/root/ChildMintableERC721Predicate.md b/docs/root/ChildMintableERC721Predicate.md index b60b305b..f3c5b1bc 100644 --- a/docs/root/ChildMintableERC721Predicate.md +++ b/docs/root/ChildMintableERC721Predicate.md @@ -135,7 +135,7 @@ function exitHelper() external view returns (address) function initialize(address newStateSender, address newExitHelper, address newRootERC721Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for ChildERC721Predicate +Initialization function for ChildMintableERC721Predicate *Can only be called once. `newNativeTokenRootAddress` should be set to zero where root token does not exist.* @@ -144,7 +144,7 @@ Initilization function for ChildERC721Predicate | Name | Type | Description | |---|---|---| | newStateSender | address | Address of StateSender to send exit information to | -| newExitHelper | address | Address of StateReceiver to receive deposit information from | +| newExitHelper | address | Address of ExitHelper to receive deposit information from | | newRootERC721Predicate | address | Address of root ERC721 predicate to communicate with | | newChildTokenTemplate | address | Address of child token implementation to deploy clones of | diff --git a/docs/root/ExitHelper.md b/docs/root/ExitHelper.md index 671eddb3..e0593be2 100644 --- a/docs/root/ExitHelper.md +++ b/docs/root/ExitHelper.md @@ -26,6 +26,23 @@ function batchExit(IExitHelper.BatchExitInput[] inputs) external nonpayable |---|---|---| | inputs | IExitHelper.BatchExitInput[] | undefined | +### caller + +```solidity +function caller() external view returns (address) +``` + +Returns the address that called the exit function + +*only available in the context of the exit function* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | address of the caller | + ### checkpointManager ```solidity diff --git a/docs/root/RootERC1155Predicate.md b/docs/root/RootERC1155Predicate.md index 432b452f..4ea09781 100644 --- a/docs/root/RootERC1155Predicate.md +++ b/docs/root/RootERC1155Predicate.md @@ -208,7 +208,7 @@ function exitHelper() external view returns (address) function initialize(address newStateSender, address newExitHelper, address newChildERC1155Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for RootERC1155Predicate +Initialization function for RootERC1155Predicate *Can only be called once.* diff --git a/docs/root/RootERC20Predicate.md b/docs/root/RootERC20Predicate.md index 4c4b96f5..a1116f71 100644 --- a/docs/root/RootERC20Predicate.md +++ b/docs/root/RootERC20Predicate.md @@ -153,7 +153,7 @@ function exitHelper() external view returns (address) function initialize(address newStateSender, address newExitHelper, address newChildERC20Predicate, address newChildTokenTemplate, address nativeTokenRootAddress) external nonpayable ``` -Initilization function for RootERC20Predicate +Initialization function for RootERC20Predicate *Can only be called once.* diff --git a/docs/root/RootERC721Predicate.md b/docs/root/RootERC721Predicate.md index c942ef15..b3460b07 100644 --- a/docs/root/RootERC721Predicate.md +++ b/docs/root/RootERC721Predicate.md @@ -205,7 +205,7 @@ function exitHelper() external view returns (address) function initialize(address newStateSender, address newExitHelper, address newChildERC721Predicate, address newChildTokenTemplate) external nonpayable ``` -Initilization function for RootERC721Predicate +Initialization function for RootERC721Predicate *Can only be called once.* diff --git a/docs/root/staking/CustomSupernetManager.md b/docs/root/staking/CustomSupernetManager.md index e6c26317..b3135f74 100644 --- a/docs/root/staking/CustomSupernetManager.md +++ b/docs/root/staking/CustomSupernetManager.md @@ -10,23 +10,6 @@ ## Methods -### SLASHING_PERCENTAGE - -```solidity -function SLASHING_PERCENTAGE() external view returns (uint256) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - ### acceptOwnership ```solidity @@ -265,7 +248,7 @@ function renounceOwnership() external nonpayable -*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.* +*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* ### transferOwnership @@ -456,7 +439,7 @@ event StakingEnabled() ### ValidatorDeactivated ```solidity -event ValidatorDeactivated(address validator) +event ValidatorDeactivated(address indexed validator) ``` @@ -467,7 +450,7 @@ event ValidatorDeactivated(address validator) | Name | Type | Description | |---|---|---| -| validator | address | undefined | +| validator `indexed` | address | undefined | ### ValidatorRegistered diff --git a/docs/root/staking/StakeManager.md b/docs/root/staking/StakeManager.md index 9e697b8b..051fa9f6 100644 --- a/docs/root/staking/StakeManager.md +++ b/docs/root/staking/StakeManager.md @@ -35,7 +35,7 @@ returns the child id for a child chain manager contract ### initialize ```solidity -function initialize(address newMatic) external nonpayable +function initialize(address newStakingToken) external nonpayable ``` @@ -46,7 +46,7 @@ function initialize(address newMatic) external nonpayable | Name | Type | Description | |---|---|---| -| newMatic | address | undefined | +| newStakingToken | address | undefined | ### managerOf diff --git a/docs/root/staking/StakeManagerChildData.md b/docs/root/staking/StakeManagerChildData.md new file mode 100644 index 00000000..283b810e --- /dev/null +++ b/docs/root/staking/StakeManagerChildData.md @@ -0,0 +1,12 @@ +# StakeManagerChildData + + + +> StakeManagerChildData + +Holds data to allow look-up between child chain manager contract address and child chain id. Note that this is contract is designed to be included in StakeManager. It is upgradeable. + + + + + diff --git a/docs/root/staking/StakeManagerStakingData.md b/docs/root/staking/StakeManagerStakingData.md new file mode 100644 index 00000000..cbf2e4b3 --- /dev/null +++ b/docs/root/staking/StakeManagerStakingData.md @@ -0,0 +1,12 @@ +# StakeManagerStakingData + + + +> StakeManagerStakingData + +Holds all staking related data. Note that this is contract is designed to be included in StakeManager. It is upgradeable. + + + + + diff --git a/foundry.toml b/foundry.toml index c9f49175..23241ef1 100644 --- a/foundry.toml +++ b/foundry.toml @@ -15,5 +15,6 @@ ffi = true # do not use for computationally expensive tests [profile.intense.fuzz] runs = 10000 +max_test_rejects = 999999 -# See more config options https://book.getfoundry.sh/reference/config.html \ No newline at end of file +# See more config options https://book.getfoundry.sh/reference/config.html diff --git a/hardhat.config.ts b/hardhat.config.ts index c88830ce..e99f08fd 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -66,6 +66,7 @@ const config: HardhatUserConfig = { dodoc: { // uncomment to stop docs from autogenerating each compile // runOnCompile: false, + exclude: ["mocks", "openzeppelin/contracts", "openzeppelin/contracts-upgradeable"], }, }; diff --git a/package-lock.json b/package-lock.json index 038aafb9..02b600bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,28 +9,28 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@openzeppelin/contracts": "^4.8.3", - "@openzeppelin/contracts-upgradeable": "^4.8.3", + "@openzeppelin/contracts": "^4.9.3", + "@openzeppelin/contracts-upgradeable": "^4.9.3", "@primitivefi/hardhat-dodoc": "^0.2.3", - "hardhat": "^2.14.0", + "hardhat": "^2.17.2", "keccak256": "^1.0.6", - "mcl-wasm": "^1.0.2", + "mcl-wasm": "^1.3.0", "merkletreejs": "^0.3.10" }, "devDependencies": { - "@defi-wonderland/smock": "^2.3.4", + "@defi-wonderland/smock": "^2.3.5", "@nomicfoundation/hardhat-toolbox": "^2.0.2", - "@openzeppelin/hardhat-upgrades": "^1.26.0", - "@types/chai": "^4.3.5", + "@openzeppelin/hardhat-upgrades": "^1.27.0", + "@types/chai": "^4.3.6", "@types/mocha": "^10.0.1", - "@types/node": "^20.1.3", + "@types/node": "^20.5.9", "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", - "dotenv": "^16.0.3", + "dotenv": "^16.3.1", "eslint": "^7.32.0", - "eslint-config-prettier": "^8.8.0", + "eslint-config-prettier": "^9.0.0", "eslint-config-standard": "^16.0.3", - "eslint-plugin-import": "^2.27.4", + "eslint-plugin-import": "^2.28.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-promise": "^5.2.0", @@ -38,9 +38,10 @@ "husky": "^8.0.3", "prettier": "^2.8.8", "prettier-plugin-solidity": "^1.1.3", - "solhint": "^3.4.1", + "solhint": "^3.6.2", + "solidity-coverage": "^0.8.4", "ts-node": "^10.7.0", - "typescript": "^5.0.4" + "typescript": "^5.1.6" } }, "node_modules/@aws-crypto/sha256-js": { @@ -166,9 +167,9 @@ } }, "node_modules/@defi-wonderland/smock": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/@defi-wonderland/smock/-/smock-2.3.4.tgz", - "integrity": "sha512-VYJbsoCOdFRyGkAwvaQhQRrU6V8AjK3five8xdbo41DEE9n3qXzUNBUxyD9HhXB/dWWPFWT21IGw5Ztl6Qw3Ew==", + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@defi-wonderland/smock/-/smock-2.3.5.tgz", + "integrity": "sha512-klANj1hUpc3cd2ShXdVH/bEGwxJd+LxOngkF5gLcIbg6b37RCgMPMmR/94/hgL62F8bfWtuNKsQD7K+c6M5fWQ==", "dev": true, "dependencies": { "@nomicfoundation/ethereumjs-evm": "^1.0.0-rc.3", @@ -1509,19 +1510,19 @@ } }, "node_modules/@openzeppelin/contracts": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.8.3.tgz", - "integrity": "sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg==" + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", + "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==" }, "node_modules/@openzeppelin/contracts-upgradeable": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz", - "integrity": "sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg==" + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.3.tgz", + "integrity": "sha512-jjaHAVRMrE4UuZNfDwjlLGDxTHWIOwTJS2ldnc278a0gevfXfPr8hxKEVBGFBE96kl2G3VHDZhUimw/+G3TG2A==" }, "node_modules/@openzeppelin/hardhat-upgrades": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.26.0.tgz", - "integrity": "sha512-ggCvdIf7A9QcMedCaswecgt3N7hacx3qYOn+4bNPqMAwslo/SJ9vN4AhV0VWkDcY4CqFFou3RFQmDWNeLMBX9A==", + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.27.0.tgz", + "integrity": "sha512-+OwrHWDz9tzpmBev6t2CtZM2tRpy/ybhg5e3GIgyeqTxK2vUV40dxIxO6lie+qKeJHZ2RIdDwvSTSiCEJif+fA==", "dev": true, "dependencies": { "@openzeppelin/upgrades-core": "^1.26.2", @@ -1975,9 +1976,9 @@ } }, "node_modules/@types/chai": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", - "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-VOVRLM1mBxIRxydiViqPcKn6MIxZytrbMpd6RJLIWKxUNr3zux8no0Oc7kJx0WAPIitgZ0gkrDS+btlqQpubpw==", "dev": true }, "node_modules/@types/chai-as-promised": { @@ -2015,7 +2016,6 @@ "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", "dev": true, - "peer": true, "dependencies": { "@types/minimatch": "*", "@types/node": "*" @@ -2042,8 +2042,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "dev": true, - "peer": true + "dev": true }, "node_modules/@types/mocha": { "version": "10.0.1", @@ -2052,9 +2051,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.1.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.3.tgz", - "integrity": "sha512-NP2yfZpgmf2eDRPmgGq+fjGjSwFgYbihA8/gK+ey23qT9RkxsgNTZvGOEpXgzIGqesTYkElELLgtKoMQTys5vA==" + "version": "20.5.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.9.tgz", + "integrity": "sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ==" }, "node_modules/@types/pbkdf2": { "version": "3.1.0", @@ -2261,19 +2260,7 @@ "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", "integrity": "sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==", - "dev": true, - "peer": true - }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } + "dev": true }, "node_modules/abstract-level": { "version": "1.0.3", @@ -2327,7 +2314,6 @@ "resolved": "https://registry.npmjs.org/address/-/address-1.2.2.tgz", "integrity": "sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==", "dev": true, - "peer": true, "engines": { "node": ">= 10.0.0" } @@ -2414,7 +2400,6 @@ "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", "dev": true, "optional": true, - "peer": true, "engines": { "node": ">=0.4.2" } @@ -2523,6 +2508,19 @@ "node": ">=6" } }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-includes": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", @@ -2561,6 +2559,25 @@ "node": ">=0.10.0" } }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz", + "integrity": "sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.flat": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", @@ -2602,7 +2619,6 @@ "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz", "integrity": "sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -2617,6 +2633,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", + "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -2983,6 +3019,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -3517,8 +3554,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", "integrity": "sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==", - "dev": true, - "peer": true + "dev": true }, "node_modules/debug": { "version": "4.3.4", @@ -3590,9 +3626,9 @@ } }, "node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", "dev": true, "dependencies": { "has-property-descriptors": "^1.0.0", @@ -3628,7 +3664,6 @@ "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.5.1.tgz", "integrity": "sha512-aBzdj76lueB6uUst5iAs7+0H/oOjqI5D16XUWxlWMIMROhcM0rfsNVk93zTngq1dDNpoXRr++Sus7ETAExppAQ==", "dev": true, - "peer": true, "dependencies": { "address": "^1.0.1", "debug": "4" @@ -3652,7 +3687,6 @@ "resolved": "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz", "integrity": "sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==", "dev": true, - "peer": true, "dependencies": { "heap": ">= 0.2.0" }, @@ -3685,12 +3719,15 @@ } }, "node_modules/dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", "dev": true, "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, "node_modules/ecc-jsbn": { @@ -3757,18 +3794,19 @@ } }, "node_modules/es-abstract": { - "version": "1.21.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.1.tgz", - "integrity": "sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", + "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", "dev": true, "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.1", "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.3", + "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", "globalthis": "^1.0.3", "gopd": "^1.0.1", @@ -3776,8 +3814,8 @@ "has-property-descriptors": "^1.0.0", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.4", - "is-array-buffer": "^3.0.1", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", @@ -3785,16 +3823,21 @@ "is-string": "^1.0.7", "is-typed-array": "^1.1.10", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.2", + "object-inspect": "^1.12.3", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", + "regexp.prototype.flags": "^1.5.0", + "safe-array-concat": "^1.0.0", "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", "string.prototype.trimend": "^1.0.6", "string.prototype.trimstart": "^1.0.6", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", "typed-array-length": "^1.0.4", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" @@ -3807,8 +3850,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", - "dev": true, - "peer": true + "dev": true }, "node_modules/es-set-tostringtag": { "version": "2.0.1", @@ -3871,7 +3913,6 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", "integrity": "sha512-yhi5S+mNTOuRvyW4gWlg5W1byMaQGWWSYHXsuFZ7GBo7tpyOwi2EdzMP/QWxh9hwkD2m+wDVHJsxhRIj+v/b/A==", "dev": true, - "peer": true, "dependencies": { "esprima": "^2.7.1", "estraverse": "^1.9.1", @@ -3894,7 +3935,6 @@ "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", "dev": true, - "peer": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -3908,7 +3948,6 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", "integrity": "sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -3918,7 +3957,6 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dev": true, - "peer": true, "dependencies": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" @@ -3932,7 +3970,6 @@ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, - "peer": true, "dependencies": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.6", @@ -3950,7 +3987,6 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "dev": true, - "peer": true, "engines": { "node": ">= 0.8.0" } @@ -3960,7 +3996,6 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "dev": true, - "peer": true, "dependencies": { "prelude-ls": "~1.1.2" }, @@ -4026,9 +4061,9 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", - "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -4084,9 +4119,9 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", - "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "dependencies": { "debug": "^3.2.7" @@ -4153,26 +4188,28 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.27.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", - "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "version": "2.28.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz", + "integrity": "sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==", "dev": true, "dependencies": { "array-includes": "^3.1.6", + "array.prototype.findlastindex": "^1.2.2", "array.prototype.flat": "^1.3.1", "array.prototype.flatmap": "^1.3.1", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.7", - "eslint-module-utils": "^2.7.4", + "eslint-module-utils": "^2.8.0", "has": "^1.0.3", - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "is-glob": "^4.0.3", "minimatch": "^3.1.2", + "object.fromentries": "^2.0.6", + "object.groupby": "^1.0.0", "object.values": "^1.1.6", - "resolve": "^1.22.1", - "semver": "^6.3.0", - "tsconfig-paths": "^3.14.1" + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" }, "engines": { "node": ">=4" @@ -4203,9 +4240,9 @@ } }, "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -5296,14 +5333,6 @@ "npm": ">=3" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "engines": { - "node": ">=6" - } - }, "node_modules/evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -5558,7 +5587,8 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "node_modules/function.prototype.name": { "version": "1.1.5", @@ -5611,12 +5641,14 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", - "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { @@ -5664,7 +5696,6 @@ "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==", "dev": true, - "peer": true, "dependencies": { "chalk": "^2.4.2", "node-emoji": "^1.10.0" @@ -5708,7 +5739,6 @@ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", "dev": true, - "peer": true, "dependencies": { "global-prefix": "^3.0.0" }, @@ -5721,7 +5751,6 @@ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", "dev": true, - "peer": true, "dependencies": { "ini": "^1.3.5", "kind-of": "^6.0.2", @@ -5736,7 +5765,6 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, - "peer": true, "dependencies": { "isexe": "^2.0.0" }, @@ -5816,7 +5844,6 @@ "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true, - "peer": true, "engines": { "node": ">=4.x" } @@ -5826,7 +5853,6 @@ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, - "peer": true, "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.0", @@ -5848,7 +5874,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5879,27 +5904,26 @@ } }, "node_modules/hardhat": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.14.0.tgz", - "integrity": "sha512-73jsInY4zZahMSVFurSK+5TNCJTXMv+vemvGia0Ac34Mm19fYp6vEPVGF3sucbumszsYxiTT2TbS8Ii2dsDSoQ==", + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.17.2.tgz", + "integrity": "sha512-oUv40jBeHw0dKpbyQ+iH9cmNMziweLoTW3MnkNxJ2Gc0KGLrQR/1n4vV4xY60zn2LdmRgnwPqy3CgtY0mfwIIA==", "dependencies": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/ethereumjs-block": "5.0.1", - "@nomicfoundation/ethereumjs-blockchain": "7.0.1", - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-evm": "2.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-statemanager": "2.0.1", - "@nomicfoundation/ethereumjs-trie": "6.0.1", - "@nomicfoundation/ethereumjs-tx": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", - "@nomicfoundation/ethereumjs-vm": "7.0.1", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-blockchain": "7.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-evm": "2.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-statemanager": "2.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "@nomicfoundation/ethereumjs-vm": "7.0.2", "@nomicfoundation/solidity-analyzer": "^0.1.0", "@sentry/node": "^5.18.1", "@types/bn.js": "^5.1.0", "@types/lru-cache": "^5.1.0", - "abort-controller": "^3.0.0", "adm-zip": "^0.4.16", "aggregate-error": "^3.0.0", "ansi-escapes": "^4.3.0", @@ -5922,7 +5946,6 @@ "mnemonist": "^0.38.0", "mocha": "^10.0.0", "p-map": "^4.0.0", - "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", "semver": "^6.3.0", @@ -5937,9 +5960,6 @@ "bin": { "hardhat": "internal/cli/bootstrap.js" }, - "engines": { - "node": ">=14.0.0" - }, "peerDependencies": { "ts-node": "*", "typescript": "*" @@ -5977,15 +5997,15 @@ } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-block": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.1.tgz", - "integrity": "sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw==", - "dependencies": { - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-trie": "6.0.1", - "@nomicfoundation/ethereumjs-tx": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz", + "integrity": "sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==", + "dependencies": { + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "ethereum-cryptography": "0.1.3", "ethers": "^5.7.1" }, @@ -6016,17 +6036,17 @@ } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-blockchain": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.1.tgz", - "integrity": "sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A==", - "dependencies": { - "@nomicfoundation/ethereumjs-block": "5.0.1", - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-ethash": "3.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-trie": "6.0.1", - "@nomicfoundation/ethereumjs-tx": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz", + "integrity": "sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==", + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-ethash": "3.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "abstract-level": "^1.0.3", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", @@ -6061,22 +6081,22 @@ } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-common": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.1.tgz", - "integrity": "sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz", + "integrity": "sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==", "dependencies": { - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.2", "crc-32": "^1.2.0" } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-ethash": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.1.tgz", - "integrity": "sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.2.tgz", + "integrity": "sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==", "dependencies": { - "@nomicfoundation/ethereumjs-block": "5.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "abstract-level": "^1.0.3", "bigint-crypto-utils": "^3.0.23", "ethereum-cryptography": "0.1.3" @@ -6108,14 +6128,14 @@ } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-evm": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.1.tgz", - "integrity": "sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz", + "integrity": "sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==", "dependencies": { "@ethersproject/providers": "^5.7.1", - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-tx": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", "mcl-wasm": "^0.7.1", @@ -6148,9 +6168,9 @@ } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-rlp": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.1.tgz", - "integrity": "sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz", + "integrity": "sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==", "bin": { "rlp": "bin/rlp" }, @@ -6159,12 +6179,12 @@ } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-statemanager": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.1.tgz", - "integrity": "sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.2.tgz", + "integrity": "sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==", "dependencies": { - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", "ethers": "^5.7.1", @@ -6194,12 +6214,12 @@ } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-trie": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.1.tgz", - "integrity": "sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz", + "integrity": "sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==", "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "@types/readable-stream": "^2.3.13", "ethereum-cryptography": "0.1.3", "readable-stream": "^3.6.0" @@ -6231,15 +6251,15 @@ } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-tx": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.1.tgz", - "integrity": "sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz", + "integrity": "sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==", "dependencies": { "@chainsafe/ssz": "^0.9.2", "@ethersproject/providers": "^5.7.2", - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "ethereum-cryptography": "0.1.3" }, "engines": { @@ -6269,12 +6289,12 @@ } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-util": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.1.tgz", - "integrity": "sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.2.tgz", + "integrity": "sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==", "dependencies": { "@chainsafe/ssz": "^0.10.0", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", "ethereum-cryptography": "0.1.3" }, "engines": { @@ -6313,19 +6333,19 @@ } }, "node_modules/hardhat/node_modules/@nomicfoundation/ethereumjs-vm": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.1.tgz", - "integrity": "sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ==", - "dependencies": { - "@nomicfoundation/ethereumjs-block": "5.0.1", - "@nomicfoundation/ethereumjs-blockchain": "7.0.1", - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-evm": "2.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-statemanager": "2.0.1", - "@nomicfoundation/ethereumjs-trie": "6.0.1", - "@nomicfoundation/ethereumjs-tx": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz", + "integrity": "sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==", + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-blockchain": "7.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-evm": "2.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-statemanager": "2.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", "mcl-wasm": "^0.7.1", @@ -6399,6 +6419,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -6451,6 +6472,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -6507,8 +6529,7 @@ "version": "0.2.7", "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/hmac-drbg": { "version": "1.0.1", @@ -6706,16 +6727,15 @@ "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true, - "peer": true + "dev": true }, "node_modules/internal-slot": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz", - "integrity": "sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.3", + "get-intrinsic": "^1.2.0", "has": "^1.0.3", "side-channel": "^1.0.4" }, @@ -6728,7 +6748,6 @@ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true, - "peer": true, "engines": { "node": ">= 0.10" } @@ -6742,13 +6761,13 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.1.tgz", - "integrity": "sha512-ASfLknmY8Xa2XtB4wmbz13Wu202baeA18cJBCeCy0wXUHZF0IPyVEXqKEcd+t2fNSLLL1vC6k7lxZEojNbISXQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", + "get-intrinsic": "^1.2.0", "is-typed-array": "^1.1.10" }, "funding": { @@ -6835,9 +6854,9 @@ } }, "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -6874,7 +6893,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", "dev": true, - "peer": true, "engines": { "node": ">=4" } @@ -7085,9 +7103,9 @@ "dev": true }, "node_modules/js-sdsl": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", - "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.2.tgz", + "integrity": "sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==", "funding": { "type": "opencollective", "url": "https://opencollective.com/js-sdsl" @@ -7181,7 +7199,6 @@ "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", "dev": true, - "peer": true, "engines": { "node": "*" } @@ -7231,7 +7248,6 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -7463,11 +7479,14 @@ "peer": true }, "node_modules/mcl-wasm": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-1.0.6.tgz", - "integrity": "sha512-/KYSug255SQoOcrQBxkHeAub9qOcJD3B/n5livcsGKsbv4TOiefNmUAwpMP0Vea5AVBUApolr+iF0GqZixns1w==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-1.3.0.tgz", + "integrity": "sha512-7nChbr2sBEk9tSp7h8LGJp+bm2UfRzSZCV9LUD00ZPQCynT2W5dPBQcX27Nd++f3zMEl1nrgsT9OdHgxRdu7jw==", + "dependencies": { + "@types/node": "^20.2.5" + }, "engines": { - "node": ">=8.9.0" + "node": ">=14.17" } }, "node_modules/md5.js": { @@ -7596,7 +7615,6 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, - "peer": true, "dependencies": { "minimist": "^1.2.6" }, @@ -7844,8 +7862,7 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/node-addon-api": { "version": "2.0.2", @@ -7857,7 +7874,6 @@ "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", "dev": true, - "peer": true, "dependencies": { "lodash": "^4.17.21" } @@ -7867,7 +7883,6 @@ "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", "dev": true, - "peer": true, "dependencies": { "object.getownpropertydescriptors": "^2.0.3", "semver": "^5.7.0" @@ -7878,7 +7893,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, - "peer": true, "bin": { "semver": "bin/semver" } @@ -7927,7 +7941,6 @@ "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", "dev": true, - "peer": true, "dependencies": { "abbrev": "1" }, @@ -7985,6 +7998,7 @@ "version": "1.12.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -8016,12 +8030,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.fromentries": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", + "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/object.getownpropertydescriptors": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz", "integrity": "sha512-yDNzckpM6ntyQiGTik1fKV1DcVDRS+w8bvpWNCBanvH5LfRX9O8WTHqQzG4RZwRAM4I0oU7TV11Lj5v0g20ibw==", "dev": true, - "peer": true, "dependencies": { "array.prototype.reduce": "^1.0.5", "call-bind": "^1.0.2", @@ -8035,6 +8065,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.groupby": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.0.tgz", + "integrity": "sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.21.2", + "get-intrinsic": "^1.2.1" + } + }, "node_modules/object.values": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", @@ -8265,7 +8307,6 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -8420,6 +8461,8 @@ "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "peer": true, "dependencies": { "side-channel": "^1.0.4" }, @@ -8500,7 +8543,6 @@ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", "dev": true, - "peer": true, "dependencies": { "resolve": "^1.1.6" }, @@ -8513,7 +8555,6 @@ "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", "dev": true, - "peer": true, "dependencies": { "minimatch": "^3.0.5" }, @@ -8532,14 +8573,14 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -8705,16 +8746,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.3.tgz", + "integrity": "sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==", "dev": true, "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.12.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -8853,6 +8893,30 @@ "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", "dev": true }, + "node_modules/safe-array-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", + "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -8896,7 +8960,6 @@ "resolved": "https://registry.npmjs.org/sc-istanbul/-/sc-istanbul-0.4.6.tgz", "integrity": "sha512-qJFF/8tW/zJsbyfh/iT/ZM5QNHE3CXxtLJbZsL+CzdJLBsPD7SedJZoUA4d8iAcN2IoMp/Dx80shOOd2x96X/g==", "dev": true, - "peer": true, "dependencies": { "abbrev": "1.0.x", "async": "1.x", @@ -8921,15 +8984,13 @@ "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", - "dev": true, - "peer": true + "dev": true }, "node_modules/sc-istanbul/node_modules/esprima": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", "dev": true, - "peer": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -8943,7 +9004,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", "dev": true, - "peer": true, "dependencies": { "inflight": "^1.0.4", "inherits": "2", @@ -8960,7 +9020,6 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -8969,15 +9028,13 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/sc-istanbul/node_modules/supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", "dev": true, - "peer": true, "dependencies": { "has-flag": "^1.0.0" }, @@ -8990,7 +9047,6 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, - "peer": true, "dependencies": { "isexe": "^2.0.0" }, @@ -9018,9 +9074,9 @@ } }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -9062,8 +9118,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/setimmediate": { "version": "1.0.5", @@ -9127,7 +9182,6 @@ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, - "peer": true, "dependencies": { "glob": "^7.0.0", "interpret": "^1.0.0", @@ -9144,6 +9198,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -9289,9 +9344,9 @@ } }, "node_modules/solhint": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-3.4.1.tgz", - "integrity": "sha512-pzZn2RlZhws1XwvLPVSsxfHrwsteFf5eySOhpAytzXwKQYbTCJV6z8EevYDiSVKMpWrvbKpEtJ055CuEmzp4Xg==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-3.6.2.tgz", + "integrity": "sha512-85EeLbmkcPwD+3JR7aEMKsVC9YrRSxd4qkXuMzrlf7+z2Eqdfm1wHWq1ffTuo5aDhoZxp2I9yF3QkxZOxOL7aQ==", "dev": true, "dependencies": { "@solidity-parser/parser": "^0.16.0", @@ -9307,7 +9362,7 @@ "js-yaml": "^4.1.0", "lodash": "^4.17.21", "pluralize": "^8.0.0", - "semver": "^6.3.0", + "semver": "^7.5.2", "strip-ansi": "^6.0.1", "table": "^6.8.1", "text-table": "^0.2.0" @@ -9453,15 +9508,6 @@ "node": ">=10" } }, - "node_modules/solhint/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/solhint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -9487,14 +9533,13 @@ "dev": true }, "node_modules/solidity-coverage": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.2.tgz", - "integrity": "sha512-cv2bWb7lOXPE9/SSleDO6czkFiMHgP4NXPj+iW9W7iEKLBk7Cj0AGBiNmGX3V1totl9wjPrT0gHmABZKZt65rQ==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.4.tgz", + "integrity": "sha512-xeHOfBOjdMF6hWTbt42iH4x+7j1Atmrf5OldDPMxI+i/COdExUxszOswD9qqvcBTaLGiOrrpnh9UZjSpt4rBsg==", "dev": true, - "peer": true, "dependencies": { "@ethersproject/abi": "^5.0.9", - "@solidity-parser/parser": "^0.14.1", + "@solidity-parser/parser": "^0.16.0", "chalk": "^2.4.2", "death": "^1.1.0", "detect-port": "^1.3.0", @@ -9521,12 +9566,20 @@ "hardhat": "^2.11.0" } }, + "node_modules/solidity-coverage/node_modules/@solidity-parser/parser": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.1.tgz", + "integrity": "sha512-PdhRFNhbTtu3x8Axm0uYpqOy/lODYQK+MlYSgqIsq2L8SFYEHJPHNUiOTAJbDGzNjjr1/n9AcIayxafR/fWmYw==", + "dev": true, + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, "node_modules/solidity-coverage/node_modules/ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -9536,7 +9589,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -9546,7 +9598,6 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -9556,7 +9607,6 @@ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", "dev": true, - "peer": true, "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", @@ -9578,7 +9628,6 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, - "peer": true, "dependencies": { "string-width": "^3.1.0", "strip-ansi": "^5.2.0", @@ -9591,7 +9640,6 @@ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", "dev": true, - "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -9601,7 +9649,6 @@ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -9611,7 +9658,6 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true, - "peer": true, "engines": { "node": ">=0.3.1" } @@ -9620,15 +9666,13 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true, - "peer": true + "dev": true }, "node_modules/solidity-coverage/node_modules/find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, - "peer": true, "dependencies": { "locate-path": "^3.0.0" }, @@ -9641,7 +9685,6 @@ "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", "dev": true, - "peer": true, "dependencies": { "is-buffer": "~2.0.3" }, @@ -9654,7 +9697,6 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, - "peer": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -9675,7 +9717,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -9685,7 +9726,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, - "peer": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -9703,7 +9743,6 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", "dev": true, - "peer": true, "dependencies": { "@types/glob": "^7.1.1", "array-union": "^2.1.0", @@ -9723,7 +9762,6 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, - "peer": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -9737,7 +9775,6 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, - "peer": true, "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" @@ -9751,7 +9788,6 @@ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", "dev": true, - "peer": true, "dependencies": { "chalk": "^2.4.2" }, @@ -9764,7 +9800,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, - "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -9777,7 +9812,6 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, - "peer": true, "dependencies": { "minimist": "^1.2.5" }, @@ -9790,7 +9824,6 @@ "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.2.tgz", "integrity": "sha512-o96kdRKMKI3E8U0bjnfqW4QMk12MwZ4mhdBTf+B5a1q9+aq2HRnj+3ZdJu0B/ZhJeK78MgYuv6L8d/rA5AeBJA==", "dev": true, - "peer": true, "dependencies": { "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", @@ -9833,15 +9866,13 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/solidity-coverage/node_modules/object.assign": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", "dev": true, - "peer": true, "dependencies": { "define-properties": "^1.1.2", "function-bind": "^1.1.1", @@ -9857,7 +9888,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, - "peer": true, "dependencies": { "p-try": "^2.0.0" }, @@ -9873,7 +9903,6 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, - "peer": true, "dependencies": { "p-limit": "^2.0.0" }, @@ -9886,7 +9915,6 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -9896,7 +9924,6 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", "dev": true, - "peer": true, "dependencies": { "picomatch": "^2.0.4" }, @@ -9909,7 +9936,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, - "peer": true, "dependencies": { "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", @@ -9924,7 +9950,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, - "peer": true, "dependencies": { "ansi-regex": "^4.1.0" }, @@ -9937,7 +9962,6 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -9947,7 +9971,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", "dev": true, - "peer": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -9960,7 +9983,6 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, - "peer": true, "dependencies": { "isexe": "^2.0.0" }, @@ -9973,7 +9995,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, - "peer": true, "dependencies": { "ansi-styles": "^3.2.0", "string-width": "^3.0.0", @@ -9987,15 +10008,13 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/solidity-coverage/node_modules/yargs": { "version": "13.3.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "dev": true, - "peer": true, "dependencies": { "cliui": "^5.0.0", "find-up": "^3.0.0", @@ -10014,7 +10033,6 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, - "peer": true, "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -10025,7 +10043,6 @@ "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", "dev": true, - "peer": true, "dependencies": { "flat": "^4.1.0", "lodash": "^4.17.15", @@ -10041,7 +10058,6 @@ "integrity": "sha512-CBdZ2oa/BHhS4xj5DlhjWNHcan57/5YuvfdLf17iVmIpd9KRm+DFLmC6nBNj+6Ua7Kt3TmOjDpQT1aTYOQtoUA==", "dev": true, "optional": true, - "peer": true, "dependencies": { "amdefine": ">=0.0.4" }, @@ -10181,7 +10197,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, - "peer": true, "dependencies": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -10195,7 +10210,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true, - "peer": true, "engines": { "node": ">=4" } @@ -10205,7 +10219,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", "dev": true, - "peer": true, "dependencies": { "ansi-regex": "^3.0.0" }, @@ -10213,6 +10226,23 @@ "node": ">=4" } }, + "node_modules/string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/string.prototype.trimend": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", @@ -10690,13 +10720,13 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } @@ -10842,6 +10872,57 @@ "node": ">=10" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typed-array-length": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", @@ -10864,16 +10945,16 @@ "peer": true }, "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=14.17" } }, "node_modules/typical": { @@ -10892,7 +10973,6 @@ "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", "dev": true, "optional": true, - "peer": true, "bin": { "uglifyjs": "bin/uglifyjs" }, @@ -11070,21 +11150,19 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", - "dev": true, - "peer": true + "dev": true }, "node_modules/which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -11098,7 +11176,6 @@ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, - "peer": true, "dependencies": { "string-width": "^1.0.2 || 2" } @@ -11116,8 +11193,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true, - "peer": true + "dev": true }, "node_modules/wordwrapjs": { "version": "4.0.1", @@ -11460,9 +11536,9 @@ } }, "@defi-wonderland/smock": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/@defi-wonderland/smock/-/smock-2.3.4.tgz", - "integrity": "sha512-VYJbsoCOdFRyGkAwvaQhQRrU6V8AjK3five8xdbo41DEE9n3qXzUNBUxyD9HhXB/dWWPFWT21IGw5Ztl6Qw3Ew==", + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@defi-wonderland/smock/-/smock-2.3.5.tgz", + "integrity": "sha512-klANj1hUpc3cd2ShXdVH/bEGwxJd+LxOngkF5gLcIbg6b37RCgMPMmR/94/hgL62F8bfWtuNKsQD7K+c6M5fWQ==", "dev": true, "requires": { "@nomicfoundation/ethereumjs-evm": "^1.0.0-rc.3", @@ -12302,19 +12378,19 @@ } }, "@openzeppelin/contracts": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.8.3.tgz", - "integrity": "sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg==" + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", + "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==" }, "@openzeppelin/contracts-upgradeable": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz", - "integrity": "sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg==" + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.3.tgz", + "integrity": "sha512-jjaHAVRMrE4UuZNfDwjlLGDxTHWIOwTJS2ldnc278a0gevfXfPr8hxKEVBGFBE96kl2G3VHDZhUimw/+G3TG2A==" }, "@openzeppelin/hardhat-upgrades": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.26.0.tgz", - "integrity": "sha512-ggCvdIf7A9QcMedCaswecgt3N7hacx3qYOn+4bNPqMAwslo/SJ9vN4AhV0VWkDcY4CqFFou3RFQmDWNeLMBX9A==", + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.27.0.tgz", + "integrity": "sha512-+OwrHWDz9tzpmBev6t2CtZM2tRpy/ybhg5e3GIgyeqTxK2vUV40dxIxO6lie+qKeJHZ2RIdDwvSTSiCEJif+fA==", "dev": true, "requires": { "@openzeppelin/upgrades-core": "^1.26.2", @@ -12651,9 +12727,9 @@ } }, "@types/chai": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", - "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-VOVRLM1mBxIRxydiViqPcKn6MIxZytrbMpd6RJLIWKxUNr3zux8no0Oc7kJx0WAPIitgZ0gkrDS+btlqQpubpw==", "dev": true }, "@types/chai-as-promised": { @@ -12691,7 +12767,6 @@ "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", "dev": true, - "peer": true, "requires": { "@types/minimatch": "*", "@types/node": "*" @@ -12718,8 +12793,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "dev": true, - "peer": true + "dev": true }, "@types/mocha": { "version": "10.0.1", @@ -12728,9 +12802,9 @@ "dev": true }, "@types/node": { - "version": "20.1.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.3.tgz", - "integrity": "sha512-NP2yfZpgmf2eDRPmgGq+fjGjSwFgYbihA8/gK+ey23qT9RkxsgNTZvGOEpXgzIGqesTYkElELLgtKoMQTys5vA==" + "version": "20.5.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.9.tgz", + "integrity": "sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ==" }, "@types/pbkdf2": { "version": "3.1.0", @@ -12865,16 +12939,7 @@ "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", "integrity": "sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==", - "dev": true, - "peer": true - }, - "abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "requires": { - "event-target-shim": "^5.0.0" - } + "dev": true }, "abstract-level": { "version": "1.0.3", @@ -12913,8 +12978,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/address/-/address-1.2.2.tgz", "integrity": "sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==", - "dev": true, - "peer": true + "dev": true }, "adm-zip": { "version": "0.4.16", @@ -12986,8 +13050,7 @@ "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "ansi-colors": { "version": "4.1.3", @@ -13065,6 +13128,16 @@ "dev": true, "peer": true }, + "array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + } + }, "array-includes": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", @@ -13091,6 +13164,19 @@ "dev": true, "peer": true }, + "array.prototype.findlastindex": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz", + "integrity": "sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.1.3" + } + }, "array.prototype.flat": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", @@ -13120,7 +13206,6 @@ "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz", "integrity": "sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q==", "dev": true, - "peer": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -13129,6 +13214,20 @@ "is-string": "^1.0.7" } }, + "arraybuffer.prototype.slice": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", + "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + } + }, "asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -13427,6 +13526,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -13859,8 +13959,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", "integrity": "sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==", - "dev": true, - "peer": true + "dev": true }, "debug": { "version": "4.3.4", @@ -13912,9 +14011,9 @@ } }, "define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", "dev": true, "requires": { "has-property-descriptors": "^1.0.0", @@ -13938,7 +14037,6 @@ "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.5.1.tgz", "integrity": "sha512-aBzdj76lueB6uUst5iAs7+0H/oOjqI5D16XUWxlWMIMROhcM0rfsNVk93zTngq1dDNpoXRr++Sus7ETAExppAQ==", "dev": true, - "peer": true, "requires": { "address": "^1.0.1", "debug": "4" @@ -13955,7 +14053,6 @@ "resolved": "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz", "integrity": "sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==", "dev": true, - "peer": true, "requires": { "heap": ">= 0.2.0" } @@ -13979,9 +14076,9 @@ } }, "dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", "dev": true }, "ecc-jsbn": { @@ -14044,18 +14141,19 @@ } }, "es-abstract": { - "version": "1.21.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.1.tgz", - "integrity": "sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", + "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", "dev": true, "requires": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.1", "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.3", + "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", "globalthis": "^1.0.3", "gopd": "^1.0.1", @@ -14063,8 +14161,8 @@ "has-property-descriptors": "^1.0.0", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.4", - "is-array-buffer": "^3.0.1", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", @@ -14072,24 +14170,28 @@ "is-string": "^1.0.7", "is-typed-array": "^1.1.10", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.2", + "object-inspect": "^1.12.3", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", + "regexp.prototype.flags": "^1.5.0", + "safe-array-concat": "^1.0.0", "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", "string.prototype.trimend": "^1.0.6", "string.prototype.trimstart": "^1.0.6", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", "typed-array-length": "^1.0.4", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.10" } }, "es-array-method-boxes-properly": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", - "dev": true, - "peer": true + "dev": true }, "es-set-tostringtag": { "version": "2.0.1", @@ -14137,7 +14239,6 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", "integrity": "sha512-yhi5S+mNTOuRvyW4gWlg5W1byMaQGWWSYHXsuFZ7GBo7tpyOwi2EdzMP/QWxh9hwkD2m+wDVHJsxhRIj+v/b/A==", "dev": true, - "peer": true, "requires": { "esprima": "^2.7.1", "estraverse": "^1.9.1", @@ -14150,22 +14251,19 @@ "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", - "dev": true, - "peer": true + "dev": true }, "estraverse": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", "integrity": "sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA==", - "dev": true, - "peer": true + "dev": true }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dev": true, - "peer": true, "requires": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" @@ -14176,7 +14274,6 @@ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, - "peer": true, "requires": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.6", @@ -14190,15 +14287,13 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "dev": true, - "peer": true + "dev": true }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "dev": true, - "peer": true, "requires": { "prelude-ls": "~1.1.2" } @@ -14334,9 +14429,9 @@ } }, "eslint-config-prettier": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", - "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", "dev": true, "requires": {} }, @@ -14370,9 +14465,9 @@ } }, "eslint-module-utils": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", - "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "requires": { "debug": "^3.2.7" @@ -14417,26 +14512,28 @@ } }, "eslint-plugin-import": { - "version": "2.27.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", - "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "version": "2.28.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz", + "integrity": "sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==", "dev": true, "requires": { "array-includes": "^3.1.6", + "array.prototype.findlastindex": "^1.2.2", "array.prototype.flat": "^1.3.1", "array.prototype.flatmap": "^1.3.1", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.7", - "eslint-module-utils": "^2.7.4", + "eslint-module-utils": "^2.8.0", "has": "^1.0.3", - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "is-glob": "^4.0.3", "minimatch": "^3.1.2", + "object.fromentries": "^2.0.6", + "object.groupby": "^1.0.0", "object.values": "^1.1.6", - "resolve": "^1.22.1", - "semver": "^6.3.0", - "tsconfig-paths": "^3.14.1" + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" }, "dependencies": { "debug": { @@ -14458,9 +14555,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -15235,11 +15332,6 @@ "strip-hex-prefix": "1.0.0" } }, - "event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" - }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -15440,7 +15532,8 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "function.prototype.name": { "version": "1.1.5", @@ -15478,12 +15571,14 @@ "peer": true }, "get-intrinsic": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", - "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" } }, @@ -15519,7 +15614,6 @@ "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==", "dev": true, - "peer": true, "requires": { "chalk": "^2.4.2", "node-emoji": "^1.10.0" @@ -15551,7 +15645,6 @@ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", "dev": true, - "peer": true, "requires": { "global-prefix": "^3.0.0" } @@ -15561,7 +15654,6 @@ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", "dev": true, - "peer": true, "requires": { "ini": "^1.3.5", "kind-of": "^6.0.2", @@ -15573,7 +15665,6 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, - "peer": true, "requires": { "isexe": "^2.0.0" } @@ -15630,15 +15721,13 @@ "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true, - "peer": true + "dev": true }, "handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, - "peer": true, "requires": { "minimist": "^1.2.5", "neo-async": "^2.6.0", @@ -15651,8 +15740,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "peer": true + "dev": true } } }, @@ -15675,27 +15763,26 @@ } }, "hardhat": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.14.0.tgz", - "integrity": "sha512-73jsInY4zZahMSVFurSK+5TNCJTXMv+vemvGia0Ac34Mm19fYp6vEPVGF3sucbumszsYxiTT2TbS8Ii2dsDSoQ==", + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.17.2.tgz", + "integrity": "sha512-oUv40jBeHw0dKpbyQ+iH9cmNMziweLoTW3MnkNxJ2Gc0KGLrQR/1n4vV4xY60zn2LdmRgnwPqy3CgtY0mfwIIA==", "requires": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/ethereumjs-block": "5.0.1", - "@nomicfoundation/ethereumjs-blockchain": "7.0.1", - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-evm": "2.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-statemanager": "2.0.1", - "@nomicfoundation/ethereumjs-trie": "6.0.1", - "@nomicfoundation/ethereumjs-tx": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", - "@nomicfoundation/ethereumjs-vm": "7.0.1", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-blockchain": "7.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-evm": "2.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-statemanager": "2.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "@nomicfoundation/ethereumjs-vm": "7.0.2", "@nomicfoundation/solidity-analyzer": "^0.1.0", "@sentry/node": "^5.18.1", "@types/bn.js": "^5.1.0", "@types/lru-cache": "^5.1.0", - "abort-controller": "^3.0.0", "adm-zip": "^0.4.16", "aggregate-error": "^3.0.0", "ansi-escapes": "^4.3.0", @@ -15718,7 +15805,6 @@ "mnemonist": "^0.38.0", "mocha": "^10.0.0", "p-map": "^4.0.0", - "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", "semver": "^6.3.0", @@ -15740,15 +15826,15 @@ } }, "@nomicfoundation/ethereumjs-block": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.1.tgz", - "integrity": "sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz", + "integrity": "sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==", "requires": { - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-trie": "6.0.1", - "@nomicfoundation/ethereumjs-tx": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "ethereum-cryptography": "0.1.3", "ethers": "^5.7.1" }, @@ -15778,17 +15864,17 @@ } }, "@nomicfoundation/ethereumjs-blockchain": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.1.tgz", - "integrity": "sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz", + "integrity": "sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==", "requires": { - "@nomicfoundation/ethereumjs-block": "5.0.1", - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-ethash": "3.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-trie": "6.0.1", - "@nomicfoundation/ethereumjs-tx": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-ethash": "3.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "abstract-level": "^1.0.3", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", @@ -15822,22 +15908,22 @@ } }, "@nomicfoundation/ethereumjs-common": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.1.tgz", - "integrity": "sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz", + "integrity": "sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==", "requires": { - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.2", "crc-32": "^1.2.0" } }, "@nomicfoundation/ethereumjs-ethash": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.1.tgz", - "integrity": "sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.2.tgz", + "integrity": "sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==", "requires": { - "@nomicfoundation/ethereumjs-block": "5.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "abstract-level": "^1.0.3", "bigint-crypto-utils": "^3.0.23", "ethereum-cryptography": "0.1.3" @@ -15868,14 +15954,14 @@ } }, "@nomicfoundation/ethereumjs-evm": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.1.tgz", - "integrity": "sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz", + "integrity": "sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==", "requires": { "@ethersproject/providers": "^5.7.1", - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-tx": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", "mcl-wasm": "^0.7.1", @@ -15907,17 +15993,17 @@ } }, "@nomicfoundation/ethereumjs-rlp": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.1.tgz", - "integrity": "sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ==" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz", + "integrity": "sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==" }, "@nomicfoundation/ethereumjs-statemanager": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.1.tgz", - "integrity": "sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.2.tgz", + "integrity": "sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==", "requires": { - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", "ethers": "^5.7.1", @@ -15949,12 +16035,12 @@ } }, "@nomicfoundation/ethereumjs-trie": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.1.tgz", - "integrity": "sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz", + "integrity": "sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==", "requires": { - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "@types/readable-stream": "^2.3.13", "ethereum-cryptography": "0.1.3", "readable-stream": "^3.6.0" @@ -15985,15 +16071,15 @@ } }, "@nomicfoundation/ethereumjs-tx": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.1.tgz", - "integrity": "sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz", + "integrity": "sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==", "requires": { "@chainsafe/ssz": "^0.9.2", "@ethersproject/providers": "^5.7.2", - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "ethereum-cryptography": "0.1.3" }, "dependencies": { @@ -16022,12 +16108,12 @@ } }, "@nomicfoundation/ethereumjs-util": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.1.tgz", - "integrity": "sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.2.tgz", + "integrity": "sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==", "requires": { "@chainsafe/ssz": "^0.10.0", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", "ethereum-cryptography": "0.1.3" }, "dependencies": { @@ -16065,19 +16151,19 @@ } }, "@nomicfoundation/ethereumjs-vm": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.1.tgz", - "integrity": "sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz", + "integrity": "sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==", "requires": { - "@nomicfoundation/ethereumjs-block": "5.0.1", - "@nomicfoundation/ethereumjs-blockchain": "7.0.1", - "@nomicfoundation/ethereumjs-common": "4.0.1", - "@nomicfoundation/ethereumjs-evm": "2.0.1", - "@nomicfoundation/ethereumjs-rlp": "5.0.1", - "@nomicfoundation/ethereumjs-statemanager": "2.0.1", - "@nomicfoundation/ethereumjs-trie": "6.0.1", - "@nomicfoundation/ethereumjs-tx": "5.0.1", - "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-blockchain": "7.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-evm": "2.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-statemanager": "2.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", "mcl-wasm": "^0.7.1", @@ -16155,6 +16241,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -16188,7 +16275,8 @@ "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true }, "has-tostringtag": { "version": "1.0.0", @@ -16227,8 +16315,7 @@ "version": "0.2.7", "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==", - "dev": true, - "peer": true + "dev": true }, "hmac-drbg": { "version": "1.0.1", @@ -16374,16 +16461,15 @@ "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true, - "peer": true + "dev": true }, "internal-slot": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz", - "integrity": "sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "requires": { - "get-intrinsic": "^1.1.3", + "get-intrinsic": "^1.2.0", "has": "^1.0.3", "side-channel": "^1.0.4" } @@ -16392,8 +16478,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true, - "peer": true + "dev": true }, "io-ts": { "version": "1.10.4", @@ -16404,13 +16489,13 @@ } }, "is-array-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.1.tgz", - "integrity": "sha512-ASfLknmY8Xa2XtB4wmbz13Wu202baeA18cJBCeCy0wXUHZF0IPyVEXqKEcd+t2fNSLLL1vC6k7lxZEojNbISXQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", "dev": true, "requires": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", + "get-intrinsic": "^1.2.0", "is-typed-array": "^1.1.10" } }, @@ -16459,9 +16544,9 @@ "dev": true }, "is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "requires": { "has": "^1.0.3" @@ -16485,8 +16570,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true, - "peer": true + "dev": true }, "is-glob": { "version": "4.0.3", @@ -16633,9 +16717,9 @@ "dev": true }, "js-sdsl": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", - "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==" + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.2.tgz", + "integrity": "sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==" }, "js-sha3": { "version": "0.8.0", @@ -16718,8 +16802,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", - "dev": true, - "peer": true + "dev": true }, "jsprim": { "version": "1.4.2", @@ -16758,8 +16841,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "peer": true + "dev": true }, "klaw": { "version": "1.3.1", @@ -16944,9 +17026,12 @@ "peer": true }, "mcl-wasm": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-1.0.6.tgz", - "integrity": "sha512-/KYSug255SQoOcrQBxkHeAub9qOcJD3B/n5livcsGKsbv4TOiefNmUAwpMP0Vea5AVBUApolr+iF0GqZixns1w==" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-1.3.0.tgz", + "integrity": "sha512-7nChbr2sBEk9tSp7h8LGJp+bm2UfRzSZCV9LUD00ZPQCynT2W5dPBQcX27Nd++f3zMEl1nrgsT9OdHgxRdu7jw==", + "requires": { + "@types/node": "^20.2.5" + } }, "md5.js": { "version": "1.3.5", @@ -17047,7 +17132,6 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, - "peer": true, "requires": { "minimist": "^1.2.6" } @@ -17220,8 +17304,7 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true, - "peer": true + "dev": true }, "node-addon-api": { "version": "2.0.2", @@ -17233,7 +17316,6 @@ "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", "dev": true, - "peer": true, "requires": { "lodash": "^4.17.21" } @@ -17243,7 +17325,6 @@ "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", "dev": true, - "peer": true, "requires": { "object.getownpropertydescriptors": "^2.0.3", "semver": "^5.7.0" @@ -17253,8 +17334,7 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "peer": true + "dev": true } } }, @@ -17283,7 +17363,6 @@ "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", "dev": true, - "peer": true, "requires": { "abbrev": "1" } @@ -17326,7 +17405,8 @@ "object-inspect": { "version": "1.12.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "dev": true }, "object-keys": { "version": "1.1.1", @@ -17346,12 +17426,22 @@ "object-keys": "^1.1.1" } }, + "object.fromentries": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", + "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, "object.getownpropertydescriptors": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz", "integrity": "sha512-yDNzckpM6ntyQiGTik1fKV1DcVDRS+w8bvpWNCBanvH5LfRX9O8WTHqQzG4RZwRAM4I0oU7TV11Lj5v0g20ibw==", "dev": true, - "peer": true, "requires": { "array.prototype.reduce": "^1.0.5", "call-bind": "^1.0.2", @@ -17359,6 +17449,18 @@ "es-abstract": "^1.20.4" } }, + "object.groupby": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.0.tgz", + "integrity": "sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.21.2", + "get-intrinsic": "^1.2.1" + } + }, "object.values": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", @@ -17528,8 +17630,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true, - "peer": true + "dev": true }, "platform-deploy-client": { "version": "0.6.0", @@ -17652,6 +17753,8 @@ "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "peer": true, "requires": { "side-channel": "^1.0.4" } @@ -17703,7 +17806,6 @@ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", "dev": true, - "peer": true, "requires": { "resolve": "^1.1.6" } @@ -17713,7 +17815,6 @@ "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", "dev": true, - "peer": true, "requires": { "minimatch": "^3.0.5" } @@ -17726,14 +17827,14 @@ "peer": true }, "regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" } }, "regexpp": { @@ -17852,16 +17953,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true, - "peer": true + "dev": true }, "resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.3.tgz", + "integrity": "sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==", "dev": true, "requires": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.12.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -17949,6 +18049,26 @@ } } }, + "safe-array-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", + "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -17975,7 +18095,6 @@ "resolved": "https://registry.npmjs.org/sc-istanbul/-/sc-istanbul-0.4.6.tgz", "integrity": "sha512-qJFF/8tW/zJsbyfh/iT/ZM5QNHE3CXxtLJbZsL+CzdJLBsPD7SedJZoUA4d8iAcN2IoMp/Dx80shOOd2x96X/g==", "dev": true, - "peer": true, "requires": { "abbrev": "1.0.x", "async": "1.x", @@ -17997,22 +18116,19 @@ "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", - "dev": true, - "peer": true + "dev": true }, "esprima": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", - "dev": true, - "peer": true + "dev": true }, "glob": { "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", "dev": true, - "peer": true, "requires": { "inflight": "^1.0.4", "inherits": "2", @@ -18025,22 +18141,19 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", - "dev": true, - "peer": true + "dev": true }, "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", - "dev": true, - "peer": true + "dev": true }, "supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", "dev": true, - "peer": true, "requires": { "has-flag": "^1.0.0" } @@ -18050,7 +18163,6 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, - "peer": true, "requires": { "isexe": "^2.0.0" } @@ -18073,9 +18185,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -18110,8 +18222,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true, - "peer": true + "dev": true }, "setimmediate": { "version": "1.0.5", @@ -18163,7 +18274,6 @@ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, - "peer": true, "requires": { "glob": "^7.0.0", "interpret": "^1.0.0", @@ -18174,6 +18284,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, "requires": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -18287,9 +18398,9 @@ } }, "solhint": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-3.4.1.tgz", - "integrity": "sha512-pzZn2RlZhws1XwvLPVSsxfHrwsteFf5eySOhpAytzXwKQYbTCJV6z8EevYDiSVKMpWrvbKpEtJ055CuEmzp4Xg==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-3.6.2.tgz", + "integrity": "sha512-85EeLbmkcPwD+3JR7aEMKsVC9YrRSxd4qkXuMzrlf7+z2Eqdfm1wHWq1ffTuo5aDhoZxp2I9yF3QkxZOxOL7aQ==", "dev": true, "requires": { "@solidity-parser/parser": "^0.16.0", @@ -18306,7 +18417,7 @@ "lodash": "^4.17.21", "pluralize": "^8.0.0", "prettier": "^2.8.3", - "semver": "^6.3.0", + "semver": "^7.5.2", "strip-ansi": "^6.0.1", "table": "^6.8.1", "text-table": "^0.2.0" @@ -18413,12 +18524,6 @@ "brace-expansion": "^2.0.1" } }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -18443,14 +18548,13 @@ "dev": true }, "solidity-coverage": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.2.tgz", - "integrity": "sha512-cv2bWb7lOXPE9/SSleDO6czkFiMHgP4NXPj+iW9W7iEKLBk7Cj0AGBiNmGX3V1totl9wjPrT0gHmABZKZt65rQ==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.4.tgz", + "integrity": "sha512-xeHOfBOjdMF6hWTbt42iH4x+7j1Atmrf5OldDPMxI+i/COdExUxszOswD9qqvcBTaLGiOrrpnh9UZjSpt4rBsg==", "dev": true, - "peer": true, "requires": { "@ethersproject/abi": "^5.0.9", - "@solidity-parser/parser": "^0.14.1", + "@solidity-parser/parser": "^0.16.0", "chalk": "^2.4.2", "death": "^1.1.0", "detect-port": "^1.3.0", @@ -18471,33 +18575,38 @@ "web3-utils": "^1.3.6" }, "dependencies": { + "@solidity-parser/parser": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.1.tgz", + "integrity": "sha512-PdhRFNhbTtu3x8Axm0uYpqOy/lODYQK+MlYSgqIsq2L8SFYEHJPHNUiOTAJbDGzNjjr1/n9AcIayxafR/fWmYw==", + "dev": true, + "requires": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", - "dev": true, - "peer": true + "dev": true }, "ansi-regex": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "peer": true + "dev": true }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "peer": true + "dev": true }, "chokidar": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", "dev": true, - "peer": true, "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", @@ -18514,7 +18623,6 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, - "peer": true, "requires": { "string-width": "^3.1.0", "strip-ansi": "^5.2.0", @@ -18526,7 +18634,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, - "peer": true, "requires": { "ms": "^2.1.1" } @@ -18535,29 +18642,25 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dev": true, - "peer": true + "dev": true }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true, - "peer": true + "dev": true }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true, - "peer": true + "dev": true }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, - "peer": true, "requires": { "locate-path": "^3.0.0" } @@ -18567,7 +18670,6 @@ "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", "dev": true, - "peer": true, "requires": { "is-buffer": "~2.0.3" } @@ -18577,7 +18679,6 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, - "peer": true, "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -18589,15 +18690,13 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, - "peer": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -18612,7 +18711,6 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", "dev": true, - "peer": true, "requires": { "@types/glob": "^7.1.1", "array-union": "^2.1.0", @@ -18629,7 +18727,6 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, - "peer": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -18640,7 +18737,6 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, - "peer": true, "requires": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" @@ -18651,7 +18747,6 @@ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", "dev": true, - "peer": true, "requires": { "chalk": "^2.4.2" } @@ -18661,7 +18756,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, - "peer": true, "requires": { "brace-expansion": "^1.1.7" } @@ -18671,7 +18765,6 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, - "peer": true, "requires": { "minimist": "^1.2.5" } @@ -18681,7 +18774,6 @@ "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.2.tgz", "integrity": "sha512-o96kdRKMKI3E8U0bjnfqW4QMk12MwZ4mhdBTf+B5a1q9+aq2HRnj+3ZdJu0B/ZhJeK78MgYuv6L8d/rA5AeBJA==", "dev": true, - "peer": true, "requires": { "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", @@ -18713,15 +18805,13 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true, - "peer": true + "dev": true }, "object.assign": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", "dev": true, - "peer": true, "requires": { "define-properties": "^1.1.2", "function-bind": "^1.1.1", @@ -18734,7 +18824,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, - "peer": true, "requires": { "p-try": "^2.0.0" } @@ -18744,7 +18833,6 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, - "peer": true, "requires": { "p-limit": "^2.0.0" } @@ -18753,15 +18841,13 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "peer": true + "dev": true }, "readdirp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", "dev": true, - "peer": true, "requires": { "picomatch": "^2.0.4" } @@ -18771,7 +18857,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, - "peer": true, "requires": { "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", @@ -18783,7 +18868,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, - "peer": true, "requires": { "ansi-regex": "^4.1.0" } @@ -18792,15 +18876,13 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, - "peer": true + "dev": true }, "supports-color": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", "dev": true, - "peer": true, "requires": { "has-flag": "^3.0.0" } @@ -18810,7 +18892,6 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, - "peer": true, "requires": { "isexe": "^2.0.0" } @@ -18820,7 +18901,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, - "peer": true, "requires": { "ansi-styles": "^3.2.0", "string-width": "^3.0.0", @@ -18831,15 +18911,13 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true, - "peer": true + "dev": true }, "yargs": { "version": "13.3.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "dev": true, - "peer": true, "requires": { "cliui": "^5.0.0", "find-up": "^3.0.0", @@ -18858,7 +18936,6 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, - "peer": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -18869,7 +18946,6 @@ "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", "dev": true, - "peer": true, "requires": { "flat": "^4.1.0", "lodash": "^4.17.15", @@ -18884,7 +18960,6 @@ "integrity": "sha512-CBdZ2oa/BHhS4xj5DlhjWNHcan57/5YuvfdLf17iVmIpd9KRm+DFLmC6nBNj+6Ua7Kt3TmOjDpQT1aTYOQtoUA==", "dev": true, "optional": true, - "peer": true, "requires": { "amdefine": ">=0.0.4" } @@ -18995,7 +19070,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, - "peer": true, "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -19005,21 +19079,30 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, - "peer": true + "dev": true }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", "dev": true, - "peer": true, "requires": { "ansi-regex": "^3.0.0" } } } }, + "string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, "string.prototype.trimend": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", @@ -19376,13 +19459,13 @@ } }, "tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", "dev": true, "requires": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } @@ -19491,6 +19574,42 @@ } } }, + "typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + } + }, "typed-array-length": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", @@ -19510,9 +19629,9 @@ "peer": true }, "typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "devOptional": true }, "typical": { @@ -19527,8 +19646,7 @@ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "unbox-primitive": { "version": "1.0.2", @@ -19670,21 +19788,19 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", - "dev": true, - "peer": true + "dev": true }, "which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", "dev": true, "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.0" } }, "wide-align": { @@ -19692,7 +19808,6 @@ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, - "peer": true, "requires": { "string-width": "^1.0.2 || 2" } @@ -19707,8 +19822,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true, - "peer": true + "dev": true }, "wordwrapjs": { "version": "4.0.1", diff --git a/package.json b/package.json index 6eb4f97b..13876f8b 100644 --- a/package.json +++ b/package.json @@ -36,28 +36,28 @@ "husky:pre-commit": "npm run prettier && git add ." }, "dependencies": { - "@openzeppelin/contracts": "^4.8.3", - "@openzeppelin/contracts-upgradeable": "^4.8.3", + "@openzeppelin/contracts": "^4.9.3", + "@openzeppelin/contracts-upgradeable": "^4.9.3", "@primitivefi/hardhat-dodoc": "^0.2.3", - "hardhat": "^2.14.0", + "hardhat": "^2.17.2", "keccak256": "^1.0.6", - "mcl-wasm": "^1.0.2", + "mcl-wasm": "^1.3.0", "merkletreejs": "^0.3.10" }, "devDependencies": { - "@defi-wonderland/smock": "^2.3.4", + "@defi-wonderland/smock": "^2.3.5", "@nomicfoundation/hardhat-toolbox": "^2.0.2", - "@openzeppelin/hardhat-upgrades": "^1.26.0", - "@types/chai": "^4.3.5", + "@openzeppelin/hardhat-upgrades": "^1.27.0", + "@types/chai": "^4.3.6", "@types/mocha": "^10.0.1", - "@types/node": "^20.1.3", + "@types/node": "^20.5.9", "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", - "dotenv": "^16.0.3", + "dotenv": "^16.3.1", "eslint": "^7.32.0", - "eslint-config-prettier": "^8.8.0", + "eslint-config-prettier": "^9.0.0", "eslint-config-standard": "^16.0.3", - "eslint-plugin-import": "^2.27.4", + "eslint-plugin-import": "^2.28.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-promise": "^5.2.0", @@ -65,8 +65,9 @@ "husky": "^8.0.3", "prettier": "^2.8.8", "prettier-plugin-solidity": "^1.1.3", - "solhint": "^3.4.1", + "solhint": "^3.6.2", + "solidity-coverage": "^0.8.4", "ts-node": "^10.7.0", - "typescript": "^5.0.4" + "typescript": "^5.1.6" } } diff --git a/scripts/maintenance/checkModifiedOpenZeppelinContracts.js b/scripts/maintenance/checkModifiedOpenZeppelinContracts.js new file mode 100644 index 00000000..2294d8f9 --- /dev/null +++ b/scripts/maintenance/checkModifiedOpenZeppelinContracts.js @@ -0,0 +1,57 @@ +// This script checks that the modified OpenZeppelin contracts are up-to-date with the dependencies. +// Used in `Harfork.t.sol` and `ci.yml`. + +const fs = require("fs"); +const path = require("path"); + +const baseDir = path.join(__dirname, "../../contracts/child/validator/legacy-compat/@openzeppelin"); +const secondLineComparisonDir = path.join(__dirname, "../../node_modules/@openzeppelin"); + +function readSecondLine(filePath) { + const data = fs.readFileSync(filePath, "utf-8"); + const lines = data.trim().split("\n"); + if (lines.length >= 2) { + return lines[1]; + } + return null; +} + +function compareSecondLines(file1, file2) { + const secondLine1 = readSecondLine(file1); + const secondLine2 = readSecondLine(file2); + return secondLine1 === secondLine2; +} + +function processDirectory(directoryPath) { + const files = fs.readdirSync(directoryPath); + + const nonMatchingFiles = []; + + files.forEach((file) => { + const filePath1 = path.join(directoryPath, file); + const filePath2 = path.join(secondLineComparisonDir, path.relative(baseDir, directoryPath), file); + + const stats = fs.statSync(filePath1); + if (stats.isDirectory()) { + nonMatchingFiles.push(...processDirectory(filePath1)); + } else { + if (path.extname(file) === ".sol" && (!fs.existsSync(filePath2) || !compareSecondLines(filePath1, filePath2))) { + nonMatchingFiles.push({ file }); + } + } + }); + + return nonMatchingFiles; +} + +const nonMatchingFiles = processDirectory(baseDir); + +if (nonMatchingFiles.length === 0) { + console.log("All modified OpenZeppelin contracts up-to-date."); +} else { + console.log("Outdated modified OpenZeppelin contracts found:"); + nonMatchingFiles.forEach(({ file }) => { + console.log(`- ${file}`); + }); + throw new Error(); +} diff --git a/slither.config.json b/slither.config.json index af2f60c6..4cc0dc7c 100644 --- a/slither.config.json +++ b/slither.config.json @@ -1,4 +1,4 @@ { "detectors_to_exclude": "solc-version", - "filter_paths": "BLS.sol|ModExp.sol|node_modules|mocks" + "filter_paths": "BLS.sol|ModExp.sol|node_modules|mocks|legacy-compat" } diff --git a/test/child/ChildERC20Predicate.test.ts b/test/child/ChildERC20Predicate.test.ts index 22cd4565..9961cd1b 100644 --- a/test/child/ChildERC20Predicate.test.ts +++ b/test/child/ChildERC20Predicate.test.ts @@ -126,8 +126,8 @@ describe("ChildERC20Predicate", () => { const systemNativeERC20: NativeERC20 = nativeERC20.connect( await ethers.getSigner("0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE") ); - await expect(systemNativeERC20.initialize(childERC20Predicate.address, nativeERC20RootToken, "TEST", "TEST", 18)).to - .not.be.reverted; + await expect(systemNativeERC20.initialize(childERC20Predicate.address, nativeERC20RootToken, "TEST", "TEST", 18, 0)) + .to.not.be.reverted; expect(await childERC20Predicate.l2StateSender()).to.equal(l2StateSender.address); expect(await childERC20Predicate.stateReceiver()).to.equal(stateReceiver.address); expect(await childERC20Predicate.rootERC20Predicate()).to.equal(rootERC20Predicate); diff --git a/test/child/EIP1559Burn.test.ts b/test/child/EIP1559Burn.test.ts index 0065c7c9..56347e43 100644 --- a/test/child/EIP1559Burn.test.ts +++ b/test/child/EIP1559Burn.test.ts @@ -134,8 +134,8 @@ describe("EIP1559Burn", () => { const systemNativeERC20: NativeERC20 = nativeERC20.connect( await ethers.getSigner("0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE") ); - await expect(systemNativeERC20.initialize(childERC20Predicate.address, nativeERC20RootToken, "TEST", "TEST", 18)).to - .not.be.reverted; + await expect(systemNativeERC20.initialize(childERC20Predicate.address, nativeERC20RootToken, "TEST", "TEST", 18, 0)) + .to.not.be.reverted; const randomAmount = Math.floor(Math.random() * 1000000 + 1); totalSupply += randomAmount; const stateSyncData = ethers.utils.defaultAbiCoder.encode( diff --git a/test/child/ForkParams.test.ts b/test/child/ForkParams.test.ts index 503d19f8..86948b00 100644 --- a/test/child/ForkParams.test.ts +++ b/test/child/ForkParams.test.ts @@ -10,15 +10,22 @@ describe("ForkParams", () => { before(async () => { accounts = await ethers.getSigners(); const forkParamsFactory = await ethers.getContractFactory("ForkParams"); - forkParams = (await forkParamsFactory.deploy(accounts[0].address)) as ForkParams; + forkParams = (await forkParamsFactory.deploy()) as ForkParams; await forkParams.deployed(); + await forkParams.initialize(accounts[0].address); }); it("validate deployment", async () => { expect(await forkParams.owner()).to.equal(accounts[0].address); }); + it("should throw error on reinitialization", async () => { + await expect(forkParams.initialize(accounts[1].address)).to.be.revertedWith( + "Initializable: contract is already initialized" + ); + }); + it("add new feature from wrong account", async () => { await impersonateAccount(accounts[1].address); const newForkParams = forkParams.connect(accounts[1]); diff --git a/test/child/NativeERC20.test.ts b/test/child/NativeERC20.test.ts index 46521020..39273fc1 100644 --- a/test/child/NativeERC20.test.ts +++ b/test/child/NativeERC20.test.ts @@ -73,7 +73,7 @@ describe("NativeERC20", () => { await ethers.getSigner("0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE") ); await expect( - systemNativeERC20.initialize(childERC20Predicate.address, ethers.constants.AddressZero, "TEST", "TEST", 18) + systemNativeERC20.initialize(childERC20Predicate.address, ethers.constants.AddressZero, "TEST", "TEST", 18, 0) ).to.not.be.reverted; expect(await nativeERC20.name()).to.equal("TEST"); expect(await nativeERC20.symbol()).to.equal("TEST"); @@ -85,7 +85,7 @@ describe("NativeERC20", () => { it("reinitialization fail", async () => { await expect( - nativeERC20.initialize(ethers.constants.AddressZero, ethers.constants.AddressZero, "", "", 0) + nativeERC20.initialize(ethers.constants.AddressZero, ethers.constants.AddressZero, "", "", 0, 0) ).to.be.revertedWith("Initializable: contract is already initialized"); }); diff --git a/test/child/NativeERC20Mintable.test.ts b/test/child/NativeERC20Mintable.test.ts index 0b43c881..3877b128 100644 --- a/test/child/NativeERC20Mintable.test.ts +++ b/test/child/NativeERC20Mintable.test.ts @@ -80,7 +80,8 @@ describe("NativeERC20Mintable", () => { ethers.constants.AddressZero, "TEST", "TEST", - 18 + 18, + 0 ) ) .to.be.revertedWithCustomError(nativeERC20, "Unauthorized") @@ -95,7 +96,8 @@ describe("NativeERC20Mintable", () => { ethers.constants.AddressZero, "TEST", "TEST", - 18 + 18, + 0 ) ) .to.be.revertedWithCustomError(nativeERC20, "Unauthorized") @@ -110,7 +112,8 @@ describe("NativeERC20Mintable", () => { ethers.constants.AddressZero, "TEST", "TEST", - 18 + 18, + 0 ) ).to.be.revertedWith("NativeERC20: Invalid owner address"); }); @@ -123,7 +126,8 @@ describe("NativeERC20Mintable", () => { ethers.constants.AddressZero, "TEST", "TEST", - 18 + 18, + 0 ) ).to.not.be.reverted; expect(await nativeERC20.name()).to.equal("TEST"); @@ -143,6 +147,7 @@ describe("NativeERC20Mintable", () => { ethers.constants.AddressZero, "", "", + 0, 0 ) ).to.be.revertedWith("Initializable: contract is already initialized"); diff --git a/test/child/NetworkParams.test.ts b/test/child/NetworkParams.test.ts index d050ec18..13fcf937 100644 --- a/test/child/NetworkParams.test.ts +++ b/test/child/NetworkParams.test.ts @@ -6,87 +6,184 @@ import { ethers } from "hardhat"; import { NetworkParams } from "../../typechain-types"; describe("NetworkParams", () => { - let networkParams: NetworkParams, - accounts: SignerWithAddress[], - blockGasLimit: number, - checkpointBlockInterval: number, - minStake: BigNumber, - maxValidatorSetSize: number; + let initParams: NetworkParams.InitParamsStruct; + let networkParams: NetworkParams, accounts: SignerWithAddress[]; before(async () => { accounts = await ethers.getSigners(); + + initParams = { + newOwner: ethers.constants.AddressZero, + newCheckpointBlockInterval: 0, + newEpochSize: 0, + newEpochReward: 0, + newSprintSize: 0, + newMinValidatorSetSize: 0, + newMaxValidatorSetSize: 0, + newWithdrawalWaitPeriod: 0, + newBlockTime: 0, + newBlockTimeDrift: 0, + newVotingDelay: 0, + newVotingPeriod: 0, + newProposalThreshold: 0, + newBaseFeeChangeDenom: 0, + }; }); - it("fail deployment, invalid input", async () => { + it("fail initialization, invalid input", async () => { const networkParamsFactory = await ethers.getContractFactory("NetworkParams"); - await expect(networkParamsFactory.deploy(accounts[0].address, 0, 0, 0, 0)).to.be.revertedWith( - "NetworkParams: INVALID_INPUT" + networkParams = (await networkParamsFactory.deploy()) as NetworkParams; + await networkParams.deployed(); + await expect(networkParams.initialize(initParams)).to.be.revertedWith("NetworkParams: INVALID_INPUT"); + }); + + it("initialization success", async () => { + initParams.newOwner = accounts[0].address; + initParams.newCheckpointBlockInterval = 2 ** Math.floor(Math.random() * 5 + 10); + initParams.newEpochSize = 2 ** Math.floor(Math.random() * 5 + 10); + initParams.newEpochReward = ethers.utils.parseUnits(String(Math.floor(Math.random() * 20 + 1))); + initParams.newSprintSize = 2 ** Math.floor(Math.random() * 5 + 10); + initParams.newMinValidatorSetSize = Math.floor(Math.random() * 20 + 5); + initParams.newMaxValidatorSetSize = Math.floor(Math.random() * 20 + 5); + initParams.newWithdrawalWaitPeriod = 2 ** Math.floor(Math.random() * 5 + 10); + initParams.newBlockTime = 2 ** Math.floor(Math.random() * 5 + 10); + initParams.newBlockTimeDrift = 2 ** Math.floor(Math.random() * 5 + 10); + initParams.newVotingDelay = 2 ** Math.floor(Math.random() * 5 + 10); + initParams.newVotingPeriod = 2 ** Math.floor(Math.random() * 5 + 10); + initParams.newProposalThreshold = Math.floor(Math.random() * 100 + 1); + initParams.newBaseFeeChangeDenom = ethers.utils.parseUnits(String(Math.floor(Math.random() * 20 + 1))); + + await networkParams.initialize(initParams); + + expect(await networkParams.owner()).to.equal(initParams.newOwner); + expect(await networkParams.checkpointBlockInterval()).to.equal(initParams.newCheckpointBlockInterval); + expect(await networkParams.epochSize()).to.equal(initParams.newEpochSize); + expect(await networkParams.epochReward()).to.equal(initParams.newEpochReward); + expect(await networkParams.sprintSize()).to.equal(initParams.newSprintSize); + expect(await networkParams.minValidatorSetSize()).to.equal(initParams.newMinValidatorSetSize); + expect(await networkParams.maxValidatorSetSize()).to.equal(initParams.newMaxValidatorSetSize); + expect(await networkParams.withdrawalWaitPeriod()).to.equal(initParams.newWithdrawalWaitPeriod); + expect(await networkParams.blockTime()).to.equal(initParams.newBlockTime); + expect(await networkParams.blockTimeDrift()).to.equal(initParams.newBlockTimeDrift); + expect(await networkParams.votingDelay()).to.equal(initParams.newVotingDelay); + expect(await networkParams.votingPeriod()).to.equal(initParams.newVotingPeriod); + expect(await networkParams.proposalThreshold()).to.equal(initParams.newProposalThreshold); + expect(await networkParams.baseFeeChangeDenom()).to.equal(initParams.newBaseFeeChangeDenom); + }); + + it("should throw error on reinitialization", async () => { + await expect(networkParams.initialize(initParams)).to.be.revertedWith( + "Initializable: contract is already initialized" ); }); - it("deployment success", async () => { - const networkParamsFactory = await ethers.getContractFactory("NetworkParams"); - blockGasLimit = 10 ** Math.floor(Math.random() + 6); - checkpointBlockInterval = 2 ** Math.floor(Math.random() * 5 + 10); - minStake = ethers.utils.parseUnits(String(Math.floor(Math.random() * 20 + 1))); - maxValidatorSetSize = Math.floor(Math.random() * 20 + 5); - networkParams = (await networkParamsFactory.deploy( - accounts[0].address, - blockGasLimit, - checkpointBlockInterval, - minStake, - maxValidatorSetSize - )) as NetworkParams; + it("set new checkpoint block interval fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); - await networkParams.deployed(); + await expect(newNetworkParams.setNewCheckpointBlockInterval(1)).to.be.revertedWith( + "Ownable: caller is not the owner" + ); + await stopImpersonatingAccount(accounts[1].address); + }); + + it("set new checkpoint block interval fail: invalid input", async () => { + await expect(networkParams.setNewCheckpointBlockInterval(0)).to.be.revertedWith( + "NetworkParams: INVALID_CHECKPOINT_INTERVAL" + ); + }); - expect(await networkParams.blockGasLimit()).to.equal(blockGasLimit); - expect(await networkParams.checkpointBlockInterval()).to.equal(checkpointBlockInterval); - expect(await networkParams.minStake()).to.equal(minStake); - expect(await networkParams.maxValidatorSetSize()).to.equal(maxValidatorSetSize); + it("set new checkpoint block interval success", async () => { + initParams.newCheckpointBlockInterval = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewCheckpointBlockInterval(initParams.newCheckpointBlockInterval); + + expect(await networkParams.checkpointBlockInterval()).to.equal(initParams.newCheckpointBlockInterval); }); - it("set new block gas limit fail: only owner", async () => { + it("set new epoch size fail: only owner", async () => { await impersonateAccount(accounts[1].address); await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); const newNetworkParams = networkParams.connect(accounts[1]); - await expect(newNetworkParams.setNewBlockGasLimit(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await expect(newNetworkParams.setNewEpochSize(1)).to.be.revertedWith("Ownable: caller is not the owner"); await stopImpersonatingAccount(accounts[1].address); }); - it("set new block gas limit fail: invalid input", async () => { - await expect(networkParams.setNewBlockGasLimit(0)).to.be.revertedWith("NetworkParams: INVALID_BLOCK_GAS_LIMIT"); + it("set new epoch size fail: invalid input", async () => { + await expect(networkParams.setNewEpochSize(0)).to.be.revertedWith("NetworkParams: INVALID_EPOCH_SIZE"); }); - it("set new block gas limit success", async () => { - blockGasLimit = 10 ** Math.floor(Math.random() + 6); - await networkParams.setNewBlockGasLimit(blockGasLimit); + it("set new epoch size success", async () => { + initParams.newEpochSize = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewEpochSize(initParams.newEpochSize); - expect(await networkParams.blockGasLimit()).to.equal(blockGasLimit); + expect(await networkParams.epochSize()).to.equal(initParams.newEpochSize); }); - it("set new checkpoint block interval fail: invalid input", async () => { - await expect(networkParams.setNewCheckpointBlockInterval(0)).to.be.revertedWith( - "NetworkParams: INVALID_CHECKPOINT_INTERVAL" - ); + it("set new epoch reward fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + + await expect(newNetworkParams.setNewEpochReward(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); }); - it("set new checkpoint block interval success", async () => { - checkpointBlockInterval = 2 ** Math.floor(Math.random() * 5 + 10); - await networkParams.setNewCheckpointBlockInterval(checkpointBlockInterval); + it("set new epoch reward success", async () => { + initParams.newEpochReward = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewEpochReward(initParams.newEpochReward); - expect(await networkParams.checkpointBlockInterval()).to.equal(checkpointBlockInterval); + expect(await networkParams.epochReward()).to.equal(initParams.newEpochReward); }); - it("set new min stake fail: invalid input", async () => { - await expect(networkParams.setNewMinStake(0)).to.be.revertedWith("NetworkParams: INVALID_MIN_STAKE"); + it("set new sprint size fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + await expect(newNetworkParams.setNewSprintSize(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); + }); + + it("set new sprint size fail: invalid input", async () => { + await expect(networkParams.setNewSprintSize(0)).to.be.revertedWith("NetworkParams: INVALID_SPRINT_SIZE"); + }); + + it("set new sprint size success", async () => { + initParams.newSprintSize = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewSprintSize(initParams.newSprintSize); + + expect(await networkParams.sprintSize()).to.equal(initParams.newSprintSize); + }); + + it("set new min validator set size fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + + await expect(newNetworkParams.setNewMinValidatorSetSize(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); }); - it("set new min stake success", async () => { - minStake = ethers.utils.parseUnits(String(Math.floor(Math.random() * 20 + 1))); - await networkParams.setNewMinStake(minStake); + it("set new min validator set size fail: invalid input", async () => { + await expect(networkParams.setNewMinValidatorSetSize(0)).to.be.revertedWith( + "NetworkParams: INVALID_MIN_VALIDATOR_SET_SIZE" + ); + }); - expect(await networkParams.minStake()).to.equal(minStake); + it("set new min validator set size success", async () => { + initParams.newMinValidatorSetSize = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewMinValidatorSetSize(initParams.newMinValidatorSetSize); + + expect(await networkParams.minValidatorSetSize()).to.equal(initParams.newMinValidatorSetSize); + }); + + it("set new max validator set size fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + + await expect(newNetworkParams.setNewMaxValidatorSetSize(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); }); it("set new max validator set size fail: invalid input", async () => { @@ -96,9 +193,145 @@ describe("NetworkParams", () => { }); it("set new max validator set size success", async () => { - maxValidatorSetSize = Math.floor(Math.random() * 20 + 5); - await networkParams.setNewMaxValidatorSetSize(maxValidatorSetSize); + initParams.newMaxValidatorSetSize = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewMaxValidatorSetSize(initParams.newMaxValidatorSetSize); + + expect(await networkParams.maxValidatorSetSize()).to.equal(initParams.newMaxValidatorSetSize); + }); + + it("set new withdrawal wait period fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + + await expect(newNetworkParams.setNewWithdrawalWaitPeriod(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); + }); + + it("set new withdrawal wait period fail: invalid input", async () => { + await expect(networkParams.setNewWithdrawalWaitPeriod(0)).to.be.revertedWith( + "NetworkParams: INVALID_WITHDRAWAL_WAIT_PERIOD" + ); + }); + + it("set new withdrawal wait period success", async () => { + initParams.newWithdrawalWaitPeriod = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewWithdrawalWaitPeriod(initParams.newWithdrawalWaitPeriod); + + expect(await networkParams.withdrawalWaitPeriod()).to.equal(initParams.newWithdrawalWaitPeriod); + }); + + it("set new block time fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + + await expect(newNetworkParams.setNewBlockTime(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); + }); + + it("set new block time fail: invalid input", async () => { + await expect(networkParams.setNewBlockTime(0)).to.be.revertedWith("NetworkParams: INVALID_BLOCK_TIME"); + }); + + it("set new block time success", async () => { + initParams.newBlockTime = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewBlockTime(initParams.newBlockTime); + + expect(await networkParams.blockTime()).to.equal(initParams.newBlockTime); + }); + + it("set new block time drift fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + + await expect(newNetworkParams.setNewBlockTimeDrift(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); + }); + + it("set new block time drift fail: invalid input", async () => { + await expect(networkParams.setNewBlockTimeDrift(0)).to.be.revertedWith("NetworkParams: INVALID_BLOCK_TIME_DRIFT"); + }); + + it("set new block time drift success", async () => { + initParams.newBlockTimeDrift = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewBlockTimeDrift(initParams.newBlockTimeDrift); + + expect(await networkParams.blockTimeDrift()).to.equal(initParams.newBlockTimeDrift); + }); + + it("set new voting delay fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + + await expect(newNetworkParams.setNewVotingDelay(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); + }); + + it("set new voting delay success", async () => { + initParams.newVotingDelay = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewVotingDelay(initParams.newVotingDelay); + + expect(await networkParams.votingDelay()).to.equal(initParams.newVotingDelay); + }); + + it("set new voting period fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + + await expect(newNetworkParams.setNewVotingPeriod(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); + }); + + it("set new voting period fail: invalid input", async () => { + await expect(networkParams.setNewVotingPeriod(0)).to.be.revertedWith("NetworkParams: INVALID_VOTING_PERIOD"); + }); + + it("set new voting period success", async () => { + initParams.newVotingPeriod = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewVotingPeriod(initParams.newVotingPeriod); + + expect(await networkParams.votingPeriod()).to.equal(initParams.newVotingPeriod); + }); + + it("set new proposal threshold fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + + await expect(newNetworkParams.setNewProposalThreshold(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); + }); + + it("set new proposal threshold success", async () => { + initParams.newProposalThreshold = 10 ** Math.floor(Math.random() + 6); + await networkParams.setNewProposalThreshold(initParams.newProposalThreshold); + + expect(await networkParams.proposalThreshold()).to.equal(initParams.newProposalThreshold); + }); + + it("set new base fee change denom fail: only owner", async () => { + await impersonateAccount(accounts[1].address); + await setBalance(accounts[1].address, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + const newNetworkParams = networkParams.connect(accounts[1]); + + await expect(newNetworkParams.setNewBaseFeeChangeDenom(1)).to.be.revertedWith("Ownable: caller is not the owner"); + await stopImpersonatingAccount(accounts[1].address); + }); + + it("set new base fee change denom fail: invalid input", async () => { + await expect(networkParams.setNewBaseFeeChangeDenom(0)).to.be.revertedWith( + "NetworkParams: INVALID_BASE_FEE_CHANGE_DENOM" + ); + }); + + it("set new base fee change denom success", async () => { + initParams.newBaseFeeChangeDenom = ethers.utils.parseUnits(String(Math.floor(Math.random() * 20 + 11))); + await networkParams.setNewBaseFeeChangeDenom(initParams.newBaseFeeChangeDenom); - expect(await networkParams.maxValidatorSetSize()).to.equal(maxValidatorSetSize); + expect(await networkParams.baseFeeChangeDenom()).to.equal(initParams.newBaseFeeChangeDenom); }); }); diff --git a/test/forge/child/ChildERC1155Predicate.sol b/test/forge/child/ChildERC1155Predicate.sol deleted file mode 100644 index e69de29b..00000000 diff --git a/test/forge/child/ChildERC721Predicate.t.sol b/test/forge/child/ChildERC721Predicate.t.sol deleted file mode 100644 index e69de29b..00000000 diff --git a/test/forge/child/StateReceiver.t.sol b/test/forge/child/StateReceiver.t.sol index 63070b41..9b5e9eb2 100644 --- a/test/forge/child/StateReceiver.t.sol +++ b/test/forge/child/StateReceiver.t.sol @@ -154,7 +154,7 @@ abstract contract NonEmptyState is EmptyState, MurkyBase { contract StateReceiverTest_NonEmptyState is NonEmptyState { function testCannotExecute_InvalidProof() public { - vm.expectRevert("INVALID_PROOF_LENGTH"); + vm.expectRevert("INVALID_PROOF"); stateReceiver.execute(proof, stateSyncs[0]); } diff --git a/test/forge/child/validator/RewardPool.t.sol b/test/forge/child/validator/RewardPool.t.sol index 3bbd4ef4..9f51eac4 100644 --- a/test/forge/child/validator/RewardPool.t.sol +++ b/test/forge/child/validator/RewardPool.t.sol @@ -7,6 +7,8 @@ import {ValidatorSet, ValidatorInit, Epoch} from "contracts/child/validator/Vali import {RewardPool, IRewardPool, Uptime} from "contracts/child/validator/RewardPool.sol"; import "contracts/interfaces/Errors.sol"; +import {NetworkParams} from "contracts/child/NetworkParams.sol"; + abstract contract Uninitialized is Test { address public constant SYSTEM = 0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE; @@ -15,18 +17,24 @@ abstract contract Uninitialized is Test { RewardPool pool; address rewardWallet = makeAddr("rewardWallet"); address alice = makeAddr("alice"); - uint256 baseReward = 1 ether; + uint256 epochSize = 64; + + NetworkParams networkParams; function setUp() public virtual { + networkParams = new NetworkParams(); + networkParams.initialize(NetworkParams.InitParams(address(1), 1, 64, 1 ether, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)); + token = new MockERC20(); validatorSet = new ValidatorSet(); ValidatorInit[] memory init = new ValidatorInit[](2); init[0] = ValidatorInit({addr: address(this), stake: 300}); init[1] = ValidatorInit({addr: alice, stake: 100}); - validatorSet.initialize(address(1), address(1), address(1), 64, init); + validatorSet.initialize(address(1), address(1), address(1), address(networkParams), init); Epoch memory epoch = Epoch({startBlock: 1, endBlock: 64, epochRoot: bytes32(0)}); vm.prank(SYSTEM); - validatorSet.commitEpoch(1, epoch); + validatorSet.commitEpoch(1, epoch, epochSize); + vm.roll(block.number + 1); pool = new RewardPool(); token.mint(rewardWallet, 1000 ether); vm.prank(rewardWallet); @@ -37,7 +45,7 @@ abstract contract Uninitialized is Test { abstract contract Initialized is Uninitialized { function setUp() public virtual override { super.setUp(); - pool.initialize(address(token), rewardWallet, address(validatorSet), baseReward); + pool.initialize(address(token), rewardWallet, address(validatorSet), address(networkParams)); } } @@ -48,17 +56,16 @@ abstract contract Distributed is Initialized { uptime[0] = Uptime({validator: address(this), signedBlocks: 64}); uptime[1] = Uptime({validator: alice, signedBlocks: 64}); vm.prank(SYSTEM); - pool.distributeRewardFor(1, uptime); + pool.distributeRewardFor(1, uptime, epochSize); } } contract RewardPool_Initialize is Uninitialized { function test_Initialize() public { - pool.initialize(address(token), rewardWallet, address(validatorSet), baseReward); + pool.initialize(address(token), rewardWallet, address(validatorSet), address(networkParams)); assertEq(address(pool.rewardToken()), address(token)); assertEq(pool.rewardWallet(), rewardWallet); assertEq(address(pool.validatorSet()), address(validatorSet)); - assertEq(pool.baseReward(), baseReward); } } @@ -67,21 +74,21 @@ contract RewardPool_Distribute is Initialized { function test_RevertOnlySystem() public { vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, "SYSTEMCALL")); - pool.distributeRewardFor(1, new Uptime[](0)); + pool.distributeRewardFor(1, new Uptime[](0), epochSize); } function test_RevertGenesisEpoch() public { Uptime[] memory uptime = new Uptime[](0); vm.expectRevert("EPOCH_NOT_COMMITTED"); vm.prank(SYSTEM); - pool.distributeRewardFor(0, uptime); + pool.distributeRewardFor(0, uptime, epochSize); } function test_RevertFutureEpoch() public { Uptime[] memory uptime = new Uptime[](0); vm.expectRevert("EPOCH_NOT_COMMITTED"); vm.prank(SYSTEM); - pool.distributeRewardFor(2, uptime); + pool.distributeRewardFor(2, uptime, epochSize); } function test_RevertSignedBlocksExceedsTotalBlocks() public { @@ -89,20 +96,23 @@ contract RewardPool_Distribute is Initialized { uptime[0] = Uptime({validator: address(this), signedBlocks: 65}); vm.prank(SYSTEM); vm.expectRevert("SIGNED_BLOCKS_EXCEEDS_TOTAL"); - pool.distributeRewardFor(1, uptime); + pool.distributeRewardFor(1, uptime, epochSize); } - function test_DistributeRewards() public { + function test_DistributeRewards(uint256 epochReward) public { + vm.assume(epochReward <= pool.rewardToken().balanceOf(rewardWallet)); + vm.mockCall(address(networkParams), abi.encodeCall(networkParams.epochReward, ()), abi.encode(epochReward)); + Uptime[] memory uptime = new Uptime[](2); uptime[0] = Uptime({validator: address(this), signedBlocks: 60}); uptime[1] = Uptime({validator: alice, signedBlocks: 50}); - uint256 reward1 = (baseReward * 3 * 60) / (4 * 64); - uint256 reward2 = (baseReward * 1 * 50) / (4 * 64); + uint256 reward1 = (networkParams.epochReward() * 3 * 60) / (4 * 64); + uint256 reward2 = (networkParams.epochReward() * 1 * 50) / (4 * 64); uint256 totalReward = reward1 + reward2; vm.prank(SYSTEM); vm.expectEmit(true, true, true, true); emit RewardDistributed(1, totalReward); - pool.distributeRewardFor(1, uptime); + pool.distributeRewardFor(1, uptime, epochSize); assertEq(pool.pendingRewards(address(this)), reward1); assertEq(pool.pendingRewards(alice), reward2); assertEq(pool.paidRewardPerEpoch(1), totalReward); @@ -112,9 +122,9 @@ contract RewardPool_Distribute is Initialized { contract RewardPool_DuplicateDistribution is Distributed { function test_RevertEpochAlreadyDistributed() public { Uptime[] memory uptime = new Uptime[](0); - vm.prank(SYSTEM); + vm.startPrank(SYSTEM); vm.expectRevert("REWARD_ALREADY_DISTRIBUTED"); - pool.distributeRewardFor(1, uptime); + pool.distributeRewardFor(1, uptime, epochSize); } } diff --git a/test/forge/child/validator/ValidatorSet.t.sol b/test/forge/child/validator/ValidatorSet.t.sol index a5a17d81..1bfec832 100644 --- a/test/forge/child/validator/ValidatorSet.t.sol +++ b/test/forge/child/validator/ValidatorSet.t.sol @@ -6,6 +6,8 @@ import {ValidatorSet, ValidatorInit, Epoch} from "contracts/child/validator/Vali import {L2StateSender} from "contracts/child/L2StateSender.sol"; import "contracts/interfaces/Errors.sol"; +import {NetworkParams} from "contracts/child/NetworkParams.sol"; + abstract contract Uninitialized is Test { address internal constant SYSTEM = 0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE; bytes32 internal constant STAKE_SIG = keccak256("STAKE"); @@ -18,7 +20,14 @@ abstract contract Uninitialized is Test { address bob = makeAddr("bob"); uint256 epochSize = 64; + NetworkParams networkParams; + function setUp() public virtual { + networkParams = new NetworkParams(); + networkParams.initialize( + NetworkParams.InitParams(address(1), 1, epochSize, 1 ether, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) + ); + stateSender = new L2StateSender(); validatorSet = new ValidatorSet(); } @@ -30,7 +39,7 @@ abstract contract Initialized is Uninitialized { ValidatorInit[] memory init = new ValidatorInit[](2); init[0] = ValidatorInit({addr: address(this), stake: 300}); init[1] = ValidatorInit({addr: alice, stake: 100}); - validatorSet.initialize(address(stateSender), stateReceiver, rootChainManager, epochSize, init); + validatorSet.initialize(address(stateSender), stateReceiver, rootChainManager, address(networkParams), init); } } @@ -40,10 +49,14 @@ abstract contract Committed is Initialized { _beforeCommit(); Epoch memory epoch = Epoch({startBlock: 1, endBlock: 64, epochRoot: bytes32(0)}); vm.prank(SYSTEM); - validatorSet.commitEpoch(1, epoch); + validatorSet.commitEpoch(1, epoch, epochSize); + vm.roll(block.number + 1); + _afterCommit(); } - function _beforeCommit() internal virtual; + function _beforeCommit() internal virtual {} + + function _afterCommit() internal virtual {} } contract ValidatorSet_Initialize is Uninitialized { @@ -51,8 +64,7 @@ contract ValidatorSet_Initialize is Uninitialized { ValidatorInit[] memory init = new ValidatorInit[](2); init[0] = ValidatorInit({addr: address(this), stake: 300}); init[1] = ValidatorInit({addr: alice, stake: 100}); - validatorSet.initialize(address(stateSender), stateReceiver, rootChainManager, epochSize, init); - assertEq(validatorSet.EPOCH_SIZE(), epochSize); + validatorSet.initialize(address(stateSender), stateReceiver, rootChainManager, address(networkParams), init); assertEq(validatorSet.balanceOf(address(this)), 300); assertEq(validatorSet.balanceOf(alice), 100); assertEq(validatorSet.totalSupply(), 400); @@ -67,7 +79,7 @@ contract ValidatorSet_CommitEpoch is Initialized { function test_RevertOnlySystemCall() public { Epoch memory epoch = Epoch({startBlock: 1, endBlock: 64, epochRoot: bytes32(0)}); vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, "SYSTEMCALL")); - validatorSet.commitEpoch(1, epoch); + validatorSet.commitEpoch(1, epoch, epochSize); } function test_RevertInvalidEpochId(uint256 id) public { @@ -75,7 +87,7 @@ contract ValidatorSet_CommitEpoch is Initialized { Epoch memory epoch = Epoch({startBlock: 1, endBlock: 64, epochRoot: bytes32(0)}); vm.expectRevert("UNEXPECTED_EPOCH_ID"); vm.prank(SYSTEM); - validatorSet.commitEpoch(id, epoch); + validatorSet.commitEpoch(id, epoch, epochSize); } function test_RevertNoBlocksCommitted(uint256 startBlock, uint256 endBlock) public { @@ -83,7 +95,7 @@ contract ValidatorSet_CommitEpoch is Initialized { Epoch memory epoch = Epoch({startBlock: startBlock, endBlock: endBlock, epochRoot: bytes32(0)}); vm.expectRevert("NO_BLOCKS_COMMITTED"); vm.prank(SYSTEM); - validatorSet.commitEpoch(1, epoch); + validatorSet.commitEpoch(1, epoch, epochSize); } function test_RevertEpochSize(uint256 startBlock, uint256 endBlock) public { @@ -92,14 +104,14 @@ contract ValidatorSet_CommitEpoch is Initialized { Epoch memory epoch = Epoch({startBlock: startBlock, endBlock: endBlock, epochRoot: bytes32(0)}); vm.expectRevert("EPOCH_MUST_BE_DIVISIBLE_BY_EPOCH_SIZE"); vm.prank(SYSTEM); - validatorSet.commitEpoch(1, epoch); + validatorSet.commitEpoch(1, epoch, epochSize); } function test_RevertInvalidStartBlock() public { Epoch memory epoch = Epoch({startBlock: 0, endBlock: 63, epochRoot: bytes32(0)}); vm.expectRevert("INVALID_START_BLOCK"); vm.prank(SYSTEM); - validatorSet.commitEpoch(1, epoch); + validatorSet.commitEpoch(1, epoch, epochSize); } function test_CommitEpoch() public { @@ -107,7 +119,7 @@ contract ValidatorSet_CommitEpoch is Initialized { vm.prank(SYSTEM); vm.expectEmit(true, true, true, true); emit NewEpoch(1, 1, 64, bytes32(0)); - validatorSet.commitEpoch(1, epoch); + validatorSet.commitEpoch(1, epoch, epochSize); assertEq(validatorSet.currentEpochId(), 2); assertEq(validatorSet.epochEndBlocks(1), 64); assertEq(validatorSet.totalBlocks(1), 64); @@ -136,7 +148,7 @@ contract ValidatorSet_Stake is Initialized { } function test_Stake(uint256 amount) public { - vm.assume(amount < type(uint256).max - validatorSet.balanceOf(alice)); + vm.assume(amount < type(uint224).max - validatorSet.balanceOf(alice)); bytes memory callData = abi.encode(STAKE_SIG, alice, amount); vm.prank(stateReceiver); vm.expectEmit(true, true, true, true); @@ -161,7 +173,7 @@ contract ValidatorSet_Unstake is Initialized { } contract ValidatorSet_StakeChanges is Committed { - function _beforeCommit() internal override { + function _afterCommit() internal override { bytes memory callData = abi.encode(STAKE_SIG, alice, 100); vm.prank(stateReceiver); validatorSet.onStateReceive(1, rootChainManager, callData); @@ -201,3 +213,52 @@ contract ValidatorSet_WithdrawStake is Committed { assertEq(validatorSet.withdrawable(address(this)), 0); } } + +contract ValidatorSet_Slash is Committed { + bytes32 private constant SLASH_SIG = keccak256("SLASH"); + event L2StateSynced(uint256 indexed id, address indexed sender, address indexed receiver, bytes data); + event Slashed(uint256 indexed exitId, address[] validators); + + function test_InitilizeSlashOnlySystemCall() public { + vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, "SYSTEMCALL")); + validatorSet.slash(new address[](0)); + } + + function test_InitialiseSlash(address[] memory validators) public { + vm.assume(validators.length <= (stateSender.MAX_LENGTH() - 160) / 32); + uint256 slashingPercentage = validatorSet.SLASHING_PERCENTAGE(); + uint256 slashIncentivePercentage = validatorSet.SLASH_INCENTIVE_PERCENTAGE(); + vm.prank(SYSTEM); + vm.expectEmit(true, true, true, true); + emit L2StateSynced(1, address(validatorSet), rootChainManager, abi.encode(SLASH_SIG, validators, slashingPercentage, slashIncentivePercentage)); + validatorSet.slash(validators); + } + + function test_FinalizeSlash() public { + uint256 exitEventId = 1; + uint256 slashingPercentage = validatorSet.SLASHING_PERCENTAGE(); + address[] memory validatorsToSlash = new address[](2); + validatorsToSlash[0] = alice; + validatorsToSlash[1] = address(this); + + assertEq(validatorSet.balanceOf(alice), 100); + assertEq(validatorSet.balanceOf(address(this)), 300); + + vm.expectEmit(true, true, true, true); + emit Slashed(exitEventId, validatorsToSlash); + vm.prank(stateReceiver); + validatorSet.onStateReceive(1 /* StateSyncCounter */, rootChainManager, abi.encode(SLASH_SIG, exitEventId, validatorsToSlash, slashingPercentage)); + + assertEq(validatorSet.balanceOf(alice), 0, "should unstake"); + assertEq(validatorSet.balanceOf(address(this)), 0, "should unstake"); + } + + function test_FinalizeSlashAlreadyProcessedSanityCheck() public { + uint256 exitEventId = 1; + vm.startPrank(stateReceiver); + validatorSet.onStateReceive(1 /* StateSyncCounter */, rootChainManager, abi.encode(SLASH_SIG, exitEventId, new address[](0), 0)); + vm.expectRevert("SLASH_ALREADY_PROCESSED"); + validatorSet.onStateReceive(1 /* StateSyncCounter */, rootChainManager, abi.encode(SLASH_SIG, exitEventId, new address[](0), 0)); + vm.stopPrank(); + } +} diff --git a/test/forge/common/Merkle.t.sol b/test/forge/common/Merkle.t.sol index f4c67941..ac68f26b 100644 --- a/test/forge/common/Merkle.t.sol +++ b/test/forge/common/Merkle.t.sol @@ -18,28 +18,77 @@ contract MerkleTest is Test, MurkyBase { _hash = keccak256(abi.encode(left, right)); } - function testCannotCheckMembership_InvalidIndex(uint256 index, uint8 proofSize) public { - index = bound(index, 2 ** proofSize, type(uint256).max); - bytes32[] memory proof = new bytes32[](proofSize); + function testCheckMembershipSingleLeaf(bytes32 leaf, uint256 index) public { + vm.assume(index != 0); + bytes32 randomDataHash = keccak256(abi.encode(leaf)); + bytes32[] memory proof = new bytes32[](0); - vm.expectRevert("INVALID_LEAF_INDEX"); - merkleUser.checkMembership("", index, "", proof); + // should return true for leaf and false for random hash + assertTrue(merkleUser.checkMembership(leaf, 0, leaf, proof)); + assertFalse(merkleUser.checkMembership(randomDataHash, 0, leaf, proof)); + assertFalse(merkleUser.checkMembership(leaf, index, leaf, proof)); } function testCheckMembership(bytes32[] memory leaves, uint256 index) public { vm.assume(leaves.length > 1); - // bound index - index %= leaves.length - 1; - // get merkle root and proof + vm.assume(index < leaves.length); bytes32 root = getRoot(leaves); bytes32[] memory proof = getProof(leaves, index); bytes32 leaf = leaves[index]; - vm.assume(leaf != bytes32(0)); bytes32 randomDataHash = keccak256(abi.encode(leaf)); // should return true for leaf and false for random hash assertTrue(merkleUser.checkMembership(leaf, index, root, proof)); assertFalse(merkleUser.checkMembership(randomDataHash, index, root, proof)); + assertFalse(merkleUser.checkMembership(leaf, leaves.length, root, proof)); + } + + function testCheckMembershiLargeTree(bytes32[] memory leaves, uint256 index) public { + vm.assume(leaves.length > 128); + vm.assume(index < leaves.length); + bytes32 root = getRoot(leaves); + bytes32[] memory proof = getProof(leaves, index); + bytes32 leaf = leaves[index]; + bytes32 randomDataHash = keccak256(abi.encode(leaf)); + + // should return true for leaf and false for random hash + assertTrue(merkleUser.checkMembership(leaf, index, root, proof)); + assertFalse(merkleUser.checkMembership(randomDataHash, index, root, proof)); + assertFalse(merkleUser.checkMembership(leaf, leaves.length, root, proof)); + } + + function testCheckMembershipWithHeight(bytes32[] memory leaves, uint256 index) public { + vm.assume(leaves.length > 1); + vm.assume(index < leaves.length); + bytes32 root = getRoot(leaves); + bytes32[] memory proof = getProof(leaves, index); + bytes32 leaf = leaves[index]; + bytes32 randomDataHash = keccak256(abi.encode(leaf)); + + // should return true for leaf and false for random hash + assertTrue(merkleUser.checkMembershipWithHeight(leaf, index, leaves.length, root, proof)); + assertFalse(merkleUser.checkMembershipWithHeight(randomDataHash, index, leaves.length, root, proof)); + assertFalse(merkleUser.checkMembershipWithHeight(leaf, leaves.length, leaves.length, root, proof)); + assertFalse(merkleUser.checkMembershipWithHeight(leaf, index, (2 ** proof.length) + 1, root, proof)); + assertFalse(merkleUser.checkMembershipWithHeight(leaf, index, (2 ** (proof.length - 1)), root, proof)); + assertFalse(merkleUser.checkMembershipWithHeight(leaf, leaves.length, (2 ** (proof.length - 1)), root, proof)); + } + + function testCheckMembershipWithHeightLargeTree(bytes32[] memory leaves, uint256 index) public { + vm.assume(leaves.length > 128); + vm.assume(index < leaves.length); + bytes32 root = getRoot(leaves); + bytes32[] memory proof = getProof(leaves, index); + bytes32 leaf = leaves[index]; + bytes32 randomDataHash = keccak256(abi.encode(leaf)); + + // should return true for leaf and false for random hash + assertTrue(merkleUser.checkMembershipWithHeight(leaf, index, leaves.length, root, proof)); + assertFalse(merkleUser.checkMembershipWithHeight(randomDataHash, index, leaves.length, root, proof)); + assertFalse(merkleUser.checkMembershipWithHeight(leaf, leaves.length, leaves.length, root, proof)); + assertFalse(merkleUser.checkMembershipWithHeight(leaf, index, (2 ** proof.length) + 1, root, proof)); + assertFalse(merkleUser.checkMembershipWithHeight(leaf, index, (2 ** (proof.length - 1)), root, proof)); + assertFalse(merkleUser.checkMembershipWithHeight(leaf, leaves.length, (2 ** (proof.length - 1)), root, proof)); } } @@ -57,4 +106,15 @@ contract MerkleUser { bool r = Merkle.checkMembership(leaf, index, rootHash, proof); return r; } + + function checkMembershipWithHeight( + bytes32 leaf, + uint256 index, + uint256 numLeaves, + bytes32 rootHash, + bytes32[] calldata proof + ) external pure returns (bool) { + bool r = Merkle.checkMembershipWithHeight(leaf, index, numLeaves, rootHash, proof); + return r; + } } diff --git a/test/forge/libs/EIP712MetaTransaction.t.sol b/test/forge/libs/EIP712MetaTransaction.t.sol deleted file mode 100644 index e69de29b..00000000 diff --git a/test/forge/libs/WithdrawalQueue.t.sol b/test/forge/libs/WithdrawalQueue.t.sol index 2094bfd0..2f7c05f7 100644 --- a/test/forge/libs/WithdrawalQueue.t.sol +++ b/test/forge/libs/WithdrawalQueue.t.sol @@ -18,7 +18,7 @@ abstract contract EmptyState is Test { contract WithdrawalQueueTest_EmptyState is EmptyState { function testCannotAppend_ZeroAmount() public { - vm.expectRevert(stdError.assertionError); + vm.expectRevert("WithdrawalQueueLib: INVALID_AMOUNT"); withdrawalQueueLibUser.append(0, 0); } diff --git a/test/forge/root/RootERC1155Predicate.t.sol b/test/forge/root/RootERC1155Predicate.t.sol deleted file mode 100644 index e69de29b..00000000 diff --git a/test/forge/root/RootERC20Predicate.t.sol b/test/forge/root/RootERC20Predicate.t.sol deleted file mode 100644 index e69de29b..00000000 diff --git a/test/forge/root/RootERC721Predicate.t.sol b/test/forge/root/RootERC721Predicate.t.sol deleted file mode 100644 index e69de29b..00000000 diff --git a/test/forge/root/staking/CustomSupernetManager.t.sol b/test/forge/root/staking/CustomSupernetManager.t.sol index 2469ea63..1f9d1091 100644 --- a/test/forge/root/staking/CustomSupernetManager.t.sol +++ b/test/forge/root/staking/CustomSupernetManager.t.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.19; import "@utils/Test.sol"; import "contracts/common/BLS.sol"; import "contracts/root/StateSender.sol"; +import {ExitHelper} from "contracts/root/ExitHelper.sol"; import {StakeManager} from "contracts/root/staking/StakeManager.sol"; import {CustomSupernetManager, Validator, GenesisValidator} from "contracts/root/staking/CustomSupernetManager.sol"; import {MockERC20} from "contracts/mocks/MockERC20.sol"; @@ -15,6 +16,7 @@ abstract contract Uninitialized is Test { address childValidatorSet; address exitHelper; string constant DOMAIN = "CUSTOM_SUPERNET_MANAGER"; + bytes32 internal constant callerSlotOnExitHelper = bytes32(uint256(3)); MockERC20 token; StakeManager stakeManager; CustomSupernetManager supernetManager; @@ -23,7 +25,7 @@ abstract contract Uninitialized is Test { bls = new BLS(); stateSender = new StateSender(); childValidatorSet = makeAddr("childValidatorSet"); - exitHelper = makeAddr("exitHelper"); + exitHelper = address(new ExitHelper()); token = new MockERC20(); stakeManager = new StakeManager(); supernetManager = new CustomSupernetManager(); @@ -83,7 +85,7 @@ abstract contract Whitelisted is Registered { function toHexString(address addr) public pure returns (string memory) { bytes memory buffer = abi.encodePacked(addr); - // Fixed buffer size for hexadecimal convertion + // Fixed buffer size for hexadecimal conversion bytes memory converted = new bytes(buffer.length * 2); bytes memory _base = "0123456789abcdef"; @@ -144,12 +146,18 @@ abstract contract EnabledStaking is FinalizedGenesis { abstract contract Slashed is EnabledStaking { bytes32 private constant SLASH_SIG = keccak256("SLASH"); + uint256 internal slashingPercentage = 50; // sent from ValidatorSet + uint256 internal slashIncentivePercentage = 30; // sent from ValidatorSet function setUp() public virtual override { super.setUp(); - bytes memory callData = abi.encode(SLASH_SIG, address(this)); + address[] memory validatorsToSlash = new address[](1); + validatorsToSlash[0] = address(this); + bytes memory callData = abi.encode(SLASH_SIG, validatorsToSlash, slashingPercentage, slashIncentivePercentage); + vm.store(exitHelper, callerSlotOnExitHelper, bytes32(uint256(uint160(makeAddr("MEV"))))); // simulate caller of exit() vm.prank(exitHelper); supernetManager.onL2StateReceive(1, childValidatorSet, callData); + vm.store(exitHelper, callerSlotOnExitHelper, bytes32(0)); } } @@ -342,15 +350,15 @@ contract CustomSupernetManager_StakingPostGenesis is EnabledStaking { contract CustomSupernetManager_Unstake is EnabledStaking { bytes32 private constant UNSTAKE_SIG = keccak256("UNSTAKE"); - event ValidatorDeactivated(address validator); + event ValidatorDeactivated(address indexed validator); function test_RevertNotCalledByExitHelper() public { - vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, "exitHelper")); + vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, "_exitHelper")); supernetManager.onL2StateReceive(1, childValidatorSet, ""); } function test_RevertChildValidatorSetNotSender() public { - vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, "exitHelper")); + vm.expectRevert(abi.encodeWithSelector(Unauthorized.selector, "_exitHelper")); vm.prank(exitHelper); supernetManager.onL2StateReceive(1, alice, ""); } @@ -376,16 +384,44 @@ contract CustomSupernetManager_Unstake is EnabledStaking { } contract CustomSupernetManager_Slash is EnabledStaking { + address private mev = makeAddr("MEV"); bytes32 private constant SLASH_SIG = keccak256("SLASH"); - event ValidatorDeactivated(address validator); + event ValidatorDeactivated(address indexed validator); + event StateSynced(uint256 indexed id, address indexed sender, address indexed receiver, bytes data); + event StakeRemoved(uint256 indexed id, address indexed validator, uint256 amount); + event StakeWithdrawn(address indexed validator, address indexed recipient, uint256 amount); + event Transfer(address indexed from, address indexed to, uint256 value); + + uint256 private slashingPercentage = 50; // sent from ValidatorSet + uint256 private slashIncentivePercentage = 30; // sent from ValidatorSet function test_SuccessfulFullWithdrawal() public { - uint256 slashingPercentage = supernetManager.SLASHING_PERCENTAGE(); - bytes memory callData = abi.encode(SLASH_SIG, address(this)); + uint256 exitEventId = 1; + + address[] memory validatorsToSlash = new address[](1); + validatorsToSlash[0] = address(this); + bytes memory callData = abi.encode(SLASH_SIG, validatorsToSlash, slashingPercentage, slashIncentivePercentage); + uint256 slashedAmount = (amount * slashingPercentage) / 100; + + vm.expectEmit(true, true, true, true); + emit StakeWithdrawn(address(this), address(supernetManager), slashedAmount); + vm.expectEmit(true, true, true, true); + emit StakeRemoved(exitEventId, address(this), amount); vm.expectEmit(true, true, true, true); emit ValidatorDeactivated(address(this)); + // emits state sync event to complete slashing on child chain + vm.expectEmit(true, true, true, true); + emit StateSynced( + exitEventId, + address(supernetManager), + childValidatorSet, + abi.encode(SLASH_SIG, exitEventId, validatorsToSlash, slashingPercentage) + ); + vm.store(exitHelper, callerSlotOnExitHelper, bytes32(uint256(uint160(mev)))); // simulate caller of exit() vm.prank(exitHelper); - supernetManager.onL2StateReceive(1, childValidatorSet, callData); + supernetManager.onL2StateReceive(exitEventId, childValidatorSet, callData); + vm.store(exitHelper, callerSlotOnExitHelper, bytes32(0)); + assertEq(stakeManager.stakeOf(address(this), 1), 0, "should unstake all"); assertEq( stakeManager.withdrawableStake(address(this)), @@ -394,6 +430,53 @@ contract CustomSupernetManager_Slash is EnabledStaking { ); assertEq(supernetManager.getValidator(address(this)).isActive, false, "should deactivate"); } + + function test_SlashIncentiveDistribution() external { + uint256 exitEventId = 1; + address[] memory validatorsToSlash = new address[](1); + validatorsToSlash[0] = address(this); + bytes memory callData = abi.encode(SLASH_SIG, validatorsToSlash, slashingPercentage, slashIncentivePercentage); + uint256 slashedAmount = (amount * slashingPercentage) / 100; + uint256 exitorReward = (slashedAmount * slashIncentivePercentage) / 100; + + assertEq(token.balanceOf(mev), 0); // balance before + vm.expectEmit(true, true, true, true); + emit Transfer(address(supernetManager), mev, exitorReward); + vm.store(exitHelper, callerSlotOnExitHelper, bytes32(uint256(uint160(mev)))); // simulate caller of exit() + vm.prank(exitHelper); + supernetManager.onL2StateReceive(exitEventId, childValidatorSet, callData); + vm.store(exitHelper, callerSlotOnExitHelper, bytes32(0)); + assertEq(token.balanceOf(mev), exitorReward, "should transfer slashing reward"); + } + + function test_SlashEntireValidatorSet() external { + uint256 aliceStakedAmount = amount << 3; + token.mint(alice, aliceStakedAmount); + vm.prank(alice); + stakeManager.stakeFor(1, aliceStakedAmount); + + uint256 aliceSlashedAmount = (aliceStakedAmount * slashingPercentage) / 100; + uint256 thisSlashedAmount = (amount * slashingPercentage) / 100; + + address[] memory validatorsToSlash = new address[](2); + validatorsToSlash[0] = alice; + validatorsToSlash[1] = address(this); + bytes memory callData = abi.encode(SLASH_SIG, validatorsToSlash, slashingPercentage, slashIncentivePercentage); + + vm.store(exitHelper, callerSlotOnExitHelper, bytes32(uint256(uint160(mev)))); // simulate caller of exit() + vm.prank(exitHelper); + supernetManager.onL2StateReceive(1, childValidatorSet, callData); + vm.store(exitHelper, callerSlotOnExitHelper, bytes32(0)); + + assertEq(stakeManager.stakeOf(address(this), 1), 0, "should unstake all"); + assertEq(stakeManager.stakeOf(alice, 1), 0, "should unstake all"); + assertEq(stakeManager.withdrawableStake(address(this)), amount - thisSlashedAmount, "should slash"); + assertEq(stakeManager.withdrawableStake(alice), aliceStakedAmount - aliceSlashedAmount, "should slash"); + assertEq(supernetManager.getValidator(address(this)).isActive, false, "should deactivate"); + assertEq(supernetManager.getValidator(alice).isActive, false, "should deactivate"); + uint256 exitorReward = ((thisSlashedAmount + aliceSlashedAmount) * slashIncentivePercentage) / 100; + assertEq(token.balanceOf(mev), exitorReward, "should transfer slashing reward"); + } } contract CustomSupernetManager_WithdrawSlash is Slashed { @@ -406,10 +489,12 @@ contract CustomSupernetManager_WithdrawSlash is Slashed { } function test_WithdrawSlashedAmount() public { - uint256 slashedAmount = amount / 2; - assertEq(token.balanceOf(address(supernetManager)), slashedAmount); + uint256 slashedAmount = (amount * slashingPercentage) / 100; + uint256 slashingReward = (slashedAmount * slashIncentivePercentage) / 100; // given to exitor after slash + uint256 withdrawableAmount = slashedAmount - slashingReward; + assertEq(token.balanceOf(address(supernetManager)), withdrawableAmount); vm.expectEmit(true, true, true, true); - emit Transfer(address(supernetManager), alice, slashedAmount); + emit Transfer(address(supernetManager), alice, withdrawableAmount); supernetManager.withdrawSlashedStake(alice); assertEq(token.balanceOf(address(supernetManager)), 0); } diff --git a/test/forge/root/staking/StakeManager.t.sol b/test/forge/root/staking/StakeManager.t.sol index cf07f83f..e132ea06 100644 --- a/test/forge/root/staking/StakeManager.t.sol +++ b/test/forge/root/staking/StakeManager.t.sol @@ -91,12 +91,12 @@ contract StakeManager_Register is Initialized, StakeManager { contract StakeManager_StakeFor is Registered, StakeManager { function test_RevertIdZero() public { - vm.expectRevert("INVALID_ID"); + vm.expectRevert("StakeManager: INVALID_ID"); stakeManager.stakeFor(0, 1); } function test_RevertChainDoesNotExist() public { - vm.expectRevert("INVALID_ID"); + vm.expectRevert("StakeManager: INVALID_ID"); stakeManager.stakeFor(id2 + 1, 1); } @@ -132,7 +132,7 @@ contract StakeManager_StakeFor is Registered, StakeManager { contract StakeManager_ReleaseStake is Staked, StakeManager { function test_RevertNotSupernetManager() public { - vm.expectRevert("Invalid manager"); + vm.expectRevert("StakeManagerChildData: INVALID_MANAGER"); stakeManager.releaseStakeOf(address(this), 1); } @@ -152,7 +152,7 @@ contract StakeManager_ReleaseStake is Staked, StakeManager { contract StakeManager_SlashStake is Staked, StakeManager { function test_RevertNotSupernetManager() public { - vm.expectRevert("Invalid manager"); + vm.expectRevert("StakeManagerChildData: INVALID_MANAGER"); stakeManager.slashStakeOf(address(this), 1); } diff --git a/test/forge/utils/Assertions.sol b/test/forge/utils/Assertions.sol index 5b5fe8c9..27a4b3f1 100644 --- a/test/forge/utils/Assertions.sol +++ b/test/forge/utils/Assertions.sol @@ -14,15 +14,6 @@ import {RewardPool, Validator, Node, ValidatorTree} from "contracts/interfaces/l // ⭐️ ASSERTIONS abstract contract Assertions is StdAssertions { - function assertNotEq(uint256 a, uint256 b) internal virtual { - if (a == b) { - emit log("Error: a != b not satisfied [uint]"); - emit log_named_uint("Not expected", b); - emit log_named_uint(" Actual", a); - fail(); - } - } - function assertEq(Validator memory a, Validator memory b) internal virtual { _compareHash(keccak256(abi.encode(a)), keccak256(abi.encode(b)), "Validator"); }