polkamarkets-js 3.4.0 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abis/PredictionMarketV3Querier.json +1 -1
- package/contracts/PredictionMarketV3Querier.sol +4 -2
- package/package.json +1 -1
- package/src/models/PredictionMarketV3Contract.js +51 -17
- package/abis/AddAdminToLand.json +0 -1
- package/abis/ClaimMerkleRoot.json +0 -1
- package/abis/CreateLand.json +0 -1
- package/abis/CreateMarkets.json +0 -1
- package/abis/DeployContracts.json +0 -1
- package/abis/DeployMerkleRewardsDistributor.json +0 -1
- package/abis/DeployToken.json +0 -1
- package/abis/DeployUSDT.json +0 -1
- package/abis/MintTokens.json +0 -1
- package/abis/PublishMerkleRoot.json +0 -1
- package/abis/ResolveMarket.json +0 -1
- package/abis/TradeMarket.json +0 -1
- package/abis/USDT.json +0 -1
- package/lib/openzeppelin-contracts/contracts/mocks/docs/ERC20WithAutoMinerReward.sol +0 -22
- package/lib/openzeppelin-contracts/contracts/mocks/docs/ERC4626Fees.sol +0 -109
- package/lib/openzeppelin-contracts/contracts/mocks/docs/MyNFT.sol +0 -9
- package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlERC20MintBase.sol +0 -25
- package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlERC20MintMissing.sol +0 -24
- package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlERC20MintOnlyRole.sol +0 -23
- package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlModified.sol +0 -14
- package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessManagedERC20MintBase.sol +0 -16
- package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/MyContractOwnable.sol +0 -17
- package/lib/openzeppelin-contracts/contracts/mocks/docs/account/MyAccountERC7702.sol +0 -20
- package/lib/openzeppelin-contracts/contracts/mocks/docs/account/MyFactoryAccount.sol +0 -37
- package/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyGovernor.sol +0 -80
- package/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyToken.sol +0 -21
- package/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyTokenTimestampBased.sol +0 -32
- package/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyTokenWrapped.sol +0 -28
- package/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC1155/GameItems.sol +0 -21
- package/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC1155/MyERC115HolderContract.sol +0 -7
- package/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC20/GLDToken.sol +0 -11
- package/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC6909/ERC6909GameItems.sol +0 -26
- package/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC721/GameItem.sol +0 -19
- package/lib/openzeppelin-contracts/contracts/mocks/docs/utilities/Base64NFT.sol +0 -27
- package/lib/openzeppelin-contracts/contracts/mocks/docs/utilities/Multicall.sol +0 -15
- package/lib/openzeppelin-contracts/docs/README.md +0 -16
- package/lib/openzeppelin-contracts/docs/antora.yml +0 -7
- package/lib/openzeppelin-contracts/docs/config.js +0 -21
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/access-control-multiple.svg +0 -97
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/access-manager-functions.svg +0 -47
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/access-manager.svg +0 -99
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3a.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3b.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-6.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-deposit.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-mint.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-linear.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglog.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglogext.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-exec.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-vote.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/nav.adoc +0 -29
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/access-control.adoc +0 -288
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/account-abstraction.adoc +0 -100
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/accounts.adoc +0 -354
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/backwards-compatibility.adoc +0 -50
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/eoa-delegation.adoc +0 -143
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc1155.adoc +0 -118
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20-supply.adoc +0 -71
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20.adoc +0 -67
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc4626.adoc +0 -214
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc6909.adoc +0 -47
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc721.adoc +0 -58
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/extending-contracts.adoc +0 -51
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/faq.adoc +0 -13
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/governance.adoc +0 -239
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/index.adoc +0 -70
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/multisig.adoc +0 -306
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/tokens.adoc +0 -31
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/upgradeable.adoc +0 -77
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/utilities.adoc +0 -591
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/wizard.adoc +0 -15
- package/lib/openzeppelin-contracts/docs/templates/contract.hbs +0 -141
- package/lib/openzeppelin-contracts/docs/templates/helpers.js +0 -46
- package/lib/openzeppelin-contracts/docs/templates/page.hbs +0 -4
- package/lib/openzeppelin-contracts/docs/templates/properties.js +0 -88
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/ERC20WithAutoMinerRewardUpgradeable.sol +0 -28
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/ERC4626FeesUpgradeable.sol +0 -115
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/MyNFTUpgradeable.sol +0 -14
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/access-control/AccessControlERC20MintBaseUpgradeable.sol +0 -31
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/access-control/AccessControlERC20MintMissingUpgradeable.sol +0 -30
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/access-control/AccessControlERC20MintOnlyRoleUpgradeable.sol +0 -29
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/access-control/AccessControlModifiedUpgradeable.sol +0 -20
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/access-control/AccessManagedERC20MintBaseUpgradeable.sol +0 -22
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/access-control/MyContractOwnableUpgradeable.sol +0 -22
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/account/MyAccountERC7702Upgradeable.sol +0 -26
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/account/MyFactoryAccountUpgradeable.sol +0 -42
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/governance/MyGovernorUpgradeable.sol +0 -92
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/governance/MyTokenTimestampBasedUpgradeable.sol +0 -39
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/governance/MyTokenUpgradeable.sol +0 -28
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/governance/MyTokenWrappedUpgradeable.sol +0 -39
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/token/ERC1155/GameItemsUpgradeable.sol +0 -27
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/token/ERC1155/MyERC115HolderContractUpgradeable.sol +0 -13
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/token/ERC20/GLDTokenUpgradeable.sol +0 -17
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/token/ERC6909/ERC6909GameItemsUpgradeable.sol +0 -31
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/token/ERC721/GameItemUpgradeable.sol +0 -24
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/utilities/Base64NFTUpgradeable.sol +0 -32
- package/lib/openzeppelin-contracts-upgradeable/contracts/mocks/docs/utilities/MulticallUpgradeable.sol +0 -21
- package/lib/openzeppelin-contracts-upgradeable/docs/README.md +0 -16
- package/lib/openzeppelin-contracts-upgradeable/docs/antora.yml +0 -7
- package/lib/openzeppelin-contracts-upgradeable/docs/config.js +0 -21
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/access-control-multiple.svg +0 -97
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/access-manager-functions.svg +0 -47
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/access-manager.svg +0 -99
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/erc4626-attack-3a.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/erc4626-attack-3b.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/erc4626-attack-6.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/erc4626-attack.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/erc4626-deposit.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/erc4626-mint.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/erc4626-rate-linear.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/erc4626-rate-loglog.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/erc4626-rate-loglogext.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/tally-exec.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/tally-vote.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/nav.adoc +0 -29
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/access-control.adoc +0 -288
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/account-abstraction.adoc +0 -100
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/accounts.adoc +0 -354
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/backwards-compatibility.adoc +0 -50
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/eoa-delegation.adoc +0 -143
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/erc1155.adoc +0 -118
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/erc20-supply.adoc +0 -71
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/erc20.adoc +0 -67
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/erc4626.adoc +0 -214
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/erc6909.adoc +0 -47
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/erc721.adoc +0 -58
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/extending-contracts.adoc +0 -51
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/faq.adoc +0 -13
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/governance.adoc +0 -239
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/index.adoc +0 -70
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/multisig.adoc +0 -306
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/tokens.adoc +0 -31
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/upgradeable.adoc +0 -77
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/utilities.adoc +0 -591
- package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/wizard.adoc +0 -15
- package/lib/openzeppelin-contracts-upgradeable/docs/templates/contract.hbs +0 -141
- package/lib/openzeppelin-contracts-upgradeable/docs/templates/helpers.js +0 -46
- package/lib/openzeppelin-contracts-upgradeable/docs/templates/page.hbs +0 -4
- package/lib/openzeppelin-contracts-upgradeable/docs/templates/properties.js +0 -88
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/ERC20WithAutoMinerReward.sol +0 -22
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/ERC4626Fees.sol +0 -109
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/MyNFT.sol +0 -9
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlERC20MintBase.sol +0 -25
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlERC20MintMissing.sol +0 -24
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlERC20MintOnlyRole.sol +0 -23
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlModified.sol +0 -14
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessManagedERC20MintBase.sol +0 -16
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/MyContractOwnable.sol +0 -17
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/account/MyAccountERC7702.sol +0 -20
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/account/MyFactoryAccount.sol +0 -37
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyGovernor.sol +0 -80
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyToken.sol +0 -21
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyTokenTimestampBased.sol +0 -32
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyTokenWrapped.sol +0 -28
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC1155/GameItems.sol +0 -21
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC1155/MyERC115HolderContract.sol +0 -7
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC20/GLDToken.sol +0 -11
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC6909/ERC6909GameItems.sol +0 -26
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC721/GameItem.sol +0 -19
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/utilities/Base64NFT.sol +0 -27
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/mocks/docs/utilities/Multicall.sol +0 -15
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/README.md +0 -16
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/antora.yml +0 -7
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/config.js +0 -21
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/access-control-multiple.svg +0 -97
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/access-manager-functions.svg +0 -47
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/access-manager.svg +0 -99
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3a.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3b.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-6.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-deposit.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-mint.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-linear.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglog.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglogext.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-exec.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-vote.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/nav.adoc +0 -29
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/access-control.adoc +0 -288
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/account-abstraction.adoc +0 -100
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/accounts.adoc +0 -354
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/backwards-compatibility.adoc +0 -50
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/eoa-delegation.adoc +0 -143
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc1155.adoc +0 -118
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20-supply.adoc +0 -71
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20.adoc +0 -67
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc4626.adoc +0 -214
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc6909.adoc +0 -47
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc721.adoc +0 -58
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/extending-contracts.adoc +0 -51
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/faq.adoc +0 -13
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/governance.adoc +0 -239
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/index.adoc +0 -70
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/multisig.adoc +0 -306
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/tokens.adoc +0 -31
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/upgradeable.adoc +0 -77
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/utilities.adoc +0 -591
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/modules/ROOT/pages/wizard.adoc +0 -15
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/templates/contract.hbs +0 -141
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/templates/helpers.js +0 -46
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/templates/page.hbs +0 -4
- package/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/docs/templates/properties.js +0 -88
- package/lib/openzeppelin-contracts-upgradeable.git/docs/antora.yml +0 -6
- package/lib/openzeppelin-contracts-upgradeable.git/docs/config.js +0 -21
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/images/tally-exec.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/images/tally-vote.png +0 -0
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/nav.adoc +0 -23
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/access-control.adoc +0 -217
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/crosschain.adoc +0 -210
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/crowdsales.adoc +0 -11
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/drafts.adoc +0 -19
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/erc1155.adoc +0 -153
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/erc20-supply.adoc +0 -113
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/erc20.adoc +0 -85
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/erc721.adoc +0 -90
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/erc777.adoc +0 -73
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/extending-contracts.adoc +0 -129
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/governance.adoc +0 -321
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/index.adoc +0 -63
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/releases-stability.adoc +0 -85
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/tokens.adoc +0 -32
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/upgradeable.adoc +0 -73
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/utilities.adoc +0 -190
- package/lib/openzeppelin-contracts-upgradeable.git/docs/modules/ROOT/pages/wizard.adoc +0 -15
- package/lib/openzeppelin-contracts-upgradeable.git/docs/templates/contract.hbs +0 -85
- package/lib/openzeppelin-contracts-upgradeable.git/docs/templates/helpers.js +0 -46
- package/lib/openzeppelin-contracts-upgradeable.git/docs/templates/page.hbs +0 -4
- package/lib/openzeppelin-contracts-upgradeable.git/docs/templates/properties.js +0 -49
- package/lib/openzeppelin-contracts.git/docs/antora.yml +0 -6
- package/lib/openzeppelin-contracts.git/docs/config.js +0 -21
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/images/tally-exec.png +0 -0
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/images/tally-vote.png +0 -0
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/nav.adoc +0 -23
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/access-control.adoc +0 -217
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/crosschain.adoc +0 -210
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/crowdsales.adoc +0 -11
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/drafts.adoc +0 -19
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/erc1155.adoc +0 -153
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/erc20-supply.adoc +0 -113
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/erc20.adoc +0 -85
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/erc721.adoc +0 -90
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/erc777.adoc +0 -73
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/extending-contracts.adoc +0 -129
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/governance.adoc +0 -321
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/index.adoc +0 -63
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/releases-stability.adoc +0 -85
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/tokens.adoc +0 -32
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/upgradeable.adoc +0 -73
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/utilities.adoc +0 -190
- package/lib/openzeppelin-contracts.git/docs/modules/ROOT/pages/wizard.adoc +0 -15
- package/lib/openzeppelin-contracts.git/docs/templates/contract.hbs +0 -85
- package/lib/openzeppelin-contracts.git/docs/templates/helpers.js +0 -46
- package/lib/openzeppelin-contracts.git/docs/templates/page.hbs +0 -4
- package/lib/openzeppelin-contracts.git/docs/templates/properties.js +0 -49
- package/lib/reality-eth-monorepo/packages/docs/Audit_Reality_v3_202108.pdf +0 -0
- package/lib/reality-eth-monorepo/packages/docs/Makefile +0 -20
- package/lib/reality-eth-monorepo/packages/docs/arbitrators.rst +0 -85
- package/lib/reality-eth-monorepo/packages/docs/audit.rst +0 -12
- package/lib/reality-eth-monorepo/packages/docs/audit_v2.rst +0 -249
- package/lib/reality-eth-monorepo/packages/docs/audit_v2_ERC20.rst +0 -1075
- package/lib/reality-eth-monorepo/packages/docs/audit_v3.rst +0 -70
- package/lib/reality-eth-monorepo/packages/docs/conf.py +0 -155
- package/lib/reality-eth-monorepo/packages/docs/contract_explanation.rst +0 -82
- package/lib/reality-eth-monorepo/packages/docs/contracts.rst +0 -277
- package/lib/reality-eth-monorepo/packages/docs/dapp.rst +0 -126
- package/lib/reality-eth-monorepo/packages/docs/dapp_links.rst +0 -67
- package/lib/reality-eth-monorepo/packages/docs/fees.rst +0 -89
- package/lib/reality-eth-monorepo/packages/docs/index.rst +0 -26
- package/lib/reality-eth-monorepo/packages/docs/javascript.rst +0 -142
- package/lib/reality-eth-monorepo/packages/docs/make.bat +0 -36
- package/lib/reality-eth-monorepo/packages/docs/question_box.png +0 -0
- package/lib/reality-eth-monorepo/packages/docs/requirements.txt +0 -24
- package/lib/reality-eth-monorepo/packages/docs/whitepaper.rst +0 -165
- package/script/UpdateMarket.s.sol +0 -56
- package/scripts/AddAdminToLand.s.sol +0 -29
- package/scripts/ClaimMerkleRoot.s.sol +0 -34
- package/scripts/CreateLand.s.sol +0 -28
- package/scripts/CreateMarkets.s.sol +0 -71
- package/scripts/DeployContracts.s.sol +0 -94
- package/scripts/DeployMerkleRewardsDistributor.s.sol +0 -27
- package/scripts/DeployToken.s.sol +0 -17
- package/scripts/DeployUSDT.s.sol +0 -24
- package/scripts/MintTokens.s.sol +0 -21
- package/scripts/PublishMerkleRoot.s.sol +0 -50
- package/scripts/ResolveMarket.s.sol +0 -23
- package/scripts/TradeMarket.s.sol +0 -28
- package/scripts/UpdateMarket.s.sol +0 -55
- package/test/UpdateTest.t.sol +0 -55
- package/test/WhaleTest.t.sol +0 -188
- package/tooling/docs/jsdoc.json +0 -6
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
= Smart Accounts
|
|
2
|
-
|
|
3
|
-
OpenZeppelin provides a simple xref:api:account.adoc#Account[`Account`] implementation including only the basic logic to handle user operations in compliance with ERC-4337. Developers who want to build their own account can leverage it to bootstrap custom implementations.
|
|
4
|
-
|
|
5
|
-
User operations are validated using an xref:api:utils.adoc#AbstractSigner[`AbstractSigner`], which requires to implement the internal xref:api:utils.adoc#AbstractSigner-_rawSignatureValidation-bytes32-bytes-[`_rawSignatureValidation`] function, of which we offer a set of implementations to cover a wide customization range. This is the lowest-level signature validation layer and is used to wrap other validation methods like the Account's xref:api:account.adoc#Account-validateUserOp-struct-PackedUserOperation-bytes32-uint256-[`validateUserOp`].
|
|
6
|
-
|
|
7
|
-
== Setting up an account
|
|
8
|
-
|
|
9
|
-
To setup an account, you can either start configuring it using our Wizard and selecting a predefined validation scheme, or bring your own logic and start by inheriting xref:api:account.adoc#Account[`Account`] from scratch.
|
|
10
|
-
|
|
11
|
-
++++
|
|
12
|
-
<script async src="https://wizard.openzeppelin.com/build/embed.js"></script>
|
|
13
|
-
|
|
14
|
-
<oz-wizard data-tab="Account" style="display: block; min-height: 40rem;"></oz-wizard>
|
|
15
|
-
++++
|
|
16
|
-
|
|
17
|
-
NOTE: Accounts don't support xref:erc721.adoc[ERC-721] and xref:erc1155.adoc[ERC-1155] tokens natively since these require the receiving address to implement an acceptance check. It is recommended to inherit xref:api:token/ERC721.adoc#ERC721Holder[ERC721Holder], xref:api:token/ERC1155.adoc#ERC1155Holder[ERC1155Holder] to include these checks in your account.
|
|
18
|
-
|
|
19
|
-
=== Selecting a signer
|
|
20
|
-
|
|
21
|
-
Since the minimum requirement of xref:api:account.adoc#Account[`Account`] is to provide an implementation of xref:api:utils/cryptography.adoc#AbstractSigner-_rawSignatureValidation-bytes32-bytes-[`_rawSignatureValidation`], the library includes specializations of the `AbstractSigner` contract that use custom digital signature verification algorithms. Some examples that you can select from include:
|
|
22
|
-
|
|
23
|
-
* xref:api:utils/cryptography.adoc#SignerECDSA[`SignerECDSA`]: Verifies signatures produced by regular EVM Externally Owned Accounts (EOAs).
|
|
24
|
-
* xref:api:utils/cryptography.adoc#SignerP256[`SignerP256`]: Validates signatures using the secp256r1 curve, common for World Wide Web Consortium (W3C) standards such as FIDO keys, passkeys or secure enclaves.
|
|
25
|
-
* xref:api:utils/cryptography.adoc#SignerRSA[`SignerRSA`]: Verifies signatures of traditional PKI systems and X.509 certificates.
|
|
26
|
-
* xref:api:utils/cryptography.adoc#SignerERC7702[`SignerERC7702`]: Checks EOA signatures delegated to this signer using https://eips.ethereum.org/EIPS/eip-7702#set-code-transaction[EIP-7702 authorizations]
|
|
27
|
-
* xref:api:utils/cryptography.adoc#SignerERC7913[`SignerERC7913`]: Verifies generalized signatures following https://eips.ethereum.org/EIPS/eip-7913[ERC-7913].
|
|
28
|
-
* https://docs.openzeppelin.com/community-contracts/0.0.1/api/utils#SignerZKEmail[`SignerZKEmail`]: Enables email-based authentication for smart contracts using zero knowledge proofs of email authority signatures.
|
|
29
|
-
* xref:api:utils/cryptography.adoc#MultiSignerERC7913[`MultiSignerERC7913`]: Allows using multiple ERC-7913 signers with a threshold-based signature verification system.
|
|
30
|
-
* xref:api:utils/cryptography.adoc#MultiSignerERC7913Weighted[`MultiSignerERC7913Weighted`]: Overrides the threshold mechanism of xref:api:utils/cryptography.adoc#MultiSignerERC7913[`MultiSignerERC7913`], offering different weights per signer.
|
|
31
|
-
|
|
32
|
-
TIP: Given xref:api:utils/cryptography.adoc#SignerERC7913[`SignerERC7913`] provides a generalized standard for signature validation, you don't need to implement your own xref:api:utils/cryptography.adoc#AbstractSigner[`AbstractSigner`] for different signature schemes, consider bringing your own ERC-7913 verifier instead.
|
|
33
|
-
|
|
34
|
-
==== Accounts factory
|
|
35
|
-
|
|
36
|
-
The first time you send an user operation, your account will be created deterministically (i.e. its code and address can be predicted) using the the `initCode` field in the UserOperation. This field contains both the address of a smart contract (the factory) and the data required to call it and create your smart account.
|
|
37
|
-
|
|
38
|
-
Suggestively, you can create your own account factory using the xref:api:proxy.adoc#Clones[Clones library], taking advantage of decreased deployment costs and account address predictability.
|
|
39
|
-
|
|
40
|
-
[source,solidity]
|
|
41
|
-
----
|
|
42
|
-
include::api:example$account/MyFactoryAccount.sol[]
|
|
43
|
-
----
|
|
44
|
-
|
|
45
|
-
Account factories should be carefully implemented to ensure the account address is deterministically tied to the initial owners. This prevents frontrunning attacks where a malicious actor could deploy the account with their own owners before the intended owner does. The factory should include the owner's address in the salt used for address calculation.
|
|
46
|
-
|
|
47
|
-
==== Handling initialization
|
|
48
|
-
|
|
49
|
-
Most smart accounts are deployed by a factory, the best practice is to create xref:api:proxy.adoc#minimal_clones[minimal clones] of initializable contracts. These signer implementations provide an initializable design by default so that the factory can interact with the account to set it up right after deployment in a single transaction.
|
|
50
|
-
|
|
51
|
-
[source,solidity]
|
|
52
|
-
----
|
|
53
|
-
import {Account} from "@openzeppelin/community-contracts/account/Account.sol";
|
|
54
|
-
import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
|
|
55
|
-
import {SignerECDSA} from "@openzeppelin/community-contracts/utils/cryptography/SignerECDSA.sol";
|
|
56
|
-
|
|
57
|
-
contract MyAccount is Initializable, Account, SignerECDSA, ... {
|
|
58
|
-
// ...
|
|
59
|
-
|
|
60
|
-
function initializeECDSA(address signer) public initializer {
|
|
61
|
-
_setSigner(signer);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
----
|
|
65
|
-
|
|
66
|
-
Note that some account implementations may be deployed directly and therefore, won't require a factory.
|
|
67
|
-
|
|
68
|
-
WARNING: Leaving an account uninitialized may leave it unusable since no public key was associated with it.
|
|
69
|
-
|
|
70
|
-
=== Signature validation
|
|
71
|
-
|
|
72
|
-
Regularly, accounts implement https://eips.ethereum.org/EIPS/eip-1271[ERC-1271] to enable smart contract signature verification given its wide adoption. To be compliant means that smart contract exposes an xref:api:interfaces.adoc#IERC1271-isValidSignature-bytes32-bytes-[`isValidSignature(bytes32 hash, bytes memory signature)`] method that returns `0x1626ba7e` to identify whether the signature is valid.
|
|
73
|
-
|
|
74
|
-
The benefit of this standard is that it allows to receive any format of `signature` for a given `hash`. This generalized mechanism fits very well with the account abstraction principle of _bringing your own validation mechanism_.
|
|
75
|
-
|
|
76
|
-
This is how you enable ERC-1271 using an xref:api:utils/cryptography.adoc#AbstractSigner[`AbstractSigner`]:
|
|
77
|
-
|
|
78
|
-
[source,solidity]
|
|
79
|
-
----
|
|
80
|
-
function isValidSignature(bytes32 hash, bytes calldata signature) public view override returns (bytes4) {
|
|
81
|
-
return _rawSignatureValidation(hash, signature) ? IERC1271.isValidSignature.selector : bytes4(0xffffffff);
|
|
82
|
-
}
|
|
83
|
-
----
|
|
84
|
-
|
|
85
|
-
IMPORTANT: We recommend using xref:api:utils/cryptography.adoc#ERC7739[ERC7739] to avoid replayability across accounts. This defensive rehashing mechanism that prevents signatures for this account to be replayed in another account controlled by the same signer. See xref:accounts.adoc#erc_7739_signatures[ERC-7739 signatures].
|
|
86
|
-
|
|
87
|
-
=== Batched execution
|
|
88
|
-
|
|
89
|
-
Batched execution allows accounts to execute multiple calls in a single transaction, which is particularly useful for bundling operations that need to be atomic. This is especially valuable in the context of account abstraction where you want to minimize the number of user operations and associated gas costs. xref:api:account.adoc#ERC7821[`ERC-7821`] standard provides a minimal interface for batched execution.
|
|
90
|
-
|
|
91
|
-
The library implementation supports a single batch mode (`0x01000000000000000000`) and allows accounts to execute multiple calls atomically. The standard includes access control through the xref:api:account.adoc#ERC7821-_erc7821AuthorizedExecutor-address-bytes32-bytes-[`_erc7821AuthorizedExecutor`] function, which by default only allows the contract itself to execute batches.
|
|
92
|
-
|
|
93
|
-
Here's an example of how to use batched execution using EIP-7702:
|
|
94
|
-
|
|
95
|
-
[source,solidity]
|
|
96
|
-
----
|
|
97
|
-
import {Account} from "@openzeppelin/community-contracts/account/Account.sol";
|
|
98
|
-
import {ERC7821} from "@openzeppelin/community-contracts/account/extensions/draft-ERC7821.sol";
|
|
99
|
-
import {SignerERC7702} from "@openzeppelin/community-contracts/utils/cryptography/SignerERC7702.sol";
|
|
100
|
-
|
|
101
|
-
contract MyAccount is Account, SignerERC7702, ERC7821 {
|
|
102
|
-
// Override to allow the entrypoint to execute batches
|
|
103
|
-
function _erc7821AuthorizedExecutor(
|
|
104
|
-
address caller,
|
|
105
|
-
bytes32 mode,
|
|
106
|
-
bytes calldata executionData
|
|
107
|
-
) internal view virtual override returns (bool) {
|
|
108
|
-
return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
----
|
|
112
|
-
|
|
113
|
-
The batched execution data follows a specific format that includes the calls to be executed. This format follows the same format as https://eips.ethereum.org/EIPS/eip-7579#execution-behavior[ERC-7579 execution] but only supports `0x01` call type (i.e. batched `call`) and default execution type (i.e. reverts if at least one subcall does).
|
|
114
|
-
|
|
115
|
-
To encode an ERC-7821 batch, you can use https://viem.sh/[viem]'s utilities:
|
|
116
|
-
|
|
117
|
-
[source,typescript]
|
|
118
|
-
----
|
|
119
|
-
// CALL_TYPE_BATCH, EXEC_TYPE_DEFAULT, ..., selector, payload
|
|
120
|
-
const mode = encodePacked(
|
|
121
|
-
["bytes1", "bytes1", "bytes4", "bytes4", "bytes22"],
|
|
122
|
-
["0x01", "0x00", "0x00000000", "0x00000000", "0x00000000000000000000000000000000000000000000"]
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
const entries = [
|
|
126
|
-
{
|
|
127
|
-
target: "0x000...0001",
|
|
128
|
-
value: 0n,
|
|
129
|
-
data: "0x000...000",
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
target: "0x000...0002",
|
|
133
|
-
value: 0n,
|
|
134
|
-
data: "0x000...000",
|
|
135
|
-
}
|
|
136
|
-
];
|
|
137
|
-
|
|
138
|
-
const batch = encodeAbiParameters(
|
|
139
|
-
[parseAbiParameter("(address,uint256,bytes)[]")],
|
|
140
|
-
[
|
|
141
|
-
entries.map<[Address, bigint, Hex]>((entry) =>
|
|
142
|
-
[entry.target, entry.value ?? 0n, entry.data ?? "0x"]
|
|
143
|
-
),
|
|
144
|
-
]
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
const userOpData = encodeFunctionData({
|
|
148
|
-
abi: account.abi,
|
|
149
|
-
functionName: "execute",
|
|
150
|
-
args: [mode, batch]
|
|
151
|
-
});
|
|
152
|
-
----
|
|
153
|
-
|
|
154
|
-
== Bundle a `UserOperation`
|
|
155
|
-
|
|
156
|
-
xref:account-abstraction.adoc#useroperation[UserOperations] are a powerful abstraction layer that enable more sophisticated transaction capabilities compared to traditional Ethereum transactions. To get started, you'll need to an account, which you can get by xref:accounts.adoc#accounts_factory[deploying a factory] for your implementation.
|
|
157
|
-
|
|
158
|
-
=== Preparing a UserOp
|
|
159
|
-
|
|
160
|
-
A UserOperation is a struct that contains all the necessary information for the EntryPoint to execute your transaction. You'll need the `sender`, `nonce`, `accountGasLimits` and `callData` fields to construct a `PackedUserOperation` that can be signed later (to populate the `signature` field).
|
|
161
|
-
|
|
162
|
-
TIP: Specify `paymasterAndData` with the address of a paymaster contract concatenated to `data` that will be passed to the paymaster's validatePaymasterUserOp function to support sponsorship as part of your user operation.
|
|
163
|
-
|
|
164
|
-
Here's how to prepare one using https://viem.sh/[viem]:
|
|
165
|
-
|
|
166
|
-
[source,typescript]
|
|
167
|
-
----
|
|
168
|
-
import { getContract, createWalletClient, http, Hex } from 'viem';
|
|
169
|
-
|
|
170
|
-
const walletClient = createWalletClient({
|
|
171
|
-
account, // See Viem's `privateKeyToAccount`
|
|
172
|
-
chain, // import { ... } from 'viem/chains';
|
|
173
|
-
transport: http(),
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
const entrypoint = getContract({
|
|
177
|
-
abi: [/* ENTRYPOINT ABI */],
|
|
178
|
-
address: '0x<ENTRYPOINT_ADDRESS>',
|
|
179
|
-
client: walletClient,
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
const userOp = {
|
|
183
|
-
sender: '0x<YOUR_ACCOUNT_ADDRESS>',
|
|
184
|
-
nonce: await entrypoint.read.getNonce([sender, 0n]),
|
|
185
|
-
initCode: "0x" as Hex,
|
|
186
|
-
callData: '0x<CALLDATA_TO_EXECUTE_IN_THE_ACCOUNT>',
|
|
187
|
-
accountGasLimits: encodePacked(
|
|
188
|
-
["uint128", "uint128"],
|
|
189
|
-
[
|
|
190
|
-
100_000n, // verificationGasLimit
|
|
191
|
-
300_000n, // callGasLimit
|
|
192
|
-
]
|
|
193
|
-
),
|
|
194
|
-
preVerificationGas: 50_000n,
|
|
195
|
-
gasFees: encodePacked(
|
|
196
|
-
["uint128", "uint128"],
|
|
197
|
-
[
|
|
198
|
-
0n, // maxPriorityFeePerGas
|
|
199
|
-
0n, // maxFeePerGas
|
|
200
|
-
]
|
|
201
|
-
),
|
|
202
|
-
paymasterAndData: "0x" as Hex,
|
|
203
|
-
signature: "0x" as Hex,
|
|
204
|
-
};
|
|
205
|
-
----
|
|
206
|
-
|
|
207
|
-
In case your account hasn't been deployed yet, make sure to provide the `initCode` field as `abi.encodePacked(factory, factoryData)` to deploy the account within the same UserOp:
|
|
208
|
-
|
|
209
|
-
[source,typescript]
|
|
210
|
-
----
|
|
211
|
-
const deployed = await publicClient.getCode({ address: predictedAddress });
|
|
212
|
-
|
|
213
|
-
if (!deployed) {
|
|
214
|
-
userOp.initCode = encodePacked(
|
|
215
|
-
["address", "bytes"],
|
|
216
|
-
[
|
|
217
|
-
'0x<ACCOUNT_FACTORY_ADDRESS>',
|
|
218
|
-
encodeFunctionData({
|
|
219
|
-
abi: [/* ACCOUNT ABI */],
|
|
220
|
-
functionName: "<FUNCTION NAME>",
|
|
221
|
-
args: [...],
|
|
222
|
-
}),
|
|
223
|
-
]
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
----
|
|
227
|
-
|
|
228
|
-
==== Estimating gas
|
|
229
|
-
|
|
230
|
-
To calculate gas parameters of a `UserOperation`, developers should carefully consider the following fields:
|
|
231
|
-
|
|
232
|
-
* `verificationGasLimit`: This covers the gas costs for signature verification, paymaster validation (if used), and account validation logic. While a typical value is around 100,000 gas units, this can vary significantly based on the complexity of your signature validation scheme in both the account and paymaster contracts.
|
|
233
|
-
|
|
234
|
-
* `callGasLimit`: This parameter accounts for the actual execution of your account's logic. It's recommended to use `eth_estimateGas` for each subcall and add additional buffer for computational overhead.
|
|
235
|
-
|
|
236
|
-
* `preVerificationGas`: This compensates for the EntryPoint's execution overhead. While 50,000 gas is a reasonable starting point, you may need to increase this value based on your UserOperation's size and specific bundler requirements.
|
|
237
|
-
|
|
238
|
-
NOTE: The `maxFeePerGas` and `maxPriorityFeePerGas` values are typically provided by your bundler service, either through their SDK or a custom RPC method.
|
|
239
|
-
|
|
240
|
-
IMPORTANT: A penalty of 10% (`UNUSED_GAS_PENALTY_PERCENT`) is applied on the amounts of `callGasLimit` and `paymasterPostOpGasLimit` gas that remains unused if the amount of remaining unused gas is greater than or equal to 40,000 (`PENALTY_GAS_THRESHOLD`).
|
|
241
|
-
|
|
242
|
-
=== Signing the UserOp
|
|
243
|
-
|
|
244
|
-
To sign a UserOperation, you'll need to first calculate its hash as an EIP-712 typed data structure using the EntryPoint's domain, then sign this hash using your account's signature scheme, and finally encode the resulting signature in the format that your account contract expects for verification.
|
|
245
|
-
|
|
246
|
-
[source,typescript]
|
|
247
|
-
----
|
|
248
|
-
import { signTypedData } from 'viem/actions';
|
|
249
|
-
|
|
250
|
-
// EntryPoint v0.8 EIP-712 domain
|
|
251
|
-
const domain = {
|
|
252
|
-
name: 'ERC4337',
|
|
253
|
-
version: '1',
|
|
254
|
-
chainId: 1, // Your target chain ID
|
|
255
|
-
verifyingContract: '0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108', // v08
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
// EIP-712 types for PackedUserOperation
|
|
259
|
-
const types = {
|
|
260
|
-
PackedUserOperation: [
|
|
261
|
-
{ name: 'sender', type: 'address' },
|
|
262
|
-
{ name: 'nonce', type: 'uint256' },
|
|
263
|
-
{ name: 'initCode', type: 'bytes' },
|
|
264
|
-
{ name: 'callData', type: 'bytes' },
|
|
265
|
-
{ name: 'accountGasLimits', type: 'bytes32' },
|
|
266
|
-
{ name: 'preVerificationGas', type: 'uint256' },
|
|
267
|
-
{ name: 'gasFees', type: 'bytes32' },
|
|
268
|
-
{ name: 'paymasterAndData', type: 'bytes' },
|
|
269
|
-
],
|
|
270
|
-
} as const;
|
|
271
|
-
|
|
272
|
-
// Sign the UserOperation using EIP-712
|
|
273
|
-
userOp.signature = await eoa.signTypedData({
|
|
274
|
-
domain,
|
|
275
|
-
types,
|
|
276
|
-
primaryType: 'PackedUserOperation',
|
|
277
|
-
message: {
|
|
278
|
-
sender: userOp.sender,
|
|
279
|
-
nonce: userOp.nonce,
|
|
280
|
-
initCode: userOp.initCode,
|
|
281
|
-
callData: userOp.callData,
|
|
282
|
-
accountGasLimits: userOp.accountGasLimits,
|
|
283
|
-
preVerificationGas: userOp.preVerificationGas,
|
|
284
|
-
gasFees: userOp.gasFees,
|
|
285
|
-
paymasterAndData: userOp.paymasterAndData,
|
|
286
|
-
},
|
|
287
|
-
});
|
|
288
|
-
----
|
|
289
|
-
|
|
290
|
-
Alternatively, developers can get the raw user operation hash by using the Entrypoint's `getUserOpHash` function:
|
|
291
|
-
|
|
292
|
-
[source,typescript]
|
|
293
|
-
----
|
|
294
|
-
const userOpHash = await entrypoint.read.getUserOpHash([userOp]);
|
|
295
|
-
userOp.signature = await eoa.sign({ hash: userOpHash });
|
|
296
|
-
----
|
|
297
|
-
|
|
298
|
-
IMPORTANT: Using `getUserOpHash` directly may provide a poorer user experience as users see an opaque hash rather than structured transaction data. In many cases, offchain signers won't have an option to sign a raw hash.
|
|
299
|
-
|
|
300
|
-
=== Sending the UserOp
|
|
301
|
-
|
|
302
|
-
Finally, to send the user operation you can call `handleOps` on the Entrypoint contract and set yourself as the `beneficiary`.
|
|
303
|
-
|
|
304
|
-
[source,typescript]
|
|
305
|
-
----
|
|
306
|
-
// Send the UserOperation
|
|
307
|
-
const userOpReceipt = await walletClient
|
|
308
|
-
.writeContract({
|
|
309
|
-
abi: [/* ENTRYPOINT ABI */],
|
|
310
|
-
address: '0x<ENTRYPOINT_ADDRESS>',
|
|
311
|
-
functionName: "handleOps",
|
|
312
|
-
args: [[userOp], eoa.address],
|
|
313
|
-
})
|
|
314
|
-
.then((txHash) =>
|
|
315
|
-
publicClient.waitForTransactionReceipt({
|
|
316
|
-
hash: txHash,
|
|
317
|
-
})
|
|
318
|
-
);
|
|
319
|
-
|
|
320
|
-
// Print receipt
|
|
321
|
-
console.log(userOpReceipt);
|
|
322
|
-
----
|
|
323
|
-
|
|
324
|
-
TIP: Since you're bundling your user operations yourself, you can safely specify `preVerificationGas` and `maxFeePerGas` in 0.
|
|
325
|
-
|
|
326
|
-
=== Using a Bundler
|
|
327
|
-
|
|
328
|
-
For better reliability, consider using a bundler service. Bundlers provide several key benefits: they automatically handle gas estimation, manage transaction ordering, support bundling multiple operations together, and generally offer higher transaction success rates compared to self-bundling.
|
|
329
|
-
|
|
330
|
-
== Further notes
|
|
331
|
-
|
|
332
|
-
=== ERC-7739 Signatures
|
|
333
|
-
|
|
334
|
-
A common security practice to prevent user operation https://mirror.xyz/curiousapple.eth/pFqAdW2LiJ-6S4sg_u1z08k4vK6BCJ33LcyXpnNb8yU[replayability across smart contract accounts controlled by the same private key] (i.e. multiple accounts for the same signer) is to link the signature to the `address` and `chainId` of the account. This can be done by asking the user to sign a hash that includes these values.
|
|
335
|
-
|
|
336
|
-
The problem with this approach is that the user might be prompted by the wallet provider to sign an https://x.com/howydev/status/1780353754333634738[obfuscated message], which is a phishing vector that may lead to a user losing its assets.
|
|
337
|
-
|
|
338
|
-
To prevent this, developers may use xref:api:account#ERC7739Signer[`ERC7739Signer`], a utility that implements xref:api:interfaces#IERC1271[`IERC1271`] for smart contract signatures with a defensive rehashing mechanism based on a https://github.com/frangio/eip712-wrapper-for-eip1271[nested EIP-712 approach] to wrap the signature request in a context where there's clearer information for the end user.
|
|
339
|
-
|
|
340
|
-
=== EIP-7702 Delegation
|
|
341
|
-
|
|
342
|
-
https://eips.ethereum.org/EIPS/eip-7702[EIP-7702] lets EOAs delegate to smart contracts while keeping their original signing key. This creates a hybrid account that works like an EOA for signing but has smart contract features. Protocols don't need major changes to support EIP-7702 since they already handle both EOAs and smart contracts (see xref:api:utils/cryptography.adoc#SignatureChecker[SignatureChecker]).
|
|
343
|
-
|
|
344
|
-
The signature verification stays compatible: delegated EOAs are treated as contracts using ERC-1271, making it easy to redelegate to a contract with ERC-1271 support with little overhead by reusing the validation mechanism of the account.
|
|
345
|
-
|
|
346
|
-
TIP: Learn more about delegating to an ERC-7702 account in our xref:eoa-delegation.adoc[EOA Delegation] section.
|
|
347
|
-
|
|
348
|
-
=== ERC-7579 Modules
|
|
349
|
-
|
|
350
|
-
Smart accounts have evolved to embrace modularity as a design principle, with popular implementations like https://erc7579.com/#supporters[Safe, Pimlico, Rhinestone, Etherspot and many others] agreeing on ERC-7579 as the standard for module interoperability. This standardization enables accounts to extend their functionality through external contracts while maintaining compatibility across different implementations.
|
|
351
|
-
|
|
352
|
-
OpenZeppelin Contracts provides both the building blocks for creating ERC-7579-compliant modules and an xref:api:account.adoc#AccountERC7579[`AccountERC7579`] implementation that supports installing and managing these modules.
|
|
353
|
-
|
|
354
|
-
TIP: Learn more in our https://docs.openzeppelin.com/community-contracts/0.0.1/account-modules[account modules] section.
|
package/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/pages/backwards-compatibility.adoc
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
= Backwards Compatibility
|
|
2
|
-
:page-aliases: releases-stability.adoc
|
|
3
|
-
|
|
4
|
-
OpenZeppelin Contracts uses semantic versioning to communicate backwards compatibility of its API and storage layout. Patch and minor updates will generally be backwards compatible, with rare exceptions as detailed below. Major updates should be assumed incompatible with previous releases. On this page, we provide details about these guarantees.
|
|
5
|
-
|
|
6
|
-
== API
|
|
7
|
-
|
|
8
|
-
In backwards compatible releases, all changes should be either additions or modifications to internal implementation details. Most code should continue to compile and behave as expected. The exceptions to this rule are listed below.
|
|
9
|
-
|
|
10
|
-
=== Security
|
|
11
|
-
|
|
12
|
-
Infrequently a patch or minor update will remove or change an API in a breaking way, but only if the previous API is considered insecure. These breaking changes will be noted in the changelog and release notes, and published along with a security advisory.
|
|
13
|
-
|
|
14
|
-
=== Draft or Pre-Final ERCs
|
|
15
|
-
|
|
16
|
-
ERCs that are not Final can change in incompatible ways. For this reason, we avoid shipping implementations of ERCs before they are Final. Some exceptions are made for ERCs that have been published for a long time and seem unlikely to change. Implementations for ERCs that may have breaking changes are published in files named `draft-*.sol` to make that condition explicit. There is no backwards compatibility guarantee for content in files prefixed with `draft`.
|
|
17
|
-
|
|
18
|
-
Standards that have achieved widespread adoption with strong backwards compatibility expectations from the community may be treated as de-facto finalized and published without the `draft-` prefix, as extensive ecosystem reliance makes breaking changes highly unlikely.
|
|
19
|
-
|
|
20
|
-
=== Virtual & Overrides
|
|
21
|
-
|
|
22
|
-
Almost all functions in this library are virtual with some exceptions, but this does not mean that overrides are encouraged. There is a subset of functions that are designed to be overridden. By defining overrides outside of this subset you are potentially relying on internal implementation details. We make efforts to preserve backwards compatibility even in these cases but it is extremely difficult and easy to accidentally break. Caution is advised.
|
|
23
|
-
|
|
24
|
-
Additionally, some minor updates may result in new compilation errors of the kind "two or more base classes define function with same name and parameter types" or "need to specify overridden contract", due to what Solidity considers ambiguity in inherited functions. This should be resolved by adding an override that invokes the function via `super`.
|
|
25
|
-
|
|
26
|
-
See xref:extending-contracts.adoc[Extending Contracts] for more about virtual and overrides.
|
|
27
|
-
|
|
28
|
-
=== Structs
|
|
29
|
-
|
|
30
|
-
Struct members with an underscore prefix should be considered "private" and may break in minor versions. Struct data should only be accessed and modified through library functions.
|
|
31
|
-
|
|
32
|
-
=== Errors
|
|
33
|
-
|
|
34
|
-
The specific error format and data that is included with reverts should not be assumed stable unless otherwise specified.
|
|
35
|
-
|
|
36
|
-
=== Major Releases
|
|
37
|
-
|
|
38
|
-
Major releases should be assumed incompatible. Nevertheless, the external interfaces of contracts will remain compatible if they are standardized, or if the maintainers judge that changing them would cause significant strain on the ecosystem.
|
|
39
|
-
|
|
40
|
-
An important aspect that major releases may break is "upgrade compatibility", in particular storage layout compatibility. It will never be safe for a live contract to upgrade from one major release to another.
|
|
41
|
-
|
|
42
|
-
== Storage Layout
|
|
43
|
-
|
|
44
|
-
Minor and patch updates always preserve storage layout compatibility. This means that a live contract can be upgraded from one minor to another without corrupting the storage layout. In some cases it may be necessary to initialize new state variables when upgrading, although we expect this to be infrequent.
|
|
45
|
-
|
|
46
|
-
We recommend using xref:upgrades-plugins::index.adoc[OpenZeppelin Upgrades Plugins or CLI] to ensure storage layout safety of upgrades.
|
|
47
|
-
|
|
48
|
-
== Solidity Version
|
|
49
|
-
|
|
50
|
-
The minimum Solidity version required to compile the contracts will remain unchanged in minor and patch updates. New contracts introduced in minor releases may make use of newer Solidity features and require a more recent version of the compiler.
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
= EOA Delegation
|
|
2
|
-
|
|
3
|
-
https://eips.ethereum.org/EIPS/eip-7702[EIP-7702] introduces a new transaction type (`0x4`) that grants https://ethereum.org/en/developers/docs/accounts/[Externally Owned Accounts (EOAs)] the ability to delegate execution to an smart contract. This is particularly useful to enable traditional EVM accounts to:
|
|
4
|
-
|
|
5
|
-
* Batch multiple operations in a single transaction (e.g. xref:api:token/ERC20.adoc#IERC20-approve-address-uint256-[`approve`] + xref:api:token/ERC20.adoc#IERC20-transfer-address-uint256-[`transfer`], yey!)
|
|
6
|
-
* Sponsoring transactions for other users.
|
|
7
|
-
* Implementing privilege de-escalation (e.g., sub-keys with limited permissions)
|
|
8
|
-
|
|
9
|
-
This section walks you through the process of delegating an EOA to a contract following https://eips.ethereum.org/EIPS/eip-7702[ERC-7702]. This allows you to use your EOA's private key to sign and execute operations with custom execution logic. Combined with https://eips.ethereum.org/EIPS/eip-4337[ERC-4337] infrastructure, users can achieve gas sponsoring through https://docs.openzeppelin.com/community-contracts/paymasters[paymasters].
|
|
10
|
-
|
|
11
|
-
== Delegating execution
|
|
12
|
-
|
|
13
|
-
EIP-7702 enables EOAs to delegate their execution capabilities to smart contracts, effectively bridging the gap between traditional and xref:accounts.adoc[Smart Accounts]. The xref:api:utils/cryptography.adoc#[`SignerERC7702`] utility facilitates this delegation by verifying signatures against the EOA's address (`address(this)`), making it easier to implement EIP-7702 in smart contract accounts.
|
|
14
|
-
|
|
15
|
-
[source,solidity]
|
|
16
|
-
----
|
|
17
|
-
include::api:example$account/MyAccountERC7702.sol[]
|
|
18
|
-
----
|
|
19
|
-
|
|
20
|
-
TIP: Users can delegate to an instance of xref:api:account.adoc#ERC7821[`ERC-7821`] for a minimal batch executor that does not use ERC-4337 related code.
|
|
21
|
-
|
|
22
|
-
=== Signing Authorization
|
|
23
|
-
|
|
24
|
-
To authorize delegation, the EOA owner signs a message containing the chain ID, nonce, delegation address, and signature components (i.e. `[chain_id, address, nonce, y_parity, r, s]`). This signed authorization serves two purposes: it restricts execution to only the delegate contract and prevents replay attacks.
|
|
25
|
-
|
|
26
|
-
The EOA maintains a delegation designator for each authorized address on each chain, which points to the contract whose code will be executed in the EOA's context to handle delegated operations.
|
|
27
|
-
|
|
28
|
-
Here's how to construct an authorization with https://viem.sh/[viem]:
|
|
29
|
-
|
|
30
|
-
[source, typescript]
|
|
31
|
-
----
|
|
32
|
-
// Remember not to hardcode your private key!
|
|
33
|
-
const eoa = privateKeyToAccount('<YOUR_PRIVATE_KEY>');
|
|
34
|
-
const eoaClient = createWalletClient({
|
|
35
|
-
account: eoa,
|
|
36
|
-
chain: publicClient.chain,
|
|
37
|
-
transport: http(),
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const walletClient = createWalletClient({
|
|
41
|
-
account, // See Viem's `privateKeyToAccount`
|
|
42
|
-
chain, // import { ... } from 'viem/chains';
|
|
43
|
-
transport: http(),
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
const authorization = await eoaClient.signAuthorization({
|
|
47
|
-
account: walletClient.account.address,
|
|
48
|
-
contractAddress: '0x<YOUR_DELEGATE_CONTRACT_ADDRESS>',
|
|
49
|
-
// Use instead of `account` if your
|
|
50
|
-
// walletClient's account is the one sending the transaction
|
|
51
|
-
// executor: "self",
|
|
52
|
-
});
|
|
53
|
-
----
|
|
54
|
-
|
|
55
|
-
NOTE: When implementing delegate contracts, ensure they require signatures that avoid replayability (e.g. a domain separator, nonce).
|
|
56
|
-
A poorly implemented delegate can allow a malicious actor to take near complete control over a signer's EOA.
|
|
57
|
-
|
|
58
|
-
=== Send a Set Code Transaction
|
|
59
|
-
|
|
60
|
-
After signing the authorization, you need to send a `SET_CODE_TX_TYPE` (0x04) transaction to write the delegation designator (i.e. `0xef0100 || address`) to your EOA's code, which tells the EVM to load and execute code from the specified address when operations are performed on your EOA.
|
|
61
|
-
|
|
62
|
-
[source, typescript]
|
|
63
|
-
----
|
|
64
|
-
// Send the `authorization` along with `data`
|
|
65
|
-
const receipt = await walletClient
|
|
66
|
-
.sendTransaction({
|
|
67
|
-
authorizationList: [authorization],
|
|
68
|
-
data: '0x<CALLDATA_TO_EXECUTE_IN_THE_ACCOUNT>',
|
|
69
|
-
to: eoa.address,
|
|
70
|
-
})
|
|
71
|
-
.then((txHash) =>
|
|
72
|
-
publicClient.waitForTransactionReceipt({
|
|
73
|
-
hash: txHash,
|
|
74
|
-
})
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
// Print receipt
|
|
78
|
-
console.log(userOpReceipt);
|
|
79
|
-
----
|
|
80
|
-
|
|
81
|
-
To remove the delegation and restore your EOA to its original state, you can send a `SET_CODE_TX_TYPE` transaction with an authorization tuple that points to the zero address (`0x0000000000000000000000000000000000000000`). This will clear the account's code and reset its code hash to the empty hash, however, be aware that it will not automatically clean the EOA storage.
|
|
82
|
-
|
|
83
|
-
When changing an account's delegation, ensure the newly delegated code is purposely designed and tested as an upgrade to the old one. To ensure safe migration between delegate contracts, namespaced storage that avoid accidental collisions following ERC-7201.
|
|
84
|
-
|
|
85
|
-
WARNING: Updating the delegation designator may render your EOA unusable due to potential storage collisions. We recommend following similar practices to those of https://docs.openzeppelin.com/upgrades-plugins/writing-upgradeable[writing upgradeable smart contracts].
|
|
86
|
-
|
|
87
|
-
== Using with ERC-4337
|
|
88
|
-
|
|
89
|
-
The ability to set code to execute logic on an EOA allows users to leverage ERC-4337 infrastructure to process user operations. Developers only need to combine an xref:api:account.adoc#Account[`Account`] contract with an xref:api:utils/cryptography.adoc#SignerERC7702[`SignerERC7702`] to accomplish ERC-4337 compliance out of the box.
|
|
90
|
-
|
|
91
|
-
=== Sending a UserOp
|
|
92
|
-
|
|
93
|
-
Once your EOA is delegated to an ERC-4337 compatible account, you can send user operations through the entry point contract. The user operation includes all the necessary fields for execution, including gas limits, fees, and the actual call data to execute. The entry point will validate the operation and execute it in the context of your delegated account.
|
|
94
|
-
|
|
95
|
-
Similar to how xref:accounts.adoc#bundle_a_useroperation[sending a UserOp] is achieved for factory accounts, here's how you can construct a UserOp for an EOA who's delegated to an xref:api:account.adoc#Account[`Account`] contract.
|
|
96
|
-
|
|
97
|
-
[source, typescript]
|
|
98
|
-
----
|
|
99
|
-
const userOp = {
|
|
100
|
-
sender: eoa.address,
|
|
101
|
-
nonce: await entrypoint.read.getNonce([eoa.address, 0n]),
|
|
102
|
-
initCode: "0x" as Hex,
|
|
103
|
-
callData: '0x<CALLDATA_TO_EXECUTE_IN_THE_ACCOUNT>',
|
|
104
|
-
accountGasLimits: encodePacked(
|
|
105
|
-
["uint128", "uint128"],
|
|
106
|
-
[
|
|
107
|
-
100_000n, // verificationGas
|
|
108
|
-
300_000n, // callGas
|
|
109
|
-
]
|
|
110
|
-
),
|
|
111
|
-
preVerificationGas: 50_000n,
|
|
112
|
-
gasFees: encodePacked(
|
|
113
|
-
["uint128", "uint128"],
|
|
114
|
-
[
|
|
115
|
-
0n, // maxPriorityFeePerGas
|
|
116
|
-
0n, // maxFeePerGas
|
|
117
|
-
]
|
|
118
|
-
),
|
|
119
|
-
paymasterAndData: "0x" as Hex,
|
|
120
|
-
signature: "0x" as Hex,
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const userOpHash = await entrypoint.read.getUserOpHash([userOp]);
|
|
124
|
-
userOp.signature = await eoa.sign({ hash: userOpHash });
|
|
125
|
-
|
|
126
|
-
const userOpReceipt = await eoaClient
|
|
127
|
-
.writeContract({
|
|
128
|
-
abi: EntrypointV08Abi,
|
|
129
|
-
address: entrypoint.address,
|
|
130
|
-
authorizationList: [authorization],
|
|
131
|
-
functionName: "handleOps",
|
|
132
|
-
args: [[userOp], eoa.address],
|
|
133
|
-
})
|
|
134
|
-
.then((txHash) =>
|
|
135
|
-
publicClient.waitForTransactionReceipt({
|
|
136
|
-
hash: txHash,
|
|
137
|
-
})
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
console.log(userOpReceipt);
|
|
141
|
-
----
|
|
142
|
-
|
|
143
|
-
NOTE: When using sponsored transaction relayers, be aware that the authorized account can cause relayers to spend gas without being reimbursed by either invalidating the authorization (increasing the account's nonce) or by sweeping the relevant assets out of the account. Relayers may implement safeguards like requiring a bond or using a reputation system.
|