@coti-io/coti-contracts 1.3.0 → 1.3.1
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/contracts/access/DataPrivacyFramework/DataPrivacyFramework.sol +1 -1
- package/contracts/access/DataPrivacyFramework/extensions/DataPrivacyFrameworkMpc.sol +1 -1
- package/contracts/disperse/coinByRatio/FixedRatioCoinDisperserUnlimitedWindow.sol +2 -4
- package/contracts/disperse/disperseToken/MintDisperser.sol +1 -3
- package/contracts/disperse/disperseToken/TokenDisperser.sol +1 -1
- package/contracts/messaging/PrivateMessaging.sol +1 -1
- package/contracts/mocks/access/DataPrivacyFramework/DataPrivacyFrameworkMock.sol +1 -1
- package/contracts/mocks/messaging/PrivateMessagingHarness.sol +1 -1
- package/contracts/mocks/oracle/CotiPriceConsumerMock.sol +1 -1
- package/contracts/mocks/token/ERC20DecimalsMock.sol +1 -1
- package/contracts/mocks/token/ERC20Mock.sol +1 -1
- package/contracts/mocks/token/PrivateERC20/EncryptedTokenReceiverMock.sol +1 -1
- package/contracts/mocks/token/PrivateERC20/PrivacyBridgeERC20Mock.sol +1 -1
- package/contracts/mocks/token/PrivateERC20/PrivateERC20AuditorSupplyMock.sol +1 -1
- package/contracts/mocks/token/PrivateERC20/PrivateERC20CappedMock.sol +1 -1
- package/contracts/mocks/token/PrivateERC20/PrivateERC20GtCallerMock.sol +1 -1
- package/contracts/mocks/token/PrivateERC20/PrivateERC20Mock.sol +1 -1
- package/contracts/mocks/token/PrivateERC20/PrivateERC20ReentrantReceiverMock.sol +1 -1
- package/contracts/mocks/token/PrivateERC20/PublicReentrantTokenReceiverMock.sol +1 -1
- package/contracts/mocks/token/PrivateERC20/PublicTokenReceiverBoolMock.sol +1 -1
- package/contracts/mocks/token/PrivateERC20/PublicTokenReceiverMock.sol +1 -1
- package/contracts/mocks/token/PrivateERC721/PrivateERC721URIStorageMock.sol +1 -1
- package/contracts/mocks/utils/mpc/Arithmetic128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Arithmetic256TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/ArithmeticAddTestsContract.sol +196 -0
- package/contracts/mocks/utils/mpc/ArithmeticMulTestsContract.sol +194 -0
- package/contracts/mocks/utils/mpc/ArithmeticSigned128TestsContract.sol +63 -0
- package/contracts/mocks/utils/mpc/ArithmeticSigned256TestsContract.sol +107 -0
- package/contracts/mocks/utils/mpc/ArithmeticSignedNarrowTestsContract.sol +123 -0
- package/contracts/mocks/utils/mpc/ArithmeticSubTestsContract.sol +196 -0
- package/contracts/mocks/utils/mpc/Bitwise128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Bitwise256TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/BitwiseTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/CheckedArithmetic128WithOverflowBitTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/CheckedArithmetic256WithOverflowBitTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/CheckedArithmeticWIthOverflowBitTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Comparison128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Comparison1TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Comparison256TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Comparison2TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/MinMax128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/MinMax256TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/MinMaxTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/MinimalImplementation.sol +1 -1
- package/contracts/mocks/utils/mpc/MinimalProxy.sol +1 -1
- package/contracts/mocks/utils/mpc/Miscellaneous1TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/MiscellaneousTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/MpcOperations128TestContract.sol +1 -1
- package/contracts/mocks/utils/mpc/MpcOperationsTestContract.sol +4 -4
- package/contracts/mocks/utils/mpc/Mux128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Mux256TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract.sol +1 -1
- package/contracts/mocks/utils/mpc/OnBoard128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/OnBoard256TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/PrivacyImplementationV1.sol +1 -1
- package/contracts/mocks/utils/mpc/PrivacyImplementationV2.sol +1 -1
- package/contracts/mocks/utils/mpc/PrivacyProxy.sol +1 -1
- package/contracts/mocks/utils/mpc/Random128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Random256TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Shift128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Shift256TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/ShiftTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/StringTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Transfer128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/Transfer256TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/TransferScalarTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/TransferTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/TransferWithAllowance128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/TransferWithAllowance256TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/ValidateCiphertext128TestsContract.sol +1 -1
- package/contracts/mocks/utils/mpc/ValidateCiphertext256TestsContract.sol +2 -2
- package/contracts/mocks/utils/mpc/ValidateCiphertextTestsContract.sol +1 -1
- package/contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock.sol +1 -1
- package/contracts/node/CotiNodeRewards.sol +3 -3
- package/contracts/node/SoulboundNodeNFT.sol +1 -2
- package/contracts/onboard/AccountOnboard.sol +1 -1
- package/contracts/oracle/ICotiPriceConsumer.sol +1 -1
- package/contracts/pod/IInbox.sol +231 -0
- package/contracts/pod/IInboxMiner.sol +53 -0
- package/contracts/pod/InboxUser.sol +29 -0
- package/contracts/pod/InboxUserCotiTestnet.sol +13 -0
- package/contracts/pod/PodNetworkConstants.sol +30 -0
- package/contracts/pod/examples/MpcAdder.sol +57 -0
- package/contracts/pod/examples/MpcAdderPausable.sol +25 -0
- package/contracts/pod/examples/MpcAdderPausable.sol.bak +25 -0
- package/contracts/pod/examples/it128/PodAdder128.sol +48 -0
- package/contracts/pod/examples/it256/PodAdder256.sol +48 -0
- package/contracts/pod/fee/IInboxFeeManager.sol +40 -0
- package/contracts/pod/manifest.json +52 -0
- package/contracts/pod/mpc/PodLib.sol +10 -0
- package/contracts/pod/mpc/PodLib128.sol +361 -0
- package/contracts/pod/mpc/PodLib256.sol +361 -0
- package/contracts/pod/mpc/PodLib64.sol +385 -0
- package/contracts/pod/mpc/PodLibBase.sol +72 -0
- package/contracts/pod/mpc/PodUser.sol +58 -0
- package/contracts/pod/mpc/PodUserFuji.sol +14 -0
- package/contracts/pod/mpc/PodUserSepolia.sol +13 -0
- package/contracts/pod/mpc/coti-side/IPodExecutorOps.sol +99 -0
- package/contracts/pod/mpccodec/MpcAbiCodec.sol +482 -0
- package/contracts/pod/privacy/IPodPriceOracle.sol +20 -0
- package/contracts/pod/privacy/IPrivacyPortal.sol +248 -0
- package/contracts/pod/privacy/IPrivacyPortalFactory.sol +88 -0
- package/contracts/pod/privacy/PortalFeeOracle.sol +51 -0
- package/contracts/pod/privacy/PrivacyPortal.sol +871 -0
- package/contracts/pod/privacy/PrivacyPortalFactory.sol +492 -0
- package/contracts/pod/privacy/PrivacyPortalFeeLib.sol +98 -0
- package/contracts/pod/privacy/mocks/CloneHelper.sol +14 -0
- package/contracts/pod/privacy/mocks/MockERC20.sol +26 -0
- package/contracts/pod/privacy/mocks/MockPodERC20ForPortal.sol +160 -0
- package/contracts/pod/privacy/mocks/MockPrivacyPortalFactory.sol +125 -0
- package/contracts/pod/privacy/mocks/MockWrappedNative.sol +24 -0
- package/contracts/pod/token/erc7984/Erc7984Constants.sol +9 -0
- package/contracts/pod/token/erc7984/Erc7984Pointers.sol +29 -0
- package/contracts/pod/token/erc7984/IERC7984.sol +69 -0
- package/contracts/pod/token/erc7984/IERC7984PortalWrapper.sol +31 -0
- package/contracts/pod/token/erc7984/PodErc7984Mixin.sol +125 -0
- package/contracts/pod/token/erc7984/README.md +60 -0
- package/contracts/pod/token/perc20/IPodERC20.sol +298 -0
- package/contracts/pod/token/perc20/PodERC20.sol +1021 -0
- package/contracts/pod/token/perc20/PodErc20Mintable.sol +88 -0
- package/contracts/pod/token/perc20/PodErc20MintableInitializable.sol +42 -0
- package/contracts/pod/token/perc20/cotiside/IPodErc20CotiSide.sol +88 -0
- package/contracts/pod/token/perc20/cotiside/PodErc20CotiMother.sol +529 -0
- package/contracts/pod/utils/IWrappedNative.sol +11 -0
- package/contracts/privacyBridge/PrivacyBridge.sol +5 -5
- package/contracts/privacyBridge/PrivacyBridgeCotiNative.sol +1 -1
- package/contracts/privacyBridge/PrivacyBridgeERC20.sol +1 -1
- package/contracts/privacyBridge/PrivacyBridgeUSDCe.sol +1 -1
- package/contracts/privacyBridge/PrivacyBridgeUSDT.sol +1 -1
- package/contracts/privacyBridge/PrivacyBridgeWADA.sol +1 -1
- package/contracts/privacyBridge/PrivacyBridgeWBTC.sol +1 -1
- package/contracts/privacyBridge/PrivacyBridgeWETH.sol +1 -1
- package/contracts/privacyBridge/PrivacyBridgegCoti.sol +1 -1
- package/contracts/token/PrivateERC20/IPrivateERC20.sol +1 -1
- package/contracts/token/PrivateERC20/ITokenReceiver.sol +1 -1
- package/contracts/token/PrivateERC20/ITokenReceiverEncrypted.sol +1 -1
- package/contracts/token/PrivateERC20/PrivateERC20.sol +5 -5
- package/contracts/token/PrivateERC20/tokens/PrivateBridgedUSDC.sol +1 -1
- package/contracts/token/PrivateERC20/tokens/PrivateCOTI.sol +1 -1
- package/contracts/token/PrivateERC20/tokens/PrivateCOTITreasuryGovernanceToken.sol +1 -1
- package/contracts/token/PrivateERC20/tokens/PrivateTetherUSD.sol +1 -1
- package/contracts/token/PrivateERC20/tokens/PrivateWrappedADA.sol +1 -1
- package/contracts/token/PrivateERC20/tokens/PrivateWrappedBTC.sol +1 -1
- package/contracts/token/PrivateERC20/tokens/PrivateWrappedEther.sol +1 -1
- package/contracts/token/PrivateERC721/IERC721Errors.sol +1 -1
- package/contracts/token/PrivateERC721/PrivateERC721.sol +1 -1
- package/contracts/token/PrivateERC721/extensions/IPrivateERC721URIStorage.sol +1 -1
- package/contracts/token/PrivateERC721/extensions/PrivateERC721URIStorage.sol +1 -1
- package/contracts/token/points/CotiTokenPoints004.sol +43 -0
- package/contracts/utils/mpc/MpcCore.sol +610 -1
- package/contracts/utils/mpc/MpcInterface.sol +1 -1
- package/hardhat.config.ts +5 -14
- package/package.json +4 -4
- package/scripts/deployCotiTokenPoints004.ts +61 -0
- package/scripts/deployFixedRatioCoinDisperserUnlimitedWindow.ts +68 -0
- package/scripts/verifyCotiTokenPoints004.ts +123 -0
- package/scripts/verifyFixedRatioCoinDisperserUnlimitedWindow.ts +112 -0
- package/test/messaging/PrivateMessaging.test.ts +5 -5
- package/test/pod/privacy/PrivacyPortal.access.test.ts +756 -0
- package/test/pod/privacy/PrivacyPortal.recovery.test.ts +263 -0
- package/test/privacyBridge/UnifiedPrivacyBridges.test.cjs +5 -3
- package/test/utils/mpc/CheckedSignedArithmetic256.test.ts +163 -0
- package/test/utils/mpc/NegativeCases.test.ts +3 -3
- package/test/utils/mpc/Precompile.test.ts +6 -6
- package/typechain-types/@openzeppelin/contracts/access/AccessControl.ts +2 -2
- package/typechain-types/@openzeppelin/contracts/access/IAccessControl.ts +2 -2
- package/typechain-types/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.ts +375 -0
- package/typechain-types/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.ts +329 -0
- package/typechain-types/@openzeppelin/contracts/access/extensions/index.ts +5 -0
- package/typechain-types/@openzeppelin/contracts/access/index.ts +2 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/IERC1363.ts +412 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/IERC5267.ts +151 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.ts +6 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/index.ts +4 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/ERC20.ts +6 -50
- package/typechain-types/@openzeppelin/contracts/token/ERC20/IERC20.ts +6 -6
- package/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.ts +313 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/ERC20Pausable.ts +356 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.ts +423 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.ts +6 -6
- package/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/index.ts +3 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/index.ts +2 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/utils/index.ts +4 -0
- package/typechain-types/@openzeppelin/contracts/utils/Nonces.ts +85 -0
- package/typechain-types/@openzeppelin/contracts/utils/Pausable.ts +150 -0
- package/typechain-types/@openzeppelin/contracts/utils/ReentrancyGuard.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/utils/ShortStrings.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/utils/Strings.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/utils/cryptography/ECDSA.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/utils/cryptography/EIP712.ts +151 -0
- package/typechain-types/@openzeppelin/contracts/utils/cryptography/index.ts +5 -0
- package/typechain-types/@openzeppelin/contracts/utils/index.ts +9 -0
- package/typechain-types/@openzeppelin/contracts/utils/math/SafeCast.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/utils/math/index.ts +4 -0
- package/typechain-types/contracts/mocks/token/ERC20DecimalsMock.ts +6 -50
- package/typechain-types/contracts/mocks/token/ERC20Mock.ts +6 -50
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivacyBridgeERC20Mock.ts +16 -2
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivateERC20AuditorSupplyMock.ts +2 -2
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivateERC20CappedMock.ts +2 -2
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivateERC20Mock.ts +2 -2
- package/typechain-types/contracts/privacyBridge/PrivacyBridge.ts +16 -2
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeCotiNative.ts +16 -2
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeERC20.sol/PrivacyBridgeERC20.ts +16 -2
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeUSDCe.ts +16 -2
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeUSDT.ts +16 -2
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeWADA.ts +16 -2
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeWBTC.ts +16 -2
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeWETH.ts +16 -2
- package/typechain-types/contracts/privacyBridge/PrivacyBridgegCoti.ts +16 -2
- package/typechain-types/contracts/token/PrivateERC20/PrivateERC20.ts +2 -2
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateBridgedUSDC.ts +2 -2
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateCOTI.ts +2 -2
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateCOTITreasuryGovernanceToken.ts +2 -2
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateTetherUSD.ts +2 -2
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateWrappedADA.ts +2 -2
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateWrappedBTC.ts +2 -2
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateWrappedEther.ts +2 -2
- package/typechain-types/contracts/token/index.ts +2 -0
- package/typechain-types/contracts/token/points/CotiTokenPoints004.sol/COTITokenPoints004.ts +826 -0
- package/typechain-types/contracts/token/points/CotiTokenPoints004.ts +826 -0
- package/typechain-types/contracts/token/points/index.ts +4 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/AccessControl__factory.ts +22 -1
- package/typechain-types/factories/@openzeppelin/contracts/access/IAccessControl__factory.ts +22 -1
- package/typechain-types/factories/@openzeppelin/contracts/access/Ownable__factory.ts +22 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/extensions/AccessControlEnumerable__factory.ts +316 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable__factory.ts +265 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/extensions/index.ts +5 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/index.ts +1 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/IERC1363__factory.ts +393 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/IERC5267__factory.ts +71 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors__factory.ts +127 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors__factory.ts +111 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors__factory.ts +128 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.ts +6 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/index.ts +3 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory.ts +84 -110
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.ts +3 -3
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable__factory.ts +364 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/ERC20Pausable__factory.ts +382 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit__factory.ts +540 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata__factory.ts +3 -3
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/index.ts +3 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/index.ts +1 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/utils/SafeERC20__factory.ts +96 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/utils/index.ts +4 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/ERC721__factory.ts +98 -59
- package/typechain-types/factories/@openzeppelin/contracts/utils/Nonces__factory.ts +57 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/Pausable__factory.ts +71 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/ReentrancyGuard__factory.ts +30 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/ShortStrings__factory.ts +83 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/Strings__factory.ts +90 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/cryptography/ECDSA__factory.ts +91 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/cryptography/EIP712__factory.ts +87 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/cryptography/index.ts +5 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/index.ts +7 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/math/SafeCast__factory.ts +118 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/math/index.ts +4 -0
- package/typechain-types/factories/contracts/disperse/coinByRatio/FixedRatioCoinDisperserLeftoverS1__factory.ts +12 -1
- package/typechain-types/factories/contracts/disperse/coinByRatio/FixedRatioCoinDisperserUnlimitedWindow__factory.ts +39 -1
- package/typechain-types/factories/contracts/disperse/coinByRatio/FixedRatioCoinDisperser__factory.ts +12 -1
- package/typechain-types/factories/contracts/disperse/disperseToken/MintDisperser.sol/MintDisperser__factory.ts +23 -1
- package/typechain-types/factories/contracts/disperse/disperseToken/TokenDisperser__factory.ts +12 -1
- package/typechain-types/factories/contracts/messaging/PrivateMessaging__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/messaging/PrivateMessagingHarness__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/token/ERC20DecimalsMock__factory.ts +90 -52
- package/typechain-types/factories/contracts/mocks/token/ERC20Mock__factory.ts +90 -52
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivacyBridgeERC20Mock__factory.ts +90 -2
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20AuditorSupplyMock__factory.ts +28 -2
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20CappedMock__factory.ts +28 -2
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20GtCallerMock__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20Mock__factory.ts +28 -2
- package/typechain-types/factories/contracts/mocks/token/PrivateERC721/PrivateERC721URIStorageMock__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Arithmetic128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Arithmetic256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/ArithmeticTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Bitwise128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Bitwise256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/BitwiseTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/CheckedArithmetic128WithOverflowBitTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/CheckedArithmetic256WithOverflowBitTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/CheckedArithmeticWIthOverflowBitTestsContract.sol/CheckedArithmeticWithOverflowBitTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison1TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison2TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinMax128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinMax256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinMaxTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinimalImplementation__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Miscellaneous1TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MiscellaneousTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MpcOperations128TestContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MpcOperationsTestContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Mux128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Mux256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/OnBoard128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/OnBoard256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/PrivacyImplementationV1__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/PrivacyImplementationV2__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Random128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Random256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Shift128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Shift256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/ShiftTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/StringTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Transfer128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Transfer256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferScalarTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_16TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_32TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_64TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance64_8TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceScalarTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowanceTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/ValidateCiphertext128TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/ValidateCiphertext256TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/ValidateCiphertextTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock__factory.ts +1 -1
- package/typechain-types/factories/contracts/node/CotiNodeRewards__factory.ts +28 -1
- package/typechain-types/factories/contracts/node/SoulboundNodeNFT.sol/SoulboundNodeNFT__factory.ts +126 -1
- package/typechain-types/factories/contracts/onboard/AccountOnboard__factory.ts +1 -1
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeCotiNative__factory.ts +79 -2
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeERC20.sol/PrivacyBridgeERC20__factory.ts +89 -1
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeUSDCe__factory.ts +90 -2
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeUSDT__factory.ts +90 -2
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeWADA__factory.ts +90 -2
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeWBTC__factory.ts +90 -2
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeWETH__factory.ts +90 -2
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridge__factory.ts +78 -1
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgegCoti__factory.ts +90 -2
- package/typechain-types/factories/contracts/token/PrivateERC20/PrivateERC20__factory.ts +27 -1
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateBridgedUSDC__factory.ts +28 -2
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateCOTITreasuryGovernanceToken__factory.ts +28 -2
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateCOTI__factory.ts +28 -2
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateTetherUSD__factory.ts +28 -2
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateWrappedADA__factory.ts +28 -2
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateWrappedBTC__factory.ts +28 -2
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateWrappedEther__factory.ts +28 -2
- package/typechain-types/factories/contracts/token/index.ts +1 -0
- package/typechain-types/factories/contracts/token/points/CotiTokenPoints004.sol/COTITokenPoints004__factory.ts +992 -0
- package/typechain-types/factories/contracts/token/points/CotiTokenPoints004__factory.ts +992 -0
- package/typechain-types/factories/contracts/token/points/index.ts +4 -0
- package/typechain-types/factories/contracts/utils/mpc/MpcCore__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +360 -0
- package/typechain-types/index.ts +36 -4
- package/contracts/mocks/utils/mpc/ArithmeticTestsContract.sol +0 -408
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.
|
|
2
|
+
pragma solidity ^0.8.20;
|
|
3
3
|
|
|
4
4
|
import "../../../utils/mpc/MpcCore.sol";
|
|
5
5
|
|
|
@@ -234,7 +234,7 @@ contract MpcOperationsTestContract {
|
|
|
234
234
|
gtUint256 gtB = MpcCore.validateCiphertext(b);
|
|
235
235
|
|
|
236
236
|
gtBool result = MpcCore.eq(gtA, gtB);
|
|
237
|
-
gtUint256 resultAsUint = MpcCore.mux(result, MpcCore.setPublic256(1), MpcCore.setPublic256(0));
|
|
237
|
+
gtUint256 resultAsUint = MpcCore.mux(result, MpcCore.setPublic256(uint256(1)), MpcCore.setPublic256(uint256(0)));
|
|
238
238
|
|
|
239
239
|
ctUint256 memory ctResult = MpcCore.offBoardToUser(resultAsUint, user);
|
|
240
240
|
|
|
@@ -256,7 +256,7 @@ contract MpcOperationsTestContract {
|
|
|
256
256
|
gtUint256 gtB = MpcCore.validateCiphertext(b);
|
|
257
257
|
|
|
258
258
|
gtBool result = MpcCore.gt(gtA, gtB);
|
|
259
|
-
gtUint256 resultAsUint = MpcCore.mux(result, MpcCore.setPublic256(1), MpcCore.setPublic256(0));
|
|
259
|
+
gtUint256 resultAsUint = MpcCore.mux(result, MpcCore.setPublic256(uint256(1)), MpcCore.setPublic256(uint256(0)));
|
|
260
260
|
|
|
261
261
|
ctUint256 memory ctResult = MpcCore.offBoardToUser(resultAsUint, user);
|
|
262
262
|
|
|
@@ -278,7 +278,7 @@ contract MpcOperationsTestContract {
|
|
|
278
278
|
gtUint256 gtB = MpcCore.validateCiphertext(b);
|
|
279
279
|
|
|
280
280
|
gtBool result = MpcCore.lt(gtA, gtB);
|
|
281
|
-
gtUint256 resultAsUint = MpcCore.mux(result, MpcCore.setPublic256(1), MpcCore.setPublic256(0));
|
|
281
|
+
gtUint256 resultAsUint = MpcCore.mux(result, MpcCore.setPublic256(uint256(1)), MpcCore.setPublic256(uint256(0)));
|
|
282
282
|
|
|
283
283
|
ctUint256 memory ctResult = MpcCore.offBoardToUser(resultAsUint, user);
|
|
284
284
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.
|
|
2
|
+
pragma solidity ^0.8.20;
|
|
3
3
|
|
|
4
4
|
import "../../../utils/mpc/MpcCore.sol";
|
|
5
5
|
|
|
@@ -51,7 +51,7 @@ contract ValidateCiphertext256TestsContract {
|
|
|
51
51
|
gtUint256 validatedValue = MpcCore.validateCiphertext(input);
|
|
52
52
|
|
|
53
53
|
// Add 1 to the value
|
|
54
|
-
gtUint256 one = MpcCore.setPublic256(1);
|
|
54
|
+
gtUint256 one = MpcCore.setPublic256(uint256(1));
|
|
55
55
|
gtUint256 result = MpcCore.add(validatedValue, one);
|
|
56
56
|
|
|
57
57
|
// Decrypt and return
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.
|
|
2
|
+
pragma solidity ^0.8.20;
|
|
3
3
|
|
|
4
4
|
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
|
|
5
|
-
import {ReentrancyGuard} from "@openzeppelin/contracts/
|
|
5
|
+
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @title CotiNodeRewards
|
|
@@ -59,7 +59,7 @@ contract CotiNodeRewards is Ownable, ReentrancyGuard {
|
|
|
59
59
|
error AlreadyRewardedInEpoch(address wallet, uint256 epoch);
|
|
60
60
|
error InvalidEpoch(uint256 epoch);
|
|
61
61
|
|
|
62
|
-
constructor() Ownable() {
|
|
62
|
+
constructor() Ownable(msg.sender) {
|
|
63
63
|
eligibilityRules[RULE_PLATFORM_COTI_AMOUNT] = 100_000 * 10**DECIMALS_COTI; // 100k COTI
|
|
64
64
|
eligibilityRules[RULE_PLATFORM_USDC_AMOUNT] = 50_000 * 10**DECIMALS_USDC; // 50k USDC
|
|
65
65
|
eligibilityRules[RULE_FULL_NODE_UPTIME_PERCENTAGE_THRESHOLD] = 98; // 98%
|
|
@@ -121,8 +121,7 @@ contract SoulboundNodeNFT is ERC721, Ownable, IERC5192 {
|
|
|
121
121
|
string memory name_,
|
|
122
122
|
string memory symbol_,
|
|
123
123
|
address initialOwner
|
|
124
|
-
) ERC721(name_, symbol_) {
|
|
125
|
-
_transferOwnership(initialOwner);
|
|
124
|
+
) ERC721(name_, symbol_) Ownable(initialOwner) {
|
|
126
125
|
mintPaused = false;
|
|
127
126
|
}
|
|
128
127
|
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
// SPDX-License-Identifier: UNLICENSED
|
|
2
|
+
pragma solidity ^0.8.20;
|
|
3
|
+
|
|
4
|
+
/// @title IInbox
|
|
5
|
+
/// @notice Cross-chain request/response inbox: send messages to remote chains, execute incoming calls, and query state.
|
|
6
|
+
/// @dev Fee-related fields on {Request} are **gas unit** budgets, not wei. See {InboxFeeManager}.
|
|
7
|
+
interface IInbox {
|
|
8
|
+
// --- Types ---
|
|
9
|
+
|
|
10
|
+
/// @notice Classification of the current inbox execution when delivering an error callback.
|
|
11
|
+
/// @dev Used by source `errorSelector` handlers: ignore {NotErrorContext}; branch on {SystemError} vs {Exception}.
|
|
12
|
+
/// Call only from `errorSelector` entrypoints — linked success `respond` legs can also report {Exception}.
|
|
13
|
+
enum InboxErrorType {
|
|
14
|
+
/// @notice No active message, or the active call is not a linked error/system delivery.
|
|
15
|
+
NotErrorContext,
|
|
16
|
+
/// @notice Inbox system-error return leg (`originalSender` is {SYSTEM_SENDER}).
|
|
17
|
+
SystemError,
|
|
18
|
+
/// @notice Linked return leg for a request that registered an `errorSelector` (app `raise`).
|
|
19
|
+
Exception
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/// @notice Minimal payload for Inbox system-error callbacks (`errorSelector(bytes data)`).
|
|
23
|
+
/// @dev App `raise` payloads are dApp-defined; decode them only when {inboxErrorType()} is {Exception}.
|
|
24
|
+
/// System encode failure uses `errorCode = 2`. Attribution is via {SYSTEM_SENDER} on the return leg.
|
|
25
|
+
struct ErrorData {
|
|
26
|
+
uint64 errorCode;
|
|
27
|
+
bytes message;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/// @notice Encoded method call and optional MPC ABI metadata.
|
|
31
|
+
struct MpcMethodCall {
|
|
32
|
+
/// @notice Function selector to re-encode with MPC GTs; zero means `data` is raw calldata.
|
|
33
|
+
bytes4 selector;
|
|
34
|
+
/// @notice ABI-encoded arguments or raw calldata.
|
|
35
|
+
bytes data;
|
|
36
|
+
/// @notice MPC datatype descriptors used by {MpcAbiCodec}.
|
|
37
|
+
bytes8[] datatypes;
|
|
38
|
+
/// @notice MPC ciphertext length descriptors used by {MpcAbiCodec}.
|
|
39
|
+
bytes32[] datalens;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/// @notice Stored outbound or incoming cross-chain request.
|
|
43
|
+
struct Request {
|
|
44
|
+
/// @notice Packed request id containing source chain id and nonce.
|
|
45
|
+
bytes32 requestId;
|
|
46
|
+
/// @notice Destination chain id for outbound requests, or source chain id for incoming requests.
|
|
47
|
+
uint256 targetChainId;
|
|
48
|
+
/// @notice Contract invoked on the destination/current chain.
|
|
49
|
+
address targetContract;
|
|
50
|
+
/// @notice Method call executed on the target.
|
|
51
|
+
MpcMethodCall methodCall;
|
|
52
|
+
/// @notice Immediate caller that submitted the request.
|
|
53
|
+
address callerContract;
|
|
54
|
+
/// @notice Application contract that should receive responses/errors.
|
|
55
|
+
address originalSender;
|
|
56
|
+
/// @notice Request creation or ingestion timestamp.
|
|
57
|
+
uint64 timestamp;
|
|
58
|
+
/// @notice Callback selector used for two-way success responses.
|
|
59
|
+
bytes4 callbackSelector;
|
|
60
|
+
/// @notice Error selector invoked with `errorSelector(bytes data)` for app `raise` **or** Inbox system errors.
|
|
61
|
+
/// @dev Same delivery path. Distinguish with {inboxErrorType()}: {SystemError} ({ErrorData} payload,
|
|
62
|
+
/// {SYSTEM_SENDER}) vs {Exception} (dApp-defined `raise` bytes). System errors are not eligible for
|
|
63
|
+
/// `retryFailedRequest`. Auth: `onlyInbox` + non-zero {inboxSourceRequestId}.
|
|
64
|
+
bytes4 errorSelector;
|
|
65
|
+
/// @notice True when a success response is expected.
|
|
66
|
+
bool isTwoWay;
|
|
67
|
+
/// @notice True after an incoming request or linked response has been processed.
|
|
68
|
+
bool executed;
|
|
69
|
+
/// @dev If this request is a one-way response or error delivery, links to the original two-way request ID.
|
|
70
|
+
bytes32 sourceRequestId;
|
|
71
|
+
/// @dev Gas unit budget for the remote execution leg (`call{gas: ...}` cap). Not wei.
|
|
72
|
+
uint256 targetFee;
|
|
73
|
+
/// @dev Gas unit budget for the callback leg on the source chain. Not wei.
|
|
74
|
+
uint256 callerFee;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/// @notice Response metadata for an incoming request.
|
|
78
|
+
struct Response {
|
|
79
|
+
/// @notice Outbound request id that delivered the response.
|
|
80
|
+
bytes32 responseRequestId;
|
|
81
|
+
/// @notice Response payload returned by the target contract.
|
|
82
|
+
bytes response;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/// @notice Stored execution or encoding error for a request.
|
|
86
|
+
struct Error {
|
|
87
|
+
/// @notice Request id that failed.
|
|
88
|
+
bytes32 requestId;
|
|
89
|
+
/// @notice Protocol-defined error code.
|
|
90
|
+
uint64 errorCode;
|
|
91
|
+
/// @notice Revert data or encoded error message.
|
|
92
|
+
bytes errorMessage;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/// @notice Active incoming execution context exposed to target contracts.
|
|
96
|
+
struct ExecutionContext {
|
|
97
|
+
/// @notice Remote chain that sent the current request.
|
|
98
|
+
uint256 remoteChainId;
|
|
99
|
+
/// @notice Remote contract that sent the current request.
|
|
100
|
+
address remoteContract;
|
|
101
|
+
/// @notice Current incoming request id.
|
|
102
|
+
bytes32 requestId;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// --- External: sends (payable) ---
|
|
106
|
+
|
|
107
|
+
/// @notice Send a two-way message with callback and error handlers on the remote chain.
|
|
108
|
+
/// @param targetChainId Destination chain ID.
|
|
109
|
+
/// @param targetContract Contract to call on the destination chain.
|
|
110
|
+
/// @param methodCall Calldata and MPC metadata.
|
|
111
|
+
/// @param callbackSelector Selector invoked on the source chain when the remote call succeeds.
|
|
112
|
+
/// @param errorSelector Selector invoked on the source chain when the remote call fails.
|
|
113
|
+
/// @param callbackFeeLocalWei Wei from `msg.value` reserved for the callback leg (converted to gas units in fee logic).
|
|
114
|
+
/// @return requestId The new outbound request ID.
|
|
115
|
+
function sendTwoWayMessage(
|
|
116
|
+
uint256 targetChainId,
|
|
117
|
+
address targetContract,
|
|
118
|
+
MpcMethodCall calldata methodCall,
|
|
119
|
+
bytes4 callbackSelector,
|
|
120
|
+
bytes4 errorSelector,
|
|
121
|
+
uint256 callbackFeeLocalWei
|
|
122
|
+
) external payable returns (bytes32);
|
|
123
|
+
|
|
124
|
+
/// @notice Send a one-way message with an error handler only (no callback).
|
|
125
|
+
/// @param targetChainId Destination chain ID.
|
|
126
|
+
/// @param targetContract Contract to call on the destination chain.
|
|
127
|
+
/// @param methodCall Calldata and MPC metadata.
|
|
128
|
+
/// @param errorSelector Selector invoked on error.
|
|
129
|
+
/// @return requestId The new outbound request ID.
|
|
130
|
+
function sendOneWayMessage(
|
|
131
|
+
uint256 targetChainId,
|
|
132
|
+
address targetContract,
|
|
133
|
+
MpcMethodCall calldata methodCall,
|
|
134
|
+
bytes4 errorSelector
|
|
135
|
+
) external payable returns (bytes32);
|
|
136
|
+
|
|
137
|
+
// --- External: execution (non-payable) ---
|
|
138
|
+
|
|
139
|
+
/// @notice Respond to the current incoming message (two-way flow).
|
|
140
|
+
/// @dev Gas for the return leg is **not** charged again: it uses the `callerFee` budget from the original two-way request.
|
|
141
|
+
/// @param data Payload routed to the original sender via `callbackSelector`.
|
|
142
|
+
function respond(bytes memory data) external;
|
|
143
|
+
|
|
144
|
+
/// @notice Signal an application error for the current incoming two-way message (same routing constraints as {respond}).
|
|
145
|
+
/// @dev Gas for the return leg is **not** charged again: it uses the `callerFee` budget from the original two-way request.
|
|
146
|
+
/// @param data ABI-encoded argument for the remote `errorSelector(bytes)`.
|
|
147
|
+
function raise(bytes memory data) external;
|
|
148
|
+
|
|
149
|
+
// --- External: views ---
|
|
150
|
+
|
|
151
|
+
/// @notice Return error details for a failed outgoing request.
|
|
152
|
+
/// @param requestId Outbound request ID.
|
|
153
|
+
/// @return code Error code.
|
|
154
|
+
/// @return message Error message or revert data.
|
|
155
|
+
function getOutboxError(bytes32 requestId) external view returns (uint256 code, string memory message);
|
|
156
|
+
|
|
157
|
+
/// @notice Return stored response bytes for a completed incoming flow.
|
|
158
|
+
/// @param requestId Incoming request ID.
|
|
159
|
+
/// @return response Response payload.
|
|
160
|
+
function getInboxResponse(bytes32 requestId) external view returns (bytes memory);
|
|
161
|
+
|
|
162
|
+
/// @notice Return a slice of outbound requests sent to `targetChainId`, in per-target nonce order.
|
|
163
|
+
/// @param targetChainId Destination chain whose outbound requests to read.
|
|
164
|
+
/// @param from Start index (0-based) within that target's sequence.
|
|
165
|
+
/// @param len Maximum number of requests to return.
|
|
166
|
+
/// @return requestsList Request structs.
|
|
167
|
+
function getRequests(uint256 targetChainId, uint256 from, uint256 len)
|
|
168
|
+
external
|
|
169
|
+
view
|
|
170
|
+
returns (Request[] memory);
|
|
171
|
+
|
|
172
|
+
/// @notice Total count of outbound requests issued from this inbox to `targetChainId`.
|
|
173
|
+
/// @param targetChainId Destination chain.
|
|
174
|
+
/// @return count Number of requests to that target.
|
|
175
|
+
function getRequestsLen(uint256 targetChainId) external view returns (uint256);
|
|
176
|
+
|
|
177
|
+
/// @notice Look up a stored outbound request by its id (id encodes source+target+nonce).
|
|
178
|
+
/// @param requestId Outbound request id.
|
|
179
|
+
/// @return request The stored request (zeroed if unknown).
|
|
180
|
+
function getRequest(bytes32 requestId) external view returns (Request memory);
|
|
181
|
+
|
|
182
|
+
/// @notice Look up a stored incoming request by its id (id encodes the source chain).
|
|
183
|
+
/// @param requestId Incoming request id.
|
|
184
|
+
/// @return request The stored incoming request (zeroed if unknown).
|
|
185
|
+
function getIncomingRequest(bytes32 requestId) external view returns (Request memory);
|
|
186
|
+
|
|
187
|
+
/// @notice Remote chain ID and contract for the currently executing incoming message.
|
|
188
|
+
/// @dev For system-error return legs, `contractAddress` is {SYSTEM_SENDER}. Success callbacks still
|
|
189
|
+
/// come from the real remote peer; error callbacks should not require peer equality.
|
|
190
|
+
/// @return chainId Remote chain ID.
|
|
191
|
+
/// @return contractAddress Remote caller contract (or {SYSTEM_SENDER} for Inbox system errors).
|
|
192
|
+
function inboxMsgSender() external view returns (uint256 chainId, address contractAddress);
|
|
193
|
+
|
|
194
|
+
/// @notice Request ID for the currently executing incoming message.
|
|
195
|
+
/// @return requestId Active request ID.
|
|
196
|
+
function inboxRequestId() external view returns (bytes32);
|
|
197
|
+
|
|
198
|
+
/// @notice Source request ID linked from the current incoming message (if any).
|
|
199
|
+
/// @dev Non-zero only for reply/error legs created by {respond}, {raise}, or system-error delivery.
|
|
200
|
+
/// Public {sendOneWayMessage}/{sendTwoWayMessage} always use `sourceRequestId = 0`.
|
|
201
|
+
/// @return sourceRequestId Linked request ID.
|
|
202
|
+
function inboxSourceRequestId() external view returns (bytes32);
|
|
203
|
+
|
|
204
|
+
/// @notice Whether the current execution is delivering a system error, an app `raise`, or neither.
|
|
205
|
+
/// @dev Safe to call outside an active message (returns {InboxErrorType.NotErrorContext}). Prefer this over
|
|
206
|
+
/// requiring `inboxMsgSender()` peer equality in error handlers.
|
|
207
|
+
/// @return errorType {InboxErrorType} for the active context.
|
|
208
|
+
function inboxErrorType() external view returns (InboxErrorType errorType);
|
|
209
|
+
|
|
210
|
+
// --- External: pure ---
|
|
211
|
+
|
|
212
|
+
/// @notice Pack source chain id (64 bits), target chain id (64 bits) and nonce (128 bits) into a request id.
|
|
213
|
+
/// @param sourceChainId Originating chain id.
|
|
214
|
+
/// @param targetChainId Destination chain id.
|
|
215
|
+
/// @param nonce Per-target nonce.
|
|
216
|
+
/// @return requestId 256-bit packed id.
|
|
217
|
+
function getRequestId(uint256 sourceChainId, uint256 targetChainId, uint256 nonce)
|
|
218
|
+
external
|
|
219
|
+
pure
|
|
220
|
+
returns (bytes32);
|
|
221
|
+
|
|
222
|
+
/// @notice Split a packed request id into source chain id, target chain id and nonce.
|
|
223
|
+
/// @param requestId Packed id.
|
|
224
|
+
/// @return sourceChainId Source chain id.
|
|
225
|
+
/// @return targetChainId Target chain id.
|
|
226
|
+
/// @return nonce Per-target nonce.
|
|
227
|
+
function unpackRequestId(bytes32 requestId)
|
|
228
|
+
external
|
|
229
|
+
pure
|
|
230
|
+
returns (uint256 sourceChainId, uint256 targetChainId, uint256 nonce);
|
|
231
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// SPDX-License-Identifier: UNLICENSED
|
|
2
|
+
pragma solidity ^0.8.20;
|
|
3
|
+
|
|
4
|
+
import "./IInbox.sol";
|
|
5
|
+
|
|
6
|
+
/// @title IInboxMiner
|
|
7
|
+
/// @notice Miner API: apply mined cross-chain payloads to this chain's inbox and withdraw fees.
|
|
8
|
+
interface IInboxMiner {
|
|
9
|
+
error RetryFailedRequestNotAFailedRequest();
|
|
10
|
+
error RequestIdRequired();
|
|
11
|
+
error RetryFailedRequestExecutionFailed(bytes returnData);
|
|
12
|
+
/// @notice The `sourceChainId` passed to {batchProcessRequests} is this chain's own id.
|
|
13
|
+
error SourceChainIsThisChain(uint256 chainId);
|
|
14
|
+
/// @notice A mined request's encoded source chain does not match the batch `sourceChainId`.
|
|
15
|
+
error RequestSourceChainMismatch(bytes32 requestId, uint256 expectedSourceChainId, uint256 actualSourceChainId);
|
|
16
|
+
/// @notice A mined request's encoded target chain is not this chain.
|
|
17
|
+
error RequestTargetChainMismatch(bytes32 requestId, uint256 expectedTargetChainId, uint256 actualTargetChainId);
|
|
18
|
+
/// @notice Inbound message processing is paused (circuit breaker).
|
|
19
|
+
error MessageProcessingPaused();
|
|
20
|
+
|
|
21
|
+
/// @notice Emitted when {retryFailedRequest} successfully re-executes a previously failed incoming request.
|
|
22
|
+
event RetryFailedRequestSuccess(bytes32 indexed requestId);
|
|
23
|
+
/// @notice Emitted when the owner toggles the message-processing circuit breaker.
|
|
24
|
+
event MessageProcessingPausedUpdated(bool paused);
|
|
25
|
+
|
|
26
|
+
/// @notice Mined inbound request. `targetFee` and `callerFee` are gas unit budgets (see {IInbox.Request}).
|
|
27
|
+
struct MinedRequest {
|
|
28
|
+
bytes32 requestId;
|
|
29
|
+
address sourceContract;
|
|
30
|
+
address targetContract;
|
|
31
|
+
IInbox.MpcMethodCall methodCall;
|
|
32
|
+
bytes4 callbackSelector;
|
|
33
|
+
bytes4 errorSelector;
|
|
34
|
+
bool isTwoWay;
|
|
35
|
+
bytes32 sourceRequestId;
|
|
36
|
+
uint256 targetFee;
|
|
37
|
+
uint256 callerFee;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// @notice Validate and execute a batch of mined requests from `sourceChainId`.
|
|
41
|
+
/// @param sourceChainId Chain that produced the mined data.
|
|
42
|
+
/// @param mined Ordered requests to apply.
|
|
43
|
+
function batchProcessRequests(uint256 sourceChainId, MinedRequest[] memory mined) external;
|
|
44
|
+
|
|
45
|
+
/// @notice Withdraw accumulated native token fees to `to` (owner-only in concrete implementations).
|
|
46
|
+
function collectFees(address payable to) external;
|
|
47
|
+
|
|
48
|
+
/// @notice Pause or unpause inbound message processing (owner-only circuit breaker).
|
|
49
|
+
function setMessageProcessingPaused(bool paused) external;
|
|
50
|
+
|
|
51
|
+
/// @notice Re-execute a mined incoming request whose target call failed (e.g. OOG). Open to any payer for gas.
|
|
52
|
+
function retryFailedRequest(bytes32 requestId) external;
|
|
53
|
+
}
|