From 03789d0c230bbb7a8d2075915a469b13d0a32099 Mon Sep 17 00:00:00 2001 From: Zero Ekkusu <94782988+ZeroEkkusu@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:07:24 +0200 Subject: [PATCH] test: update `ForkParams` tests --- docs/child/ChildERC1155PredicateAccessList.md | 2 +- docs/child/ChildERC20PredicateAccessList.md | 2 +- docs/child/ChildERC721PredicateAccessList.md | 2 +- docs/child/ForkParams.md | 34 +- docs/child/NativeERC20Mintable.md | 2 +- docs/child/NetworkParams.md | 538 ++++++- .../RootMintableERC1155PredicateAccessList.md | 2 +- .../RootMintableERC20PredicateAccessList.md | 2 +- .../RootMintableERC721PredicateAccessList.md | 2 +- docs/child/governance/ChildGovernor.md | 1281 +++++++++++++++++ docs/child/governance/ChildTimelock.md | 772 ++++++++++ docs/child/validator/RewardPool.md | 21 +- docs/child/validator/ValidatorSet.md | 372 ++++- .../access/AccessControlUpgradeable.md | 223 +++ .../access/IAccessControlUpgradeable.md | 168 +++ .../access/Ownable2StepUpgradeable.md | 2 +- .../access/OwnableUpgradeable.md | 2 +- .../governance/GovernorUpgradeable.md | 872 +++++++++++ .../governance/IGovernorUpgradeable.md | 678 +++++++++ .../TimelockControllerUpgradeable.md | 753 ++++++++++ .../GovernorCompatibilityBravoUpgradeable.md | 1123 +++++++++++++++ .../IGovernorCompatibilityBravoUpgradeable.md | 848 +++++++++++ .../GovernorTimelockControlUpgradeable.md | 986 +++++++++++++ .../GovernorVotesQuorumFractionUpgradeable.md | 978 +++++++++++++ .../extensions/GovernorVotesUpgradeable.md | 889 ++++++++++++ .../IGovernorTimelockUpgradeable.md | 759 ++++++++++ .../governance/utils/IVotesUpgradeable.md | 180 +++ .../interfaces/IERC5267Upgradeable.md | 52 + .../interfaces/IERC5805Upgradeable.md | 214 +++ .../interfaces/IERC6372Upgradeable.md | 49 + .../proxy/utils/Initializable.md | 2 +- .../token/ERC20/ERC20Upgradeable.md | 4 +- ...gradeable.md => ERC20PermitUpgradeable.md} | 140 +- .../ERC20/extensions/ERC20VotesUpgradeable.md | 635 ++++++++ .../token/ERC721/IERC721Upgradeable.md | 4 +- .../extensions/IERC721MetadataUpgradeable.md | 4 +- .../utils/CheckpointsUpgradeable.md | 12 + .../utils/StorageSlotUpgradeable.md | 2 +- .../utils/cryptography/ECDSAUpgradeable.md | 12 + .../utils/cryptography/EIP712Upgradeable.md | 68 + .../utils/math/SafeCastUpgradeable.md | 12 + .../utils/math/SignedMathUpgradeable.md | 12 + .../structs/DoubleEndedQueueUpgradeable.md | 37 + docs/elin/contracts/access/AccessControl.md | 2 +- docs/elin/contracts/access/Ownable.md | 2 +- docs/elin/contracts/access/Ownable2Step.md | 2 +- .../contracts/proxy/utils/Initializable.md | 2 +- docs/elin/contracts/token/ERC20/ERC20.md | 4 +- .../token/ERC20/extensions/ERC20Burnable.md | 2 +- .../token/ERC20/extensions/ERC20Pausable.md | 2 +- .../ERC20/presets/ERC20PresetMinterPauser.md | 2 +- docs/elin/contracts/token/ERC721/IERC721.md | 4 +- .../ERC721/extensions/IERC721Enumerable.md | 4 +- .../ERC721/extensions/IERC721Metadata.md | 4 +- docs/elin/contracts/utils/math/SignedMath.md | 12 + .../contracts/utils/structs/EnumerableSet.md | 2 +- docs/interfaces/child/IChildERC721.md | 4 +- .../child/validator/IValidatorSet.md | 17 - docs/lib/AccessList.md | 2 +- docs/mocks/MockERC20.md | 2 +- docs/root/staking/CustomSupernetManager.md | 2 +- test/child/ForkParams.test.ts | 9 +- 62 files changed, 12650 insertions(+), 182 deletions(-) create mode 100644 docs/child/governance/ChildGovernor.md create mode 100644 docs/child/governance/ChildTimelock.md create mode 100644 docs/elin/contracts-upgradeable/access/AccessControlUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/access/IAccessControlUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/governance/GovernorUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/governance/IGovernorUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/governance/TimelockControllerUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/governance/compatibility/GovernorCompatibilityBravoUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/governance/compatibility/IGovernorCompatibilityBravoUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/governance/extensions/GovernorTimelockControlUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/governance/extensions/GovernorVotesQuorumFractionUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/governance/extensions/GovernorVotesUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/governance/extensions/IGovernorTimelockUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/governance/utils/IVotesUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/interfaces/IERC5267Upgradeable.md create mode 100644 docs/elin/contracts-upgradeable/interfaces/IERC5805Upgradeable.md create mode 100644 docs/elin/contracts-upgradeable/interfaces/IERC6372Upgradeable.md rename docs/elin/contracts-upgradeable/token/ERC20/extensions/{ERC20SnapshotUpgradeable.md => ERC20PermitUpgradeable.md} (68%) create mode 100644 docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/utils/CheckpointsUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.md create mode 100644 docs/elin/contracts-upgradeable/utils/math/SafeCastUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/utils/math/SignedMathUpgradeable.md create mode 100644 docs/elin/contracts-upgradeable/utils/structs/DoubleEndedQueueUpgradeable.md create mode 100644 docs/elin/contracts/utils/math/SignedMath.md diff --git a/docs/child/ChildERC1155PredicateAccessList.md b/docs/child/ChildERC1155PredicateAccessList.md index ea50a9af..2e6ddcb2 100644 --- a/docs/child/ChildERC1155PredicateAccessList.md +++ b/docs/child/ChildERC1155PredicateAccessList.md @@ -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/ChildERC20PredicateAccessList.md b/docs/child/ChildERC20PredicateAccessList.md index 5679b09e..88167370 100644 --- a/docs/child/ChildERC20PredicateAccessList.md +++ b/docs/child/ChildERC20PredicateAccessList.md @@ -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/ChildERC721PredicateAccessList.md b/docs/child/ChildERC721PredicateAccessList.md index b7803d10..f3d29a33 100644 --- a/docs/child/ChildERC721PredicateAccessList.md +++ b/docs/child/ChildERC721PredicateAccessList.md @@ -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/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/NativeERC20Mintable.md b/docs/child/NativeERC20Mintable.md index f92615b5..0ef7cac3 100644 --- a/docs/child/NativeERC20Mintable.md +++ b/docs/child/NativeERC20Mintable.md @@ -449,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 diff --git a/docs/child/NetworkParams.md b/docs/child/NetworkParams.md index fe93b671..2713c853 100644 --- a/docs/child/NetworkParams.md +++ b/docs/child/NetworkParams.md @@ -10,6 +10,17 @@ Configurable network parameters that are read by the client on each epoch ## Methods +### acceptOwnership + +```solidity +function acceptOwnership() external nonpayable +``` + + + +*The new owner accepts the ownership transfer.* + + ### blockGasLimit ```solidity @@ -21,6 +32,40 @@ function blockGasLimit() 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) +``` + + + + + + #### Returns | Name | Type | Description | @@ -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 @@ -72,6 +167,23 @@ function minStake() external view returns (uint256) +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### minValidatorSetSize + +```solidity +function minValidatorSetSize() external view returns (uint256) +``` + + + + + + #### Returns | Name | Type | Description | @@ -95,6 +207,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,7 +249,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.* ### setNewBlockGasLimit @@ -122,6 +268,38 @@ function to set new block gas limit |---|---|---| | newBlockGasLimit | uint256 | new block gas limit | +### 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 ```solidity @@ -138,6 +316,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 @@ -170,6 +380,86 @@ function to set new minimum stake |---|---|---| | newMinStake | uint256 | new minimum stake | +### 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 | + +### 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 setNewWithdrawalWaitPeriod(uint256 newWithdrawalWaitPeriod) external nonpayable +``` + +function to set new withdrawal wait period + +*disallows setting of a zero value for sanity check purposes* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| newWithdrawalWaitPeriod | uint256 | new withdrawal wait period | + ### transferOwnership ```solidity @@ -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 +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + ### NewBlockGasLimit ```solidity -event NewBlockGasLimit(uint256 indexed value) +event NewBlockGasLimit(uint256 indexed gasLimit) ``` @@ -204,12 +561,44 @@ event NewBlockGasLimit(uint256 indexed value) | Name | Type | Description | |---|---|---| -| value `indexed` | uint256 | undefined | +| gasLimit `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,44 @@ event NewCheckpointBlockInterval(uint256 indexed value) | Name | Type | Description | |---|---|---| -| value `indexed` | uint256 | undefined | +| checkpointInterval `indexed` | uint256 | undefined | + +### NewEpochReward + +```solidity +event NewEpochReward(uint256 indexed reward) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| reward `indexed` | uint256 | undefined | + +### NewEpochSize + +```solidity +event NewEpochSize(uint256 indexed size) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| size `indexed` | uint256 | undefined | ### NewMaxValdidatorSetSize ```solidity -event NewMaxValdidatorSetSize(uint256 indexed value) +event NewMaxValdidatorSetSize(uint256 indexed maxValidatorSet) ``` @@ -236,12 +657,12 @@ event NewMaxValdidatorSetSize(uint256 indexed value) | Name | Type | Description | |---|---|---| -| value `indexed` | uint256 | undefined | +| maxValidatorSet `indexed` | uint256 | undefined | ### NewMinStake ```solidity -event NewMinStake(uint256 indexed value) +event NewMinStake(uint256 indexed minStake) ``` @@ -252,7 +673,104 @@ event NewMinStake(uint256 indexed value) | Name | Type | Description | |---|---|---| -| value `indexed` | uint256 | undefined | +| minStake `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 | + +### 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/RootMintableERC1155PredicateAccessList.md b/docs/child/RootMintableERC1155PredicateAccessList.md index ad12d23f..e89566c5 100644 --- a/docs/child/RootMintableERC1155PredicateAccessList.md +++ b/docs/child/RootMintableERC1155PredicateAccessList.md @@ -541,7 +541,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.* ### rootTokenToChildToken diff --git a/docs/child/RootMintableERC20PredicateAccessList.md b/docs/child/RootMintableERC20PredicateAccessList.md index b3a774be..69f011a1 100644 --- a/docs/child/RootMintableERC20PredicateAccessList.md +++ b/docs/child/RootMintableERC20PredicateAccessList.md @@ -434,7 +434,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.* ### rootTokenToChildToken diff --git a/docs/child/RootMintableERC721PredicateAccessList.md b/docs/child/RootMintableERC721PredicateAccessList.md index d2e3ff06..84a482af 100644 --- a/docs/child/RootMintableERC721PredicateAccessList.md +++ b/docs/child/RootMintableERC721PredicateAccessList.md @@ -511,7 +511,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.* ### rootTokenToChildToken diff --git a/docs/child/governance/ChildGovernor.md b/docs/child/governance/ChildGovernor.md new file mode 100644 index 00000000..2b372958 --- /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..f496ad45 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 | @@ -200,7 +183,7 @@ function distributeRewardFor(uint256 epochId, Uptime[] uptime) external nonpayab ### 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 +197,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 fd665a04..351510df 100644 --- a/docs/child/validator/ValidatorSet.md +++ b/docs/child/validator/ValidatorSet.md @@ -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 @@ -174,23 +191,6 @@ function VALIDATOR_PKCHECK_PRECOMPILE_GAS() external view returns (uint256) -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | - -### WITHDRAWAL_WAIT_PERIOD - -```solidity -function WITHDRAWAL_WAIT_PERIOD() external view returns (uint256) -``` - - - - - - #### Returns | Name | Type | Description | @@ -271,7 +271,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,6 +288,46 @@ 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 @@ -330,7 +370,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 +402,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 +530,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 +623,7 @@ function increaseAllowance(address spender, uint256 addedValue) external nonpaya ### initialize ```solidity -function initialize(address newStateSender, address newStateReceiver, address newRootChainManager, uint256 newEpochSize, ValidatorInit[] initialValidators) external nonpayable +function initialize(address newStateSender, address newStateReceiver, address newRootChainManager, address newNetworkParams, ValidatorInit[] initialValidators) external nonpayable ``` @@ -448,7 +637,7 @@ function initialize(address newStateSender, address newStateReceiver, address ne | newStateSender | address | undefined | | newStateReceiver | address | undefined | | newRootChainManager | address | undefined | -| newEpochSize | uint256 | undefined | +| newNetworkParams | address | undefined | | initialValidators | ValidatorInit[] | undefined | ### name @@ -468,6 +657,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 +741,28 @@ 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 | + ### symbol ```solidity @@ -570,7 +825,7 @@ function totalSupply() external view returns (uint256) function totalSupplyAt(uint256 epochNumber) external view returns (uint256) ``` - +returns the total supply for a given epoch @@ -704,6 +959,53 @@ event Approval(address indexed owner, address indexed spender, uint256 value) | spender `indexed` | address | undefined | | value | uint256 | undefined | +### DelegateChanged + +```solidity +event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +``` + + + +*Emitted when an account changes their delegate.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| delegator `indexed` | address | undefined | +| fromDelegate `indexed` | address | undefined | +| toDelegate `indexed` | address | undefined | + +### DelegateVotesChanged + +```solidity +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 @@ -756,22 +1058,6 @@ event Slashed(uint256 indexed validator, uint256 amount) | validator `indexed` | uint256 | undefined | | amount | uint256 | 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 diff --git a/docs/elin/contracts-upgradeable/access/AccessControlUpgradeable.md b/docs/elin/contracts-upgradeable/access/AccessControlUpgradeable.md new file mode 100644 index 00000000..bede28e5 --- /dev/null +++ b/docs/elin/contracts-upgradeable/access/AccessControlUpgradeable.md @@ -0,0 +1,223 @@ +# AccessControlUpgradeable + + + + + + + +*Contract module that allows children to implement role-based access control mechanisms. This is a lightweight version that doesn't allow enumerating role members except through off-chain means by accessing the contract event logs. Some applications may benefit from on-chain enumerability, for those cases see {AccessControlEnumerable}. Roles are referred to by their `bytes32` identifier. These should be exposed in the external API and be unique. The best way to achieve this is by using `public constant` hash digests: ```solidity bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); ``` Roles can be used to represent a set of permissions. To restrict access to a function call, use {hasRole}: ```solidity function foo() public { require(hasRole(MY_ROLE, msg.sender)); ... } ``` Roles can be granted and revoked dynamically via the {grantRole} and {revokeRole} functions. Each role has an associated admin role, and only accounts that have a role's admin role can call {grantRole} and {revokeRole}. By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means that only accounts with this role will be able to grant or revoke other roles. More complex role relationships can be created by using {_setRoleAdmin}. WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to grant and revoke this role. Extra precautions should be taken to secure accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} to enforce additional security measures for this role.* + +## 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 + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + +*Triggered when the contract has been initialized or reinitialized.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | 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/elin/contracts-upgradeable/access/IAccessControlUpgradeable.md b/docs/elin/contracts-upgradeable/access/IAccessControlUpgradeable.md new file mode 100644 index 00000000..4ad76fe1 --- /dev/null +++ b/docs/elin/contracts-upgradeable/access/IAccessControlUpgradeable.md @@ -0,0 +1,168 @@ +# IAccessControlUpgradeable + + + + + + + +*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-upgradeable/access/Ownable2StepUpgradeable.md b/docs/elin/contracts-upgradeable/access/Ownable2StepUpgradeable.md index 7593d4c1..f3fbc3f2 100644 --- a/docs/elin/contracts-upgradeable/access/Ownable2StepUpgradeable.md +++ b/docs/elin/contracts-upgradeable/access/Ownable2StepUpgradeable.md @@ -63,7 +63,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 diff --git a/docs/elin/contracts-upgradeable/access/OwnableUpgradeable.md b/docs/elin/contracts-upgradeable/access/OwnableUpgradeable.md index f40a49fb..8a511406 100644 --- a/docs/elin/contracts-upgradeable/access/OwnableUpgradeable.md +++ b/docs/elin/contracts-upgradeable/access/OwnableUpgradeable.md @@ -35,7 +35,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 diff --git a/docs/elin/contracts-upgradeable/governance/GovernorUpgradeable.md b/docs/elin/contracts-upgradeable/governance/GovernorUpgradeable.md new file mode 100644 index 00000000..348ae907 --- /dev/null +++ b/docs/elin/contracts-upgradeable/governance/GovernorUpgradeable.md @@ -0,0 +1,872 @@ +# GovernorUpgradeable + + + + + + + +*Core of the governance system, designed to be extended though various modules. This contract is abstract and requires several functions to be implemented in various modules: - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote} - A voting module must implement {_getVotes} - Additionally, {votingPeriod} must also be implemented _Available since v4.3._* + +## 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) +``` + +module:core + +*See EIP-6372.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### COUNTING_MODE + +```solidity +function COUNTING_MODE() external view 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(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-cancel}.* + +#### 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) +``` + +module:core + +*See {IERC6372}* + + +#### 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 | + +### 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) +``` + +module:voting + +*Returns whether `account` has cast a vote on `proposalId`.* + +#### 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 | + +### 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 | + +### 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 | + +### propose + +```solidity +function propose(address[] targets, uint256[] values, bytes[] calldatas, string description) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-propose}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| description | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### quorum + +```solidity +function quorum(uint256 timepoint) external view returns (uint256) +``` + +module:user-config + +*Minimum number of cast voted required for a proposal to be successful. NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| timepoint | uint256 | undefined | + +#### 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) +``` + + + +*See {IGovernor-state}.* + +#### 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) +``` + + + +*See {IERC165-supportsInterface}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | 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 | + +### 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/elin/contracts-upgradeable/governance/IGovernorUpgradeable.md b/docs/elin/contracts-upgradeable/governance/IGovernorUpgradeable.md new file mode 100644 index 00000000..cb90275f --- /dev/null +++ b/docs/elin/contracts-upgradeable/governance/IGovernorUpgradeable.md @@ -0,0 +1,678 @@ +# IGovernorUpgradeable + + + + + + + +*Interface of the {Governor} core. _Available since v4.3._* + +## Methods + +### CLOCK_MODE + +```solidity +function CLOCK_MODE() external view returns (string) +``` + +module:core + +*See EIP-6372.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### COUNTING_MODE + +```solidity +function COUNTING_MODE() external view 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 | + +### cancel + +```solidity +function cancel(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external nonpayable returns (uint256 proposalId) +``` + + + +*Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e. before the vote starts. Emits a {ProposalCanceled} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### castVote + +```solidity +function castVote(uint256 proposalId, uint8 support) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote Emits a {VoteCast} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteBySig + +```solidity +function castVoteBySig(uint256 proposalId, uint8 support, uint8 v, bytes32 r, bytes32 s) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote using the user's cryptographic signature. Emits a {VoteCast} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| v | uint8 | undefined | +| r | bytes32 | undefined | +| s | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteWithReason + +```solidity +function castVoteWithReason(uint256 proposalId, uint8 support, string reason) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote with a reason Emits a {VoteCast} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| reason | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteWithReasonAndParams + +```solidity +function castVoteWithReasonAndParams(uint256 proposalId, uint8 support, string reason, bytes params) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote with a reason and additional encoded parameters Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| reason | string | undefined | +| params | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteWithReasonAndParamsBySig + +```solidity +function castVoteWithReasonAndParamsBySig(uint256 proposalId, uint8 support, string reason, bytes params, uint8 v, bytes32 r, bytes32 s) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote with a reason and additional encoded parameters using the user's cryptographic signature. Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.* + +#### 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 | +|---|---|---| +| balance | uint256 | undefined | + +### clock + +```solidity +function clock() external view returns (uint48) +``` + +module:core + +*See {IERC6372}* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint48 | undefined | + +### execute + +```solidity +function execute(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external payable returns (uint256 proposalId) +``` + + + +*Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the deadline to be reached. Emits a {ProposalExecuted} event. Note: some module can modify the requirements for execution, for example by adding an additional timelock.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### getVotes + +```solidity +function getVotes(address account, uint256 timepoint) external view returns (uint256) +``` + +module:reputation + +*Voting power of an `account` at a specific `timepoint`. Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or multiple), {ERC20Votes} tokens.* + +#### 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) +``` + +module:reputation + +*Voting power of an `account` at a specific `timepoint` given additional encoded parameters.* + +#### 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) +``` + +module:voting + +*Returns whether `account` has cast a vote on `proposalId`.* + +#### 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) +``` + +module:core + +*Hashing function used to (re)build the proposal id from the proposal details..* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### name + +```solidity +function name() external view returns (string) +``` + +module:core + +*Name of the governor instance (used in building the ERC712 domain separator).* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### proposalDeadline + +```solidity +function proposalDeadline(uint256 proposalId) external view returns (uint256) +``` + +module:core + +*Timepoint at which votes close. If using block number, votes close at the end of this block, so it is possible to cast a vote during this block.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### proposalProposer + +```solidity +function proposalProposer(uint256 proposalId) external view returns (address) +``` + +module:core + +*The account that created a 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) +``` + +module:core + +*Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the following block.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### propose + +```solidity +function propose(address[] targets, uint256[] values, bytes[] calldatas, string description) external nonpayable returns (uint256 proposalId) +``` + + + +*Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a duration specified by {IGovernor-votingPeriod}. Emits a {ProposalCreated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| description | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### quorum + +```solidity +function quorum(uint256 timepoint) external view returns (uint256) +``` + +module:user-config + +*Minimum number of cast voted required for a proposal to be successful. NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| timepoint | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### state + +```solidity +function state(uint256 proposalId) external view returns (enum IGovernorUpgradeable.ProposalState) +``` + +module:core + +*Current state of a proposal, following Compound's convention* + +#### 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) +``` + + + +*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 | + +### version + +```solidity +function version() external view returns (string) +``` + +module:core + +*Version of the governor instance (used in building the ERC712 domain separator). Default: "1"* + + +#### 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 + +### 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 | + +### 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 | + + + diff --git a/docs/elin/contracts-upgradeable/governance/TimelockControllerUpgradeable.md b/docs/elin/contracts-upgradeable/governance/TimelockControllerUpgradeable.md new file mode 100644 index 00000000..11ff66d5 --- /dev/null +++ b/docs/elin/contracts-upgradeable/governance/TimelockControllerUpgradeable.md @@ -0,0 +1,753 @@ +# TimelockControllerUpgradeable + + + + + + + +*Contract module which acts as a timelocked controller. When set as the owner of an `Ownable` smart contract, it enforces a timelock on all `onlyOwner` maintenance operations. This gives time for users of the controlled contract to exit before a potentially dangerous maintenance operation is applied. By default, this contract is self administered, meaning administration tasks have to go through the timelock process. The proposer (resp executor) role is in charge of proposing (resp executing) operations. A common use case is to position this {TimelockController} as the owner of a smart contract, with a multisig or a DAO as the sole proposer. _Available since v3.3._* + +## 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 | + +### 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/elin/contracts-upgradeable/governance/compatibility/GovernorCompatibilityBravoUpgradeable.md b/docs/elin/contracts-upgradeable/governance/compatibility/GovernorCompatibilityBravoUpgradeable.md new file mode 100644 index 00000000..62754b17 --- /dev/null +++ b/docs/elin/contracts-upgradeable/governance/compatibility/GovernorCompatibilityBravoUpgradeable.md @@ -0,0 +1,1123 @@ +# GovernorCompatibilityBravoUpgradeable + + + + + + + +*Compatibility layer that implements GovernorBravo compatibility on top of {Governor}. This compatibility layer includes a voting system and requires a {IGovernorTimelock} compatible module to be added through inheritance. It does not include token bindings, nor does it include any variable upgrade patterns. NOTE: When using this module, you may need to enable the Solidity optimizer to avoid hitting the contract size limit. _Available since v4.3._* + +## 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) +``` + +module:core + +*See 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) +``` + + + +*Cancel a proposal with GovernorBravo logic. At any moment a proposal can be cancelled, either by the proposer, or by third parties if the proposer's voting power has dropped below the proposal threshold.* + +#### 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) +``` + +module:core + +*See {IERC6372}* + + +#### 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 | + +### 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) +``` + + + + + +#### 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) +``` + + + +*See {IGovernor-propose}.* + +#### 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 proposalId) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | 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) +``` + +module:user-config + +*Minimum number of cast voted required for a proposal to be successful. NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| timepoint | uint256 | undefined | + +#### 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) +``` + + + +*See {IGovernor-state}.* + +#### 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) +``` + + + +*See {IERC165-supportsInterface}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### timelock + +```solidity +function timelock() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | 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 | + +### 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/elin/contracts-upgradeable/governance/compatibility/IGovernorCompatibilityBravoUpgradeable.md b/docs/elin/contracts-upgradeable/governance/compatibility/IGovernorCompatibilityBravoUpgradeable.md new file mode 100644 index 00000000..be9f9a29 --- /dev/null +++ b/docs/elin/contracts-upgradeable/governance/compatibility/IGovernorCompatibilityBravoUpgradeable.md @@ -0,0 +1,848 @@ +# IGovernorCompatibilityBravoUpgradeable + + + + + + + +*Interface extension that adds missing functions to the {Governor} core to provide `GovernorBravo` compatibility. _Available since v4.3._* + +## Methods + +### CLOCK_MODE + +```solidity +function CLOCK_MODE() external view returns (string) +``` + +module:core + +*See EIP-6372.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### COUNTING_MODE + +```solidity +function COUNTING_MODE() external view 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 | + +### cancel + +```solidity +function cancel(uint256 proposalId) external nonpayable +``` + + + +*Cancels a proposal only if the sender is the proposer or the proposer delegates' voting power dropped below the proposal threshold.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### cancel + +```solidity +function cancel(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external nonpayable returns (uint256 proposalId) +``` + + + +*Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e. before the vote starts. Emits a {ProposalCanceled} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### castVote + +```solidity +function castVote(uint256 proposalId, uint8 support) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote Emits a {VoteCast} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteBySig + +```solidity +function castVoteBySig(uint256 proposalId, uint8 support, uint8 v, bytes32 r, bytes32 s) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote using the user's cryptographic signature. Emits a {VoteCast} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| v | uint8 | undefined | +| r | bytes32 | undefined | +| s | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteWithReason + +```solidity +function castVoteWithReason(uint256 proposalId, uint8 support, string reason) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote with a reason Emits a {VoteCast} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| reason | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteWithReasonAndParams + +```solidity +function castVoteWithReasonAndParams(uint256 proposalId, uint8 support, string reason, bytes params) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote with a reason and additional encoded parameters Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| reason | string | undefined | +| params | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteWithReasonAndParamsBySig + +```solidity +function castVoteWithReasonAndParamsBySig(uint256 proposalId, uint8 support, string reason, bytes params, uint8 v, bytes32 r, bytes32 s) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote with a reason and additional encoded parameters using the user's cryptographic signature. Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.* + +#### 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 | +|---|---|---| +| balance | uint256 | undefined | + +### clock + +```solidity +function clock() external view returns (uint48) +``` + +module:core + +*See {IERC6372}* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint48 | undefined | + +### execute + +```solidity +function execute(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external payable returns (uint256 proposalId) +``` + + + +*Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the deadline to be reached. Emits a {ProposalExecuted} event. Note: some module can modify the requirements for execution, for example by adding an additional timelock.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### execute + +```solidity +function execute(uint256 proposalId) external payable +``` + + + +*Part of the Governor Bravo's interface: _"Executes a queued proposal if eta has passed"_.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### getActions + +```solidity +function getActions(uint256 proposalId) external view returns (address[] targets, uint256[] values, string[] signatures, bytes[] calldatas) +``` + + + +*Part of the Governor Bravo's interface: _"Gets actions of a proposal"_.* + +#### 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) +``` + + + +*Part of the Governor Bravo's interface: _"Gets the receipt for a voter on a given proposal"_.* + +#### 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) +``` + +module:reputation + +*Voting power of an `account` at a specific `timepoint`. Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or multiple), {ERC20Votes} tokens.* + +#### 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) +``` + +module:reputation + +*Voting power of an `account` at a specific `timepoint` given additional encoded parameters.* + +#### 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) +``` + +module:voting + +*Returns whether `account` has cast a vote on `proposalId`.* + +#### 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) +``` + +module:core + +*Hashing function used to (re)build the proposal id from the proposal details..* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### name + +```solidity +function name() external view returns (string) +``` + +module:core + +*Name of the governor instance (used in building the ERC712 domain separator).* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### proposalDeadline + +```solidity +function proposalDeadline(uint256 proposalId) external view returns (uint256) +``` + +module:core + +*Timepoint at which votes close. If using block number, votes close at the end of this block, so it is possible to cast a vote during this block.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### proposalProposer + +```solidity +function proposalProposer(uint256 proposalId) external view returns (address) +``` + +module:core + +*The account that created a 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) +``` + +module:core + +*Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the following block.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### proposals + +```solidity +function proposals(uint256) external view returns (uint256 id, address proposer, uint256 eta, uint256 startBlock, uint256 endBlock, uint256 forVotes, uint256 againstVotes, uint256 abstainVotes, bool canceled, bool executed) +``` + + + +*Part of the Governor Bravo's interface: _"The official record of all proposals ever proposed"_.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | 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 proposalId) +``` + + + +*Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a duration specified by {IGovernor-votingPeriod}. Emits a {ProposalCreated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| description | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### propose + +```solidity +function propose(address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, string description) external nonpayable returns (uint256) +``` + + + +*Part of the Governor Bravo's interface: _"Function used to propose a new proposal"_.* + +#### 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(uint256 proposalId) external nonpayable +``` + + + +*Part of the Governor Bravo's interface: _"Queues a proposal of state succeeded"_.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### quorum + +```solidity +function quorum(uint256 timepoint) external view returns (uint256) +``` + +module:user-config + +*Minimum number of cast voted required for a proposal to be successful. NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| timepoint | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### quorumVotes + +```solidity +function quorumVotes() external view returns (uint256) +``` + + + +*Part of the Governor Bravo's interface.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### state + +```solidity +function state(uint256 proposalId) external view returns (enum IGovernorUpgradeable.ProposalState) +``` + +module:core + +*Current state of a proposal, following Compound's convention* + +#### 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) +``` + + + +*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 | + +### version + +```solidity +function version() external view returns (string) +``` + +module:core + +*Version of the governor instance (used in building the ERC712 domain separator). Default: "1"* + + +#### 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 + +### 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 | + +### 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 | + + + diff --git a/docs/elin/contracts-upgradeable/governance/extensions/GovernorTimelockControlUpgradeable.md b/docs/elin/contracts-upgradeable/governance/extensions/GovernorTimelockControlUpgradeable.md new file mode 100644 index 00000000..b7df2a4a --- /dev/null +++ b/docs/elin/contracts-upgradeable/governance/extensions/GovernorTimelockControlUpgradeable.md @@ -0,0 +1,986 @@ +# GovernorTimelockControlUpgradeable + + + + + + + +*Extension of {Governor} that binds the execution process to an instance of {TimelockController}. This adds a delay, enforced by the {TimelockController} to all successful proposal (in addition to the voting duration). The {Governor} needs the proposer (and ideally the executor) roles for the {Governor} to work properly. Using this model means the proposal will be operated by the {TimelockController} and not by the {Governor}. Thus, the assets and permissions must be attached to the {TimelockController}. Any asset sent to the {Governor} will be inaccessible. WARNING: Setting up the TimelockController to have additional proposers besides the governor is very risky, as it grants them powers that they must be trusted or known not to use: 1) {onlyGovernance} functions like {relay} are available to them through the timelock, and 2) approved governance proposals can be blocked by them, effectively executing a Denial of Service attack. This risk will be mitigated in a future release. _Available since v4.3._* + +## 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) +``` + +module:core + +*See EIP-6372.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### COUNTING_MODE + +```solidity +function COUNTING_MODE() external view 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(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-cancel}.* + +#### 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) +``` + +module:core + +*See {IERC6372}* + + +#### 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 | + +### 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) +``` + +module:voting + +*Returns whether `account` has cast a vote on `proposalId`.* + +#### 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 | + +### 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 | + +### propose + +```solidity +function propose(address[] targets, uint256[] values, bytes[] calldatas, string description) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-propose}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | 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 | + +### quorum + +```solidity +function quorum(uint256 timepoint) external view returns (uint256) +``` + +module:user-config + +*Minimum number of cast voted required for a proposal to be successful. NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| timepoint | uint256 | undefined | + +#### 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) +``` + + + +*Overridden version of the {Governor-state} function with added support for the `Queued` state.* + +#### 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) +``` + + + +*See {IERC165-supportsInterface}.* + +#### 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 | + +### 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 | + +### 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/elin/contracts-upgradeable/governance/extensions/GovernorVotesQuorumFractionUpgradeable.md b/docs/elin/contracts-upgradeable/governance/extensions/GovernorVotesQuorumFractionUpgradeable.md new file mode 100644 index 00000000..f9f38ada --- /dev/null +++ b/docs/elin/contracts-upgradeable/governance/extensions/GovernorVotesQuorumFractionUpgradeable.md @@ -0,0 +1,978 @@ +# GovernorVotesQuorumFractionUpgradeable + + + + + + + +*Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a fraction of the total supply. _Available since v4.3._* + +## 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 view 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(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-cancel}.* + +#### 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 | + +### 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) +``` + +module:voting + +*Returns whether `account` has cast a vote on `proposalId`.* + +#### 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 | + +### 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 | + +### 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 | + +### propose + +```solidity +function propose(address[] targets, uint256[] values, bytes[] calldatas, string description) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-propose}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| description | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | 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 | + +### 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) +``` + + + +*See {IGovernor-state}.* + +#### 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) +``` + + + +*See {IERC165-supportsInterface}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | 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 | + +### 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 | + +### QuorumNumeratorUpdated + +```solidity +event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| oldQuorumNumerator | uint256 | undefined | +| newQuorumNumerator | uint256 | 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/elin/contracts-upgradeable/governance/extensions/GovernorVotesUpgradeable.md b/docs/elin/contracts-upgradeable/governance/extensions/GovernorVotesUpgradeable.md new file mode 100644 index 00000000..0f54f4ac --- /dev/null +++ b/docs/elin/contracts-upgradeable/governance/extensions/GovernorVotesUpgradeable.md @@ -0,0 +1,889 @@ +# GovernorVotesUpgradeable + + + + + + + +*Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes} token. _Available since v4.3._* + +## 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 view 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(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-cancel}.* + +#### 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 | + +### 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) +``` + +module:voting + +*Returns whether `account` has cast a vote on `proposalId`.* + +#### 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 | + +### 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 | + +### 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 | + +### propose + +```solidity +function propose(address[] targets, uint256[] values, bytes[] calldatas, string description) external nonpayable returns (uint256) +``` + + + +*See {IGovernor-propose}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| description | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### quorum + +```solidity +function quorum(uint256 timepoint) external view returns (uint256) +``` + +module:user-config + +*Minimum number of cast voted required for a proposal to be successful. NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| timepoint | uint256 | undefined | + +#### 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) +``` + + + +*See {IGovernor-state}.* + +#### 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) +``` + + + +*See {IERC165-supportsInterface}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### token + +```solidity +function token() external view returns (contract IERC5805Upgradeable) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | contract IERC5805Upgradeable | 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 | + +### 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/elin/contracts-upgradeable/governance/extensions/IGovernorTimelockUpgradeable.md b/docs/elin/contracts-upgradeable/governance/extensions/IGovernorTimelockUpgradeable.md new file mode 100644 index 00000000..342ea9df --- /dev/null +++ b/docs/elin/contracts-upgradeable/governance/extensions/IGovernorTimelockUpgradeable.md @@ -0,0 +1,759 @@ +# IGovernorTimelockUpgradeable + + + + + + + +*Extension of the {IGovernor} for timelock supporting modules. _Available since v4.3._* + +## Methods + +### CLOCK_MODE + +```solidity +function CLOCK_MODE() external view returns (string) +``` + +module:core + +*See EIP-6372.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### COUNTING_MODE + +```solidity +function COUNTING_MODE() external view 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 | + +### cancel + +```solidity +function cancel(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external nonpayable returns (uint256 proposalId) +``` + + + +*Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e. before the vote starts. Emits a {ProposalCanceled} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### castVote + +```solidity +function castVote(uint256 proposalId, uint8 support) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote Emits a {VoteCast} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteBySig + +```solidity +function castVoteBySig(uint256 proposalId, uint8 support, uint8 v, bytes32 r, bytes32 s) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote using the user's cryptographic signature. Emits a {VoteCast} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| v | uint8 | undefined | +| r | bytes32 | undefined | +| s | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteWithReason + +```solidity +function castVoteWithReason(uint256 proposalId, uint8 support, string reason) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote with a reason Emits a {VoteCast} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| reason | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteWithReasonAndParams + +```solidity +function castVoteWithReasonAndParams(uint256 proposalId, uint8 support, string reason, bytes params) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote with a reason and additional encoded parameters Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | +| support | uint8 | undefined | +| reason | string | undefined | +| params | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| balance | uint256 | undefined | + +### castVoteWithReasonAndParamsBySig + +```solidity +function castVoteWithReasonAndParamsBySig(uint256 proposalId, uint8 support, string reason, bytes params, uint8 v, bytes32 r, bytes32 s) external nonpayable returns (uint256 balance) +``` + + + +*Cast a vote with a reason and additional encoded parameters using the user's cryptographic signature. Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.* + +#### 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 | +|---|---|---| +| balance | uint256 | undefined | + +### clock + +```solidity +function clock() external view returns (uint48) +``` + +module:core + +*See {IERC6372}* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint48 | undefined | + +### execute + +```solidity +function execute(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external payable returns (uint256 proposalId) +``` + + + +*Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the deadline to be reached. Emits a {ProposalExecuted} event. Note: some module can modify the requirements for execution, for example by adding an additional timelock.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### getVotes + +```solidity +function getVotes(address account, uint256 timepoint) external view returns (uint256) +``` + +module:reputation + +*Voting power of an `account` at a specific `timepoint`. Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or multiple), {ERC20Votes} tokens.* + +#### 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) +``` + +module:reputation + +*Voting power of an `account` at a specific `timepoint` given additional encoded parameters.* + +#### 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) +``` + +module:voting + +*Returns whether `account` has cast a vote on `proposalId`.* + +#### 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) +``` + +module:core + +*Hashing function used to (re)build the proposal id from the proposal details..* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### name + +```solidity +function name() external view returns (string) +``` + +module:core + +*Name of the governor instance (used in building the ERC712 domain separator).* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### proposalDeadline + +```solidity +function proposalDeadline(uint256 proposalId) external view returns (uint256) +``` + +module:core + +*Timepoint at which votes close. If using block number, votes close at the end of this block, so it is possible to cast a vote during this block.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### proposalEta + +```solidity +function proposalEta(uint256 proposalId) external view returns (uint256) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### proposalProposer + +```solidity +function proposalProposer(uint256 proposalId) external view returns (address) +``` + +module:core + +*The account that created a 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) +``` + +module:core + +*Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the following block.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### propose + +```solidity +function propose(address[] targets, uint256[] values, bytes[] calldatas, string description) external nonpayable returns (uint256 proposalId) +``` + + + +*Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a duration specified by {IGovernor-votingPeriod}. Emits a {ProposalCreated} event.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| description | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### queue + +```solidity +function queue(address[] targets, uint256[] values, bytes[] calldatas, bytes32 descriptionHash) external nonpayable returns (uint256 proposalId) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| targets | address[] | undefined | +| values | uint256[] | undefined | +| calldatas | bytes[] | undefined | +| descriptionHash | bytes32 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| proposalId | uint256 | undefined | + +### quorum + +```solidity +function quorum(uint256 timepoint) external view returns (uint256) +``` + +module:user-config + +*Minimum number of cast voted required for a proposal to be successful. NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| timepoint | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### state + +```solidity +function state(uint256 proposalId) external view returns (enum IGovernorUpgradeable.ProposalState) +``` + +module:core + +*Current state of a proposal, following Compound's convention* + +#### 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) +``` + + + +*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 | + +### timelock + +```solidity +function timelock() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### version + +```solidity +function version() external view returns (string) +``` + +module:core + +*Version of the governor instance (used in building the ERC712 domain separator). Default: "1"* + + +#### 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 + +### 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 | + +### 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 | + + + diff --git a/docs/elin/contracts-upgradeable/governance/utils/IVotesUpgradeable.md b/docs/elin/contracts-upgradeable/governance/utils/IVotesUpgradeable.md new file mode 100644 index 00000000..13b44810 --- /dev/null +++ b/docs/elin/contracts-upgradeable/governance/utils/IVotesUpgradeable.md @@ -0,0 +1,180 @@ +# IVotesUpgradeable + + + + + + + +*Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts. _Available since v4.5._* + +## Methods + +### delegate + +```solidity +function delegate(address delegatee) external nonpayable +``` + + + +*Delegates 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) +``` + + + +*Returns the delegate that `account` has chosen.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### getPastTotalSupply + +```solidity +function getPastTotalSupply(uint256 timepoint) external view returns (uint256) +``` + + + +*Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote.* + +#### 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) +``` + + + +*Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block.* + +#### 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) +``` + + + +*Returns the current amount of votes that `account` has.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + + + +## Events + +### DelegateChanged + +```solidity +event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +``` + + + +*Emitted when an account changes their delegate.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| delegator `indexed` | address | undefined | +| fromDelegate `indexed` | address | undefined | +| toDelegate `indexed` | address | undefined | + +### DelegateVotesChanged + +```solidity +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 | + + + diff --git a/docs/elin/contracts-upgradeable/interfaces/IERC5267Upgradeable.md b/docs/elin/contracts-upgradeable/interfaces/IERC5267Upgradeable.md new file mode 100644 index 00000000..4a98dd38 --- /dev/null +++ b/docs/elin/contracts-upgradeable/interfaces/IERC5267Upgradeable.md @@ -0,0 +1,52 @@ +# IERC5267Upgradeable + + + + + + + + + +## Methods + +### eip712Domain + +```solidity +function eip712Domain() external view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions) +``` + + + +*returns the fields and values that describe the domain separator used by this contract for EIP-712 signature.* + + +#### 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 | + + + +## Events + +### EIP712DomainChanged + +```solidity +event EIP712DomainChanged() +``` + + + +*MAY be emitted to signal that the domain could have changed.* + + + + diff --git a/docs/elin/contracts-upgradeable/interfaces/IERC5805Upgradeable.md b/docs/elin/contracts-upgradeable/interfaces/IERC5805Upgradeable.md new file mode 100644 index 00000000..69a34197 --- /dev/null +++ b/docs/elin/contracts-upgradeable/interfaces/IERC5805Upgradeable.md @@ -0,0 +1,214 @@ +# IERC5805Upgradeable + + + + + + + + + +## Methods + +### CLOCK_MODE + +```solidity +function CLOCK_MODE() external view returns (string) +``` + + + +*Description of the clock* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | 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 | + +### delegate + +```solidity +function delegate(address delegatee) external nonpayable +``` + + + +*Delegates 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) +``` + + + +*Returns the delegate that `account` has chosen.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### getPastTotalSupply + +```solidity +function getPastTotalSupply(uint256 timepoint) external view returns (uint256) +``` + + + +*Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote.* + +#### 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) +``` + + + +*Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block.* + +#### 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) +``` + + + +*Returns the current amount of votes that `account` has.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + + + +## Events + +### DelegateChanged + +```solidity +event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +``` + + + +*Emitted when an account changes their delegate.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| delegator `indexed` | address | undefined | +| fromDelegate `indexed` | address | undefined | +| toDelegate `indexed` | address | undefined | + +### DelegateVotesChanged + +```solidity +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 | + + + diff --git a/docs/elin/contracts-upgradeable/interfaces/IERC6372Upgradeable.md b/docs/elin/contracts-upgradeable/interfaces/IERC6372Upgradeable.md new file mode 100644 index 00000000..14e52cd1 --- /dev/null +++ b/docs/elin/contracts-upgradeable/interfaces/IERC6372Upgradeable.md @@ -0,0 +1,49 @@ +# IERC6372Upgradeable + + + + + + + + + +## Methods + +### CLOCK_MODE + +```solidity +function CLOCK_MODE() external view returns (string) +``` + + + +*Description of the clock* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | 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 | + + + + diff --git a/docs/elin/contracts-upgradeable/proxy/utils/Initializable.md b/docs/elin/contracts-upgradeable/proxy/utils/Initializable.md index 0421ee00..ce0c9698 100644 --- a/docs/elin/contracts-upgradeable/proxy/utils/Initializable.md +++ b/docs/elin/contracts-upgradeable/proxy/utils/Initializable.md @@ -6,7 +6,7 @@ -*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] ```* +*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] ```solidity 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 diff --git a/docs/elin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.md b/docs/elin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.md index e7bc3ff0..9fc03fb9 100644 --- a/docs/elin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.md +++ b/docs/elin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.md @@ -6,7 +6,7 @@ -*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}.* +*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]. The default value of {decimals} is 18. To change this, you should override this function so it returns a different value. We have followed general OpenZeppelin Contracts guidelines: functions revert instead returning `false` on failure. This behavior is nonetheless conventional and does not conflict with the expectations of ERC20 applications. Additionally, an {Approval} event is emitted on calls to {transferFrom}. This allows applications to reconstruct the allowance for all accounts just by listening to said events. Other implementations of the EIP may not emit these events, as it isn't required by the specification. Finally, the non-standard {decreaseAllowance} and {increaseAllowance} functions have been added to mitigate the well-known issues around setting allowances. See {IERC20-approve}.* ## Methods @@ -86,7 +86,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 diff --git a/docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.md b/docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.md similarity index 68% rename from docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.md rename to docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.md index 6541976a..1225c252 100644 --- a/docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.md +++ b/docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.md @@ -1,4 +1,4 @@ -# ERC20SnapshotUpgradeable +# ERC20PermitUpgradeable @@ -6,10 +6,27 @@ -*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.* +*Implementation 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. _Available since v3.4._* ## Methods +### DOMAIN_SEPARATOR + +```solidity +function DOMAIN_SEPARATOR() external view returns (bytes32) +``` + + + +*See {IERC20Permit-DOMAIN_SEPARATOR}.* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + ### allowance ```solidity @@ -78,29 +95,6 @@ function balanceOf(address account) external view returns (uint256) |---|---|---| | _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 @@ -109,7 +103,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 @@ -141,6 +135,29 @@ function decreaseAllowance(address spender, uint256 subtractedValue) external no |---|---|---| | _0 | bool | 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 | + ### increaseAllowance ```solidity @@ -181,55 +198,77 @@ function name() external view returns (string) |---|---|---| | _0 | string | undefined | -### symbol +### nonces ```solidity -function symbol() external view returns (string) +function nonces(address owner) external view returns (uint256) ``` -*Returns the symbol of the token, usually a shorter version of the name.* +*See {IERC20Permit-nonces}.* + +#### Parameters +| Name | Type | Description | +|---|---|---| +| owner | address | undefined | #### Returns | Name | Type | Description | |---|---|---| -| _0 | string | undefined | +| _0 | uint256 | undefined | -### totalSupply +### permit ```solidity -function totalSupply() external view returns (uint256) +function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable ``` -*See {IERC20-totalSupply}.* - +*See {IERC20Permit-permit}.* -#### Returns +#### Parameters | Name | Type | Description | |---|---|---| -| _0 | uint256 | undefined | +| owner | address | undefined | +| spender | address | undefined | +| value | uint256 | undefined | +| deadline | uint256 | undefined | +| v | uint8 | undefined | +| r | bytes32 | undefined | +| s | bytes32 | undefined | -### totalSupplyAt +### symbol ```solidity -function totalSupplyAt(uint256 snapshotId) external view returns (uint256) +function symbol() external view returns (string) ``` -*Retrieves the total supply at the time `snapshotId` was created.* +*Returns the symbol of the token, usually a shorter version of the name.* -#### Parameters + +#### Returns | Name | Type | Description | |---|---|---| -| snapshotId | uint256 | undefined | +| _0 | string | undefined | + +### totalSupply + +```solidity +function totalSupply() external view returns (uint256) +``` + + + +*See {IERC20-totalSupply}.* + #### Returns @@ -306,37 +345,32 @@ event Approval(address indexed owner, address indexed spender, uint256 value) | spender `indexed` | address | undefined | | value | uint256 | undefined | -### Initialized +### EIP712DomainChanged ```solidity -event Initialized(uint8 version) +event EIP712DomainChanged() ``` -*Triggered when the contract has been initialized or reinitialized.* +*MAY be emitted to signal that the domain could have changed.* -#### Parameters -| Name | Type | Description | -|---|---|---| -| version | uint8 | undefined | - -### Snapshot +### Initialized ```solidity -event Snapshot(uint256 id) +event Initialized(uint8 version) ``` -*Emitted by {_snapshot} when a snapshot identified by `id` is created.* +*Triggered when the contract has been initialized or reinitialized.* #### Parameters | Name | Type | Description | |---|---|---| -| id | uint256 | undefined | +| version | uint8 | undefined | ### Transfer diff --git a/docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpgradeable.md b/docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpgradeable.md new file mode 100644 index 00000000..6f536b78 --- /dev/null +++ b/docs/elin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpgradeable.md @@ -0,0 +1,635 @@ +# ERC20VotesUpgradeable + + + + + + + +*Extension of ERC20 to support Compound-like voting and delegation. This version is more generic than Compound's, and supports token supply up to 2^224^ - 1, while COMP is limited to 2^96^ - 1. NOTE: If exact COMP compatibility is required, use the {ERC20VotesComp} variant of this module. This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting power can be queried through the public accessors {getVotes} and {getPastVotes}. By default, token balance does not account for voting power. This makes transfers cheaper. The downside is that it requires users to delegate to themselves in order to activate checkpoints and have their voting power tracked. _Available since v4.2._* + +## Methods + +### CLOCK_MODE + +```solidity +function CLOCK_MODE() external view returns (string) +``` + + + +*Description of the clock* + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### DOMAIN_SEPARATOR + +```solidity +function DOMAIN_SEPARATOR() external view returns (bytes32) +``` + + + +*See {IERC20Permit-DOMAIN_SEPARATOR}.* + + +#### 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 | + +### 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 | + +### 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 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 + +| 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 | + +### 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 | + +### 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 +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 | + +### 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 | + +### 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 | + +### 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 | + +### DelegateChanged + +```solidity +event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +``` + + + +*Emitted when an account changes their delegate.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| delegator `indexed` | address | undefined | +| fromDelegate `indexed` | address | undefined | +| toDelegate `indexed` | address | undefined | + +### DelegateVotesChanged + +```solidity +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 | +|---|---|---| +| 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/ERC721/IERC721Upgradeable.md b/docs/elin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.md index 6283bfe3..b57e419f 100644 --- a/docs/elin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.md +++ b/docs/elin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.md @@ -156,7 +156,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 ``` @@ -168,7 +168,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/elin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.md b/docs/elin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.md index 3d4830e1..a4815ca2 100644 --- a/docs/elin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.md +++ b/docs/elin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.md @@ -173,7 +173,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 ``` @@ -185,7 +185,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/elin/contracts-upgradeable/utils/CheckpointsUpgradeable.md b/docs/elin/contracts-upgradeable/utils/CheckpointsUpgradeable.md new file mode 100644 index 00000000..deab3eb5 --- /dev/null +++ b/docs/elin/contracts-upgradeable/utils/CheckpointsUpgradeable.md @@ -0,0 +1,12 @@ +# CheckpointsUpgradeable + + + + + + + +*This library defines the `History` struct, for checkpointing values as they change at different points in time, and later looking up past values by block number. See {Votes} as an example. To create a history of checkpoints define a variable type `Checkpoints.History` in your contract, and store a new checkpoint for the current transaction block using the {push} function. _Available since v4.5._* + + + diff --git a/docs/elin/contracts-upgradeable/utils/StorageSlotUpgradeable.md b/docs/elin/contracts-upgradeable/utils/StorageSlotUpgradeable.md index 3c517200..9afa5dbf 100644 --- a/docs/elin/contracts-upgradeable/utils/StorageSlotUpgradeable.md +++ b/docs/elin/contracts-upgradeable/utils/StorageSlotUpgradeable.md @@ -6,7 +6,7 @@ -*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`._* +*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: ```solidity 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`, `uint256`._ _Available since v4.9 for `string`, `bytes`._* diff --git a/docs/elin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.md b/docs/elin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.md new file mode 100644 index 00000000..5035a7b7 --- /dev/null +++ b/docs/elin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.md @@ -0,0 +1,12 @@ +# ECDSAUpgradeable + + + + + + + +*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-upgradeable/utils/cryptography/EIP712Upgradeable.md b/docs/elin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.md new file mode 100644 index 00000000..3dae7527 --- /dev/null +++ b/docs/elin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.md @@ -0,0 +1,68 @@ +# EIP712Upgradeable + + + + + + + +*https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in their contracts using a combination of `abi.encode` and `keccak256`. This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA ({_hashTypedDataV4}). The implementation of the domain separator was designed to be as efficient as possible while still properly updating the chain id to protect against replay attacks on an eventual fork of the chain. NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the separator from the immutable values, which is cheaper than accessing a cached version in cold storage. _Available since v3.4._* + +## Methods + +### 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 | + + + +## 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 | + + + diff --git a/docs/elin/contracts-upgradeable/utils/math/SafeCastUpgradeable.md b/docs/elin/contracts-upgradeable/utils/math/SafeCastUpgradeable.md new file mode 100644 index 00000000..c09bb4d0 --- /dev/null +++ b/docs/elin/contracts-upgradeable/utils/math/SafeCastUpgradeable.md @@ -0,0 +1,12 @@ +# SafeCastUpgradeable + + + + + + + +*Wrappers over Solidity's uintXX/intXX casting operators with added overflow checks. Downcasting from uint256/int256 in Solidity does not revert on overflow. This can easily result in undesired exploitation or bugs, since developers usually assume that overflows raise errors. `SafeCast` restores this intuition by reverting the transaction when such an operation overflows. Using this library instead of the unchecked operations eliminates an entire class of bugs, so it's recommended to use it always. Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing all math on `uint256` and `int256` and then downcasting.* + + + diff --git a/docs/elin/contracts-upgradeable/utils/math/SignedMathUpgradeable.md b/docs/elin/contracts-upgradeable/utils/math/SignedMathUpgradeable.md new file mode 100644 index 00000000..ef6601f9 --- /dev/null +++ b/docs/elin/contracts-upgradeable/utils/math/SignedMathUpgradeable.md @@ -0,0 +1,12 @@ +# SignedMathUpgradeable + + + + + + + +*Standard signed math utilities missing in the Solidity language.* + + + diff --git a/docs/elin/contracts-upgradeable/utils/structs/DoubleEndedQueueUpgradeable.md b/docs/elin/contracts-upgradeable/utils/structs/DoubleEndedQueueUpgradeable.md new file mode 100644 index 00000000..402ce27b --- /dev/null +++ b/docs/elin/contracts-upgradeable/utils/structs/DoubleEndedQueueUpgradeable.md @@ -0,0 +1,37 @@ +# DoubleEndedQueueUpgradeable + + + + + + + +*A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that the existing queue contents are left in storage. The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be used in storage, and not in memory. ```solidity DoubleEndedQueue.Bytes32Deque queue; ``` _Available since v4.6._* + + + +## Errors + +### Empty + +```solidity +error Empty() +``` + + + +*An operation (e.g. {front}) couldn't be completed due to the queue being empty.* + + +### OutOfBounds + +```solidity +error OutOfBounds() +``` + + + +*An operation (e.g. {at}) couldn't be completed due to an index being out of bounds.* + + + diff --git a/docs/elin/contracts/access/AccessControl.md b/docs/elin/contracts/access/AccessControl.md index 2b15d198..17b27833 100644 --- a/docs/elin/contracts/access/AccessControl.md +++ b/docs/elin/contracts/access/AccessControl.md @@ -6,7 +6,7 @@ -*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.* +*Contract module that allows children to implement role-based access control mechanisms. This is a lightweight version that doesn't allow enumerating role members except through off-chain means by accessing the contract event logs. Some applications may benefit from on-chain enumerability, for those cases see {AccessControlEnumerable}. Roles are referred to by their `bytes32` identifier. These should be exposed in the external API and be unique. The best way to achieve this is by using `public constant` hash digests: ```solidity bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); ``` Roles can be used to represent a set of permissions. To restrict access to a function call, use {hasRole}: ```solidity function foo() public { require(hasRole(MY_ROLE, msg.sender)); ... } ``` Roles can be granted and revoked dynamically via the {grantRole} and {revokeRole} functions. Each role has an associated admin role, and only accounts that have a role's admin role can call {grantRole} and {revokeRole}. By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means that only accounts with this role will be able to grant or revoke other roles. More complex role relationships can be created by using {_setRoleAdmin}. WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to grant and revoke this role. Extra precautions should be taken to secure accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} to enforce additional security measures for this role.* ## Methods diff --git a/docs/elin/contracts/access/Ownable.md b/docs/elin/contracts/access/Ownable.md index ac397342..5f4f59c9 100644 --- a/docs/elin/contracts/access/Ownable.md +++ b/docs/elin/contracts/access/Ownable.md @@ -35,7 +35,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 diff --git a/docs/elin/contracts/access/Ownable2Step.md b/docs/elin/contracts/access/Ownable2Step.md index 9ea49e81..7bc13e67 100644 --- a/docs/elin/contracts/access/Ownable2Step.md +++ b/docs/elin/contracts/access/Ownable2Step.md @@ -63,7 +63,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 diff --git a/docs/elin/contracts/proxy/utils/Initializable.md b/docs/elin/contracts/proxy/utils/Initializable.md index 0421ee00..ce0c9698 100644 --- a/docs/elin/contracts/proxy/utils/Initializable.md +++ b/docs/elin/contracts/proxy/utils/Initializable.md @@ -6,7 +6,7 @@ -*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] ```* +*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] ```solidity 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 diff --git a/docs/elin/contracts/token/ERC20/ERC20.md b/docs/elin/contracts/token/ERC20/ERC20.md index 35250e1b..1914953b 100644 --- a/docs/elin/contracts/token/ERC20/ERC20.md +++ b/docs/elin/contracts/token/ERC20/ERC20.md @@ -6,7 +6,7 @@ -*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}.* +*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]. The default value of {decimals} is 18. To change this, you should override this function so it returns a different value. We have followed general OpenZeppelin Contracts guidelines: functions revert instead returning `false` on failure. This behavior is nonetheless conventional and does not conflict with the expectations of ERC20 applications. Additionally, an {Approval} event is emitted on calls to {transferFrom}. This allows applications to reconstruct the allowance for all accounts just by listening to said events. Other implementations of the EIP may not emit these events, as it isn't required by the specification. Finally, the non-standard {decreaseAllowance} and {increaseAllowance} functions have been added to mitigate the well-known issues around setting allowances. See {IERC20-approve}.* ## Methods @@ -86,7 +86,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 diff --git a/docs/elin/contracts/token/ERC20/extensions/ERC20Burnable.md b/docs/elin/contracts/token/ERC20/extensions/ERC20Burnable.md index 0dfd97fe..3359f052 100644 --- a/docs/elin/contracts/token/ERC20/extensions/ERC20Burnable.md +++ b/docs/elin/contracts/token/ERC20/extensions/ERC20Burnable.md @@ -119,7 +119,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 diff --git a/docs/elin/contracts/token/ERC20/extensions/ERC20Pausable.md b/docs/elin/contracts/token/ERC20/extensions/ERC20Pausable.md index 083f2106..ccd077ce 100644 --- a/docs/elin/contracts/token/ERC20/extensions/ERC20Pausable.md +++ b/docs/elin/contracts/token/ERC20/extensions/ERC20Pausable.md @@ -86,7 +86,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 diff --git a/docs/elin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.md b/docs/elin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.md index 7b0b4275..46df8a50 100644 --- a/docs/elin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.md +++ b/docs/elin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.md @@ -170,7 +170,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 diff --git a/docs/elin/contracts/token/ERC721/IERC721.md b/docs/elin/contracts/token/ERC721/IERC721.md index f9ba6fe1..5a0799da 100644 --- a/docs/elin/contracts/token/ERC721/IERC721.md +++ b/docs/elin/contracts/token/ERC721/IERC721.md @@ -156,7 +156,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 ``` @@ -168,7 +168,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/elin/contracts/token/ERC721/extensions/IERC721Enumerable.md b/docs/elin/contracts/token/ERC721/extensions/IERC721Enumerable.md index 0e37607c..191b1714 100644 --- a/docs/elin/contracts/token/ERC721/extensions/IERC721Enumerable.md +++ b/docs/elin/contracts/token/ERC721/extensions/IERC721Enumerable.md @@ -156,7 +156,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 ``` @@ -168,7 +168,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/elin/contracts/token/ERC721/extensions/IERC721Metadata.md b/docs/elin/contracts/token/ERC721/extensions/IERC721Metadata.md index 4bbbadc7..a6560b0c 100644 --- a/docs/elin/contracts/token/ERC721/extensions/IERC721Metadata.md +++ b/docs/elin/contracts/token/ERC721/extensions/IERC721Metadata.md @@ -173,7 +173,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 ``` @@ -185,7 +185,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/elin/contracts/utils/math/SignedMath.md b/docs/elin/contracts/utils/math/SignedMath.md new file mode 100644 index 00000000..35f29531 --- /dev/null +++ b/docs/elin/contracts/utils/math/SignedMath.md @@ -0,0 +1,12 @@ +# SignedMath + + + + + + + +*Standard signed 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 index 3fffb679..dda04089 100644 --- a/docs/elin/contracts/utils/structs/EnumerableSet.md +++ b/docs/elin/contracts/utils/structs/EnumerableSet.md @@ -6,7 +6,7 @@ -*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. ====* +*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. ```solidity 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/IChildERC721.md b/docs/interfaces/child/IChildERC721.md index 93c78ceb..ba98b7d8 100644 --- a/docs/interfaces/child/IChildERC721.md +++ b/docs/interfaces/child/IChildERC721.md @@ -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/validator/IValidatorSet.md b/docs/interfaces/child/validator/IValidatorSet.md index 504c3d09..fb4e94b2 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 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/mocks/MockERC20.md b/docs/mocks/MockERC20.md index d6908dd7..92d02328 100644 --- a/docs/mocks/MockERC20.md +++ b/docs/mocks/MockERC20.md @@ -170,7 +170,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 diff --git a/docs/root/staking/CustomSupernetManager.md b/docs/root/staking/CustomSupernetManager.md index 10259e78..4e446511 100644 --- a/docs/root/staking/CustomSupernetManager.md +++ b/docs/root/staking/CustomSupernetManager.md @@ -265,7 +265,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 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]);