@coti-io/coti-contracts 1.1.0 → 1.3.0
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/.github/workflows/npm-publish.yml +19 -15
- package/README.md +3 -1
- package/contracts/disperse/coinByRatio/FixedRatioCoinDisperser.sol +452 -0
- package/contracts/disperse/coinByRatio/FixedRatioCoinDisperserLeftoverS1.sol +490 -0
- package/contracts/disperse/coinByRatio/FixedRatioCoinDisperserUnlimitedWindow.sol +432 -0
- package/contracts/disperse/disperseToken/MintDisperser.sol +120 -0
- package/contracts/disperse/disperseToken/TokenDisperser.sol +139 -0
- package/contracts/messaging/PrivateMessaging.sol +456 -0
- package/contracts/mocks/messaging/PrivateMessagingHarness.sol +54 -0
- package/contracts/mocks/oracle/CotiPriceConsumerMock.sol +31 -0
- package/contracts/mocks/token/ERC20DecimalsMock.sol +21 -0
- package/contracts/mocks/token/ERC20Mock.sol +19 -0
- package/contracts/mocks/token/PrivateERC20/EncryptedTokenReceiverMock.sol +18 -0
- package/contracts/mocks/token/PrivateERC20/PrivacyBridgeERC20Mock.sol +18 -0
- package/contracts/mocks/token/PrivateERC20/PrivateERC20AuditorSupplyMock.sol +44 -0
- package/contracts/mocks/token/PrivateERC20/PrivateERC20CappedMock.sol +23 -0
- package/contracts/mocks/token/PrivateERC20/PrivateERC20GtCallerMock.sol +29 -0
- package/contracts/mocks/token/PrivateERC20/PrivateERC20Mock.sol +9 -4
- package/contracts/mocks/token/PrivateERC20/PrivateERC20ReentrantReceiverMock.sol +39 -0
- package/contracts/mocks/token/PrivateERC20/PublicReentrantTokenReceiverMock.sol +29 -0
- package/contracts/mocks/token/PrivateERC20/PublicTokenReceiverBoolMock.sol +18 -0
- package/contracts/mocks/token/PrivateERC20/PublicTokenReceiverMock.sol +12 -0
- package/contracts/mocks/utils/mpc/Arithmetic128TestsContract.sol +123 -0
- package/contracts/mocks/utils/mpc/Arithmetic256TestsContract.sol +122 -0
- package/contracts/mocks/utils/mpc/Bitwise128TestsContract.sol +65 -0
- package/contracts/mocks/utils/mpc/Bitwise256TestsContract.sol +65 -0
- package/contracts/mocks/utils/mpc/CheckedArithmetic128WithOverflowBitTestsContract.sol +64 -0
- package/contracts/mocks/utils/mpc/CheckedArithmetic256WithOverflowBitTestsContract.sol +64 -0
- package/contracts/mocks/utils/mpc/Comparison128TestsContract.sol +98 -0
- package/contracts/mocks/utils/mpc/Comparison256TestsContract.sol +98 -0
- package/contracts/mocks/utils/mpc/MinMax128TestsContract.sol +44 -0
- package/contracts/mocks/utils/mpc/MinMax256TestsContract.sol +44 -0
- package/contracts/mocks/utils/mpc/MinimalImplementation.sol +55 -0
- package/contracts/mocks/utils/mpc/MinimalProxy.sol +27 -0
- package/contracts/mocks/utils/mpc/MpcOperations128TestContract.sol +267 -0
- package/contracts/mocks/utils/mpc/MpcOperationsTestContract.sol +334 -0
- package/contracts/mocks/utils/mpc/Mux128TestsContract.sol +24 -0
- package/contracts/mocks/utils/mpc/Mux256TestsContract.sol +24 -0
- package/contracts/mocks/utils/mpc/OnBoard128TestsContract.sol +93 -0
- package/contracts/mocks/utils/mpc/OnBoard256TestsContract.sol +116 -0
- package/contracts/mocks/utils/mpc/PrivacyImplementationV1.sol +157 -0
- package/contracts/mocks/utils/mpc/PrivacyImplementationV2.sol +133 -0
- package/contracts/mocks/utils/mpc/PrivacyProxy.sol +137 -0
- package/contracts/mocks/utils/mpc/Random128TestsContract.sol +32 -0
- package/contracts/mocks/utils/mpc/Random256TestsContract.sol +32 -0
- package/contracts/mocks/utils/mpc/Shift128TestsContract.sol +36 -0
- package/contracts/mocks/utils/mpc/Shift256TestsContract.sol +36 -0
- package/contracts/mocks/utils/mpc/Transfer128TestsContract.sol +29 -0
- package/contracts/mocks/utils/mpc/Transfer256TestsContract.sol +29 -0
- package/contracts/mocks/utils/mpc/TransferWithAllowance128TestsContract.sol +32 -0
- package/contracts/mocks/utils/mpc/TransferWithAllowance256TestsContract.sol +32 -0
- package/contracts/mocks/utils/mpc/ValidateCiphertext128TestsContract.sol +59 -0
- package/contracts/mocks/utils/mpc/ValidateCiphertext256TestsContract.sol +63 -0
- package/contracts/mocks/utils/mpc/ValidateCiphertextTestsContract.sol +99 -0
- package/contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock.sol +7 -6
- package/contracts/node/CotiNodeRewards.sol +199 -0
- package/contracts/node/SoulboundNodeNFT.sol +519 -0
- package/contracts/oracle/CotiPriceConsumer.sol +103 -0
- package/contracts/oracle/ICotiPriceConsumer.sol +15 -0
- package/contracts/oracle/IStdReference.sol +26 -0
- package/contracts/privacyBridge/PrivacyBridge.sol +600 -0
- package/contracts/privacyBridge/PrivacyBridgeCotiNative.sol +316 -0
- package/contracts/privacyBridge/PrivacyBridgeERC20.sol +333 -0
- package/contracts/privacyBridge/PrivacyBridgeUSDCe.sol +22 -0
- package/contracts/privacyBridge/PrivacyBridgeUSDT.sol +23 -0
- package/contracts/privacyBridge/PrivacyBridgeWADA.sol +23 -0
- package/contracts/privacyBridge/PrivacyBridgeWBTC.sol +23 -0
- package/contracts/privacyBridge/PrivacyBridgeWETH.sol +23 -0
- package/contracts/privacyBridge/PrivacyBridgegCoti.sol +23 -0
- package/contracts/token/PrivateERC20/IPrivateERC20.sol +273 -40
- package/contracts/token/PrivateERC20/ITokenReceiver.sol +17 -0
- package/contracts/token/PrivateERC20/ITokenReceiverEncrypted.sol +20 -0
- package/contracts/token/PrivateERC20/PrivateERC20.sol +861 -152
- package/contracts/token/PrivateERC20/tokens/PrivateBridgedUSDC.sol +17 -0
- package/contracts/token/PrivateERC20/tokens/PrivateCOTI.sol +13 -0
- package/contracts/token/PrivateERC20/tokens/PrivateCOTITreasuryGovernanceToken.sol +17 -0
- package/contracts/token/PrivateERC20/tokens/PrivateTetherUSD.sol +17 -0
- package/contracts/token/PrivateERC20/tokens/PrivateWrappedADA.sol +17 -0
- package/contracts/token/PrivateERC20/tokens/PrivateWrappedBTC.sol +17 -0
- package/contracts/token/PrivateERC20/tokens/PrivateWrappedEther.sol +13 -0
- package/contracts/utils/mpc/MpcCore.sol +10780 -4962
- package/contracts/utils/mpc/MpcInterface.sol +7 -2
- package/hardhat/gasPriceBump.ts +60 -0
- package/hardhat.config.ts +63 -12
- package/package.json +22 -4
- package/scripts/add-bridge-operators.cjs +87 -0
- package/scripts/deploy-coti-price-consumer-mainnet.cjs +49 -0
- package/scripts/deployCotiNodeRewards.ts +51 -0
- package/scripts/deploySoulboundNodeNFT.ts +57 -0
- package/scripts/redeploy-private-and-bridges.cjs +201 -0
- package/scripts/set-bridge-limits-mainnet.cjs +177 -0
- package/scripts/verify-mainnet-private-bridges.cjs +289 -0
- package/sonar-project.properties +11 -0
- package/test/messaging/PrivateMessaging.test.ts +158 -0
- package/test/privacyBridge/UnifiedPrivacyBridges.test.cjs +1663 -0
- package/test/token/PrivateERC20/PrivacyBridge.fees.test.ts +250 -0
- package/test/token/PrivateERC20/PrivateERC20.test.ts +1109 -268
- package/test/utils/mpc/Bitwise128.test.ts +92 -0
- package/test/utils/mpc/Bitwise256.test.ts +101 -0
- package/test/utils/mpc/BuildInputText128.test.ts +398 -0
- package/test/utils/mpc/CheckedArithmetic128.test.ts +45 -0
- package/test/utils/mpc/CheckedArithmetic256.test.ts +45 -0
- package/test/utils/mpc/Comparison128.test.ts +48 -0
- package/test/utils/mpc/Comparison256.test.ts +48 -0
- package/test/utils/mpc/InvalidCiphertext.test.ts +179 -0
- package/test/utils/mpc/InvalidCiphertext128.test.ts +179 -0
- package/test/utils/mpc/InvalidCiphertext256.test.ts +201 -0
- package/test/utils/mpc/InvalidTransfer128.test.ts +166 -0
- package/test/utils/mpc/InvalidTransfer256.test.ts +158 -0
- package/test/utils/mpc/MinMax128.test.ts +44 -0
- package/test/utils/mpc/MinMax256.test.ts +44 -0
- package/test/utils/mpc/MinimalProxyDemo.test.ts +280 -0
- package/test/utils/mpc/MpcOperations.test.ts +589 -0
- package/test/utils/mpc/MpcOperations128.test.ts +632 -0
- package/test/utils/mpc/Mux128.test.ts +41 -0
- package/test/utils/mpc/Mux256.test.ts +41 -0
- package/test/utils/mpc/NegativeCases.test.ts +478 -0
- package/test/utils/mpc/NegativeCases128.test.ts +237 -0
- package/test/utils/mpc/NegativeCases256.test.ts +236 -0
- package/test/utils/mpc/OnBoard128.test.ts +90 -0
- package/test/utils/mpc/OnBoard256.test.ts +114 -0
- package/test/utils/mpc/Precompile128.test.ts +51 -0
- package/test/utils/mpc/Precompile256.test.ts +115 -0
- package/test/utils/mpc/ProxyValidation.test.ts +199 -0
- package/test/utils/mpc/Random128.test.ts +47 -0
- package/test/utils/mpc/Random256.test.ts +47 -0
- package/test/utils/mpc/Shift128.test.ts +41 -0
- package/test/utils/mpc/Shift256.test.ts +41 -0
- package/test/utils/mpc/Transfer128.test.ts +46 -0
- package/test/utils/mpc/Transfer256.test.ts +46 -0
- package/test/utils/mpc/TransferWithAllowance128.test.ts +48 -0
- package/test/utils/mpc/TransferWithAllowance256.test.ts +48 -0
- package/test/utils/mpc/UpgradeablePrivacyProxy.test.ts +307 -0
- package/test/utils/mpc/ValidateCiphertext.test.ts +221 -0
- package/test/utils/mpc/ValidateCiphertext256.test.ts +161 -0
- package/test/utils/mpc/ValidateCiphertext256Decryption.test.ts +383 -0
- package/test/utils/mpc/WalletEncryptionFailures.test.ts +494 -0
- package/test/utils/privateErc20Helpers.ts +97 -0
- package/typechain-types/@openzeppelin/contracts/access/AccessControl.ts +324 -0
- package/typechain-types/@openzeppelin/contracts/access/AccessControlEnumerable.ts +361 -0
- package/typechain-types/@openzeppelin/contracts/access/IAccessControl.ts +292 -0
- package/typechain-types/@openzeppelin/contracts/access/IAccessControlEnumerable.ts +329 -0
- package/typechain-types/@openzeppelin/contracts/access/Ownable.ts +153 -0
- package/typechain-types/@openzeppelin/contracts/access/index.ts +8 -0
- package/typechain-types/@openzeppelin/contracts/index.ts +4 -0
- package/typechain-types/@openzeppelin/contracts/security/Pausable.ts +150 -0
- package/typechain-types/@openzeppelin/contracts/security/index.ts +4 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/ERC20.ts +330 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/IERC20.ts +262 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.ts +286 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.ts +143 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/extensions/index.ts +5 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC20/index.ts +7 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/ERC721.ts +420 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.ts +420 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/index.ts +4 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/index.ts +3 -0
- package/typechain-types/@openzeppelin/contracts/token/index.ts +2 -0
- package/typechain-types/contracts/disperse/coinByRatio/FixedRatioCoinDisperser.ts +679 -0
- package/typechain-types/contracts/disperse/coinByRatio/FixedRatioCoinDisperserLeftoverS1.ts +735 -0
- package/typechain-types/contracts/disperse/coinByRatio/FixedRatioCoinDisperserUnlimitedWindow.ts +734 -0
- package/typechain-types/contracts/disperse/coinByRatio/index.ts +6 -0
- package/typechain-types/contracts/disperse/disperseToken/MintDisperser.sol/IMintableERC20.ts +97 -0
- package/typechain-types/contracts/disperse/disperseToken/MintDisperser.sol/IOwnable.ts +95 -0
- package/typechain-types/contracts/disperse/disperseToken/MintDisperser.sol/MintDisperser.ts +228 -0
- package/typechain-types/contracts/disperse/disperseToken/MintDisperser.sol/index.ts +6 -0
- package/typechain-types/contracts/disperse/disperseToken/TokenDisperser.ts +191 -0
- package/typechain-types/contracts/disperse/disperseToken/index.ts +6 -0
- package/typechain-types/contracts/disperse/index.ts +7 -0
- package/typechain-types/contracts/index.ts +10 -0
- package/typechain-types/contracts/messaging/PrivateMessaging.ts +871 -0
- package/typechain-types/contracts/messaging/index.ts +4 -0
- package/typechain-types/contracts/mocks/index.ts +4 -0
- package/typechain-types/contracts/mocks/messaging/PrivateMessagingHarness.ts +951 -0
- package/typechain-types/contracts/mocks/messaging/index.ts +4 -0
- package/typechain-types/contracts/mocks/oracle/CotiPriceConsumerMock.ts +163 -0
- package/typechain-types/contracts/mocks/oracle/index.ts +4 -0
- package/typechain-types/contracts/mocks/token/ERC20DecimalsMock.ts +349 -0
- package/typechain-types/contracts/mocks/token/ERC20Mock.ts +368 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/EncryptedTokenReceiverMock.ts +108 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivacyBridgeERC20Mock.ts +1892 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivateERC20AuditorSupplyMock.ts +1296 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivateERC20CappedMock.ts +1270 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivateERC20GtCallerMock.ts +166 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivateERC20Mock.ts +827 -78
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivateERC20ReentrantReceiverMock.sol/IPrivateERC20TransferAndCallEncrypted.ts +102 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivateERC20ReentrantReceiverMock.sol/PrivateERC20ReentrantReceiverMock.ts +154 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/PrivateERC20ReentrantReceiverMock.sol/index.ts +5 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/PublicReentrantTokenReceiverMock.ts +155 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/PublicTokenReceiverBoolMock.ts +107 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/PublicTokenReceiverMock.ts +100 -0
- package/typechain-types/contracts/mocks/token/PrivateERC20/index.ts +10 -0
- package/typechain-types/contracts/mocks/token/index.ts +2 -0
- package/typechain-types/contracts/mocks/utils/mpc/{Arithmetic128BitTestsContract.ts → Arithmetic128TestsContract.ts} +96 -126
- package/typechain-types/contracts/mocks/utils/mpc/{Arithmetic256BitTestsContract.ts → Arithmetic256TestsContract.ts} +97 -133
- package/typechain-types/contracts/mocks/utils/mpc/{Bitwise128BitTestsContract.ts → Bitwise128TestsContract.ts} +52 -59
- package/typechain-types/contracts/mocks/utils/mpc/{Bitwise256BitTestsContract.ts → Bitwise256TestsContract.ts} +52 -59
- package/typechain-types/contracts/mocks/utils/mpc/CheckedArithmetic128WithOverflowBitTestsContract.ts +206 -0
- package/typechain-types/contracts/mocks/utils/mpc/CheckedArithmetic256WithOverflowBitTestsContract.ts +206 -0
- package/typechain-types/contracts/mocks/utils/mpc/{Comparison128BitTestsContract.ts → Comparison128TestsContract.ts} +115 -97
- package/typechain-types/contracts/mocks/utils/mpc/{Comparison256BitTestsContract.ts → Comparison256TestsContract.ts} +115 -97
- package/typechain-types/contracts/mocks/utils/mpc/MinMax128TestsContract.ts +142 -0
- package/typechain-types/contracts/mocks/utils/mpc/MinMax256TestsContract.ts +142 -0
- package/typechain-types/contracts/mocks/utils/mpc/MinimalImplementation.ts +259 -0
- package/typechain-types/contracts/mocks/utils/mpc/MinimalProxy.ts +90 -0
- package/typechain-types/contracts/mocks/utils/mpc/MpcOperations128TestContract.ts +388 -0
- package/typechain-types/contracts/mocks/utils/mpc/MpcOperationsTestContract.ts +455 -0
- package/typechain-types/contracts/mocks/utils/mpc/Mux128TestsContract.ts +109 -0
- package/typechain-types/contracts/mocks/utils/mpc/Mux256TestsContract.ts +109 -0
- package/typechain-types/contracts/mocks/utils/mpc/OnBoard128TestsContract.ts +166 -0
- package/typechain-types/contracts/mocks/utils/mpc/OnBoard256TestsContract.ts +194 -0
- package/typechain-types/contracts/mocks/utils/mpc/PrivacyImplementationV1.ts +385 -0
- package/typechain-types/contracts/mocks/utils/mpc/PrivacyImplementationV2.ts +441 -0
- package/typechain-types/contracts/mocks/utils/mpc/PrivacyProxy.ts +201 -0
- package/typechain-types/contracts/mocks/utils/mpc/Random128TestsContract.ts +131 -0
- package/typechain-types/contracts/mocks/utils/mpc/Random256TestsContract.ts +131 -0
- package/typechain-types/contracts/mocks/utils/mpc/Shift128TestsContract.ts +142 -0
- package/typechain-types/contracts/mocks/utils/mpc/Shift256TestsContract.ts +142 -0
- package/typechain-types/contracts/mocks/utils/mpc/Transfer128TestsContract.ts +109 -0
- package/typechain-types/contracts/mocks/utils/mpc/Transfer256TestsContract.ts +109 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance128TestsContract.ts +128 -0
- package/typechain-types/contracts/mocks/utils/mpc/TransferWithAllowance256TestsContract.ts +128 -0
- package/typechain-types/contracts/mocks/utils/mpc/ValidateCiphertext128TestsContract.ts +198 -0
- package/typechain-types/contracts/mocks/utils/mpc/ValidateCiphertext256TestsContract.ts +182 -0
- package/typechain-types/contracts/mocks/utils/mpc/ValidateCiphertextTestsContract.ts +257 -0
- package/typechain-types/contracts/mocks/utils/mpc/index.ts +32 -8
- package/typechain-types/contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock.ts +6 -6
- package/typechain-types/contracts/node/CotiNodeRewards.ts +566 -0
- package/typechain-types/contracts/node/SoulboundNodeNFT.sol/IERC5192.ts +123 -0
- package/typechain-types/contracts/node/SoulboundNodeNFT.sol/SoulboundNodeNFT.ts +975 -0
- package/typechain-types/contracts/node/SoulboundNodeNFT.sol/index.ts +5 -0
- package/typechain-types/contracts/node/index.ts +6 -0
- package/typechain-types/contracts/oracle/CotiPriceConsumer.ts +256 -0
- package/typechain-types/contracts/oracle/ICotiPriceConsumer.ts +119 -0
- package/typechain-types/contracts/oracle/IStdReference.ts +136 -0
- package/typechain-types/contracts/oracle/index.ts +6 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridge.ts +1628 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeCotiNative.ts +1870 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeERC20.sol/IHasDecimals.ts +84 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeERC20.sol/PrivacyBridgeERC20.ts +1892 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeERC20.sol/index.ts +5 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeUSDCe.ts +1892 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeUSDT.ts +1892 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeWADA.ts +1892 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeWBTC.ts +1892 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridgeWETH.ts +1892 -0
- package/typechain-types/contracts/privacyBridge/PrivacyBridgegCoti.ts +1892 -0
- package/typechain-types/contracts/privacyBridge/index.ts +13 -0
- package/typechain-types/contracts/token/PrivateERC20/IPrivateERC20.ts +507 -70
- package/typechain-types/contracts/token/PrivateERC20/ITokenReceiver.ts +100 -0
- package/typechain-types/contracts/token/PrivateERC20/ITokenReceiverEncrypted.ts +99 -0
- package/typechain-types/contracts/token/PrivateERC20/PrivateERC20.ts +833 -68
- package/typechain-types/contracts/token/PrivateERC20/index.ts +4 -0
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateBridgedUSDC.ts +1270 -0
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateCOTI.ts +1270 -0
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateCOTITreasuryGovernanceToken.ts +1270 -0
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateTetherUSD.ts +1270 -0
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateWrappedADA.ts +1270 -0
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateWrappedBTC.ts +1270 -0
- package/typechain-types/contracts/token/PrivateERC20/tokens/PrivateWrappedEther.ts +1270 -0
- package/typechain-types/contracts/token/PrivateERC20/tokens/index.ts +10 -0
- package/typechain-types/contracts/utils/mpc/MpcInterface.sol/ExtendedOperations.ts +111 -10
- package/typechain-types/factories/@openzeppelin/contracts/access/AccessControlEnumerable__factory.ts +276 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/AccessControl__factory.ts +229 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/IAccessControlEnumerable__factory.ts +244 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/IAccessControl__factory.ts +197 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/Ownable__factory.ts +74 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/index.ts +8 -0
- package/typechain-types/factories/@openzeppelin/contracts/index.ts +2 -0
- package/typechain-types/factories/@openzeppelin/contracts/security/Pausable__factory.ts +61 -0
- package/typechain-types/factories/@openzeppelin/contracts/security/index.ts +4 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory.ts +356 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.ts +205 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata__factory.ts +247 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit__factory.ts +100 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/extensions/index.ts +5 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC20/index.ts +6 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/ERC721__factory.ts +416 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata__factory.ts +355 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/index.ts +4 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/index.ts +2 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/index.ts +1 -0
- package/typechain-types/factories/contracts/disperse/coinByRatio/FixedRatioCoinDisperserLeftoverS1__factory.ts +791 -0
- package/typechain-types/factories/contracts/disperse/coinByRatio/FixedRatioCoinDisperserUnlimitedWindow__factory.ts +711 -0
- package/typechain-types/factories/contracts/disperse/coinByRatio/FixedRatioCoinDisperser__factory.ts +759 -0
- package/typechain-types/factories/contracts/disperse/coinByRatio/index.ts +6 -0
- package/typechain-types/factories/contracts/disperse/disperseToken/MintDisperser.sol/IMintableERC20__factory.ts +43 -0
- package/typechain-types/factories/contracts/disperse/disperseToken/MintDisperser.sol/IOwnable__factory.ts +35 -0
- package/typechain-types/factories/contracts/disperse/disperseToken/MintDisperser.sol/MintDisperser__factory.ts +203 -0
- package/typechain-types/factories/contracts/disperse/disperseToken/MintDisperser.sol/index.ts +6 -0
- package/typechain-types/factories/contracts/disperse/disperseToken/TokenDisperser__factory.ts +198 -0
- package/typechain-types/factories/contracts/disperse/disperseToken/index.ts +5 -0
- package/typechain-types/factories/contracts/disperse/index.ts +5 -0
- package/typechain-types/factories/contracts/index.ts +5 -0
- package/typechain-types/factories/contracts/messaging/PrivateMessaging__factory.ts +1035 -0
- package/typechain-types/factories/contracts/messaging/index.ts +4 -0
- package/typechain-types/factories/contracts/mocks/access/DataPrivacyFramework/DataPrivacyFrameworkMock__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/index.ts +2 -0
- package/typechain-types/factories/contracts/mocks/messaging/PrivateMessagingHarness__factory.ts +1161 -0
- package/typechain-types/factories/contracts/mocks/messaging/index.ts +4 -0
- package/typechain-types/factories/contracts/mocks/oracle/CotiPriceConsumerMock__factory.ts +159 -0
- package/typechain-types/factories/contracts/mocks/oracle/index.ts +4 -0
- package/typechain-types/factories/contracts/mocks/token/ERC20DecimalsMock__factory.ts +394 -0
- package/typechain-types/factories/contracts/mocks/token/ERC20Mock__factory.ts +392 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/EncryptedTokenReceiverMock__factory.ts +125 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivacyBridgeERC20Mock__factory.ts +1797 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20AuditorSupplyMock__factory.ts +1514 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20CappedMock__factory.ts +1466 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20GtCallerMock__factory.ts +165 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20Mock__factory.ts +975 -127
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20ReentrantReceiverMock.sol/IPrivateERC20TransferAndCallEncrypted__factory.ts +54 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20ReentrantReceiverMock.sol/PrivateERC20ReentrantReceiverMock__factory.ts +159 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PrivateERC20ReentrantReceiverMock.sol/index.ts +5 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PublicReentrantTokenReceiverMock__factory.ts +164 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PublicTokenReceiverBoolMock__factory.ts +130 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/PublicTokenReceiverMock__factory.ts +102 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC20/index.ts +9 -0
- package/typechain-types/factories/contracts/mocks/token/PrivateERC721/PrivateERC721URIStorageMock__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/token/index.ts +2 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Arithmetic128TestsContract__factory.ts +330 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Arithmetic256TestsContract__factory.ts +330 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/ArithmeticTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Bitwise128TestsContract__factory.ts +184 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Bitwise256TestsContract__factory.ts +184 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/BitwiseTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/CheckedArithmetic128WithOverflowBitTestsContract__factory.ts +203 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/CheckedArithmetic256WithOverflowBitTestsContract__factory.ts +203 -0
- 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 +295 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison1TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison256TestsContract__factory.ts +295 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison2TestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinMax128TestsContract__factory.ts +147 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinMax256TestsContract__factory.ts +147 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinMaxTestsContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinimalImplementation__factory.ts +263 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/MinimalProxy__factory.ts +104 -0
- 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 +723 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/MpcOperationsTestContract__factory.ts +1410 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Mux128TestsContract__factory.ts +115 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Mux256TestsContract__factory.ts +115 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/OffboardToUserKeyTestContract__factory.ts +1 -1
- package/typechain-types/factories/contracts/mocks/utils/mpc/OnBoard128TestsContract__factory.ts +175 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/OnBoard256TestsContract__factory.ts +205 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/PrivacyImplementationV1__factory.ts +521 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/PrivacyImplementationV2__factory.ts +648 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/PrivacyProxy__factory.ts +179 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Random128TestsContract__factory.ts +131 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Random256TestsContract__factory.ts +131 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Shift128TestsContract__factory.ts +147 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Shift256TestsContract__factory.ts +147 -0
- 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 +135 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/Transfer256TestsContract__factory.ts +135 -0
- 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 +154 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/TransferWithAllowance256TestsContract__factory.ts +154 -0
- 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 +190 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/ValidateCiphertext256TestsContract__factory.ts +210 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/ValidateCiphertextTestsContract__factory.ts +260 -0
- package/typechain-types/factories/contracts/mocks/utils/mpc/index.ts +32 -8
- package/typechain-types/factories/contracts/mocks/wallet/PrivateERC20Wallet/PrivateERC20WalletMock__factory.ts +10 -28
- package/typechain-types/factories/contracts/node/CotiNodeRewards__factory.ts +549 -0
- package/typechain-types/factories/contracts/node/SoulboundNodeNFT.sol/IERC5192__factory.ts +54 -0
- package/typechain-types/factories/contracts/node/SoulboundNodeNFT.sol/SoulboundNodeNFT__factory.ts +947 -0
- package/typechain-types/factories/contracts/node/SoulboundNodeNFT.sol/index.ts +5 -0
- package/typechain-types/factories/contracts/node/index.ts +5 -0
- package/typechain-types/factories/contracts/onboard/AccountOnboard__factory.ts +1 -1
- package/typechain-types/factories/contracts/oracle/CotiPriceConsumer__factory.ts +295 -0
- package/typechain-types/factories/contracts/oracle/ICotiPriceConsumer__factory.ts +73 -0
- package/typechain-types/factories/contracts/oracle/IStdReference__factory.ts +107 -0
- package/typechain-types/factories/contracts/oracle/index.ts +6 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeCotiNative__factory.ts +1676 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeERC20.sol/IHasDecimals__factory.ts +38 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeERC20.sol/PrivacyBridgeERC20__factory.ts +1678 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeERC20.sol/index.ts +5 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeUSDCe__factory.ts +1782 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeUSDT__factory.ts +1782 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeWADA__factory.ts +1782 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeWBTC__factory.ts +1782 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgeWETH__factory.ts +1782 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridge__factory.ts +1367 -0
- package/typechain-types/factories/contracts/privacyBridge/PrivacyBridgegCoti__factory.ts +1782 -0
- package/typechain-types/factories/contracts/privacyBridge/index.ts +12 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/IPrivateERC20__factory.ts +639 -61
- package/typechain-types/factories/contracts/token/PrivateERC20/ITokenReceiverEncrypted__factory.ts +53 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/ITokenReceiver__factory.ts +54 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/PrivateERC20__factory.ts +986 -120
- package/typechain-types/factories/contracts/token/PrivateERC20/index.ts +3 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateBridgedUSDC__factory.ts +1445 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateCOTITreasuryGovernanceToken__factory.ts +1451 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateCOTI__factory.ts +1442 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateTetherUSD__factory.ts +1445 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateWrappedADA__factory.ts +1445 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateWrappedBTC__factory.ts +1445 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/PrivateWrappedEther__factory.ts +1451 -0
- package/typechain-types/factories/contracts/token/PrivateERC20/tokens/index.ts +10 -0
- package/typechain-types/factories/contracts/utils/mpc/MpcCore__factory.ts +1 -1
- package/typechain-types/factories/contracts/utils/mpc/MpcInterface.sol/ExtendedOperations__factory.ts +126 -0
- package/typechain-types/hardhat.d.ts +1772 -278
- package/typechain-types/index.ts +182 -16
- package/contracts/mocks/utils/mpc/Arithmetic128BitTestsContract.sol +0 -260
- package/contracts/mocks/utils/mpc/Arithmetic256BitTestsContract.sol +0 -264
- package/contracts/mocks/utils/mpc/Bitwise128BitTestsContract.sol +0 -91
- package/contracts/mocks/utils/mpc/Bitwise256BitTestsContract.sol +0 -91
- package/contracts/mocks/utils/mpc/Comparison128BitTestsContract.sol +0 -158
- package/contracts/mocks/utils/mpc/Comparison256BitTestsContract.sol +0 -158
- package/contracts/mocks/utils/mpc/Miscellaneous128BitTestsContract.sol +0 -185
- package/contracts/mocks/utils/mpc/Miscellaneous256BitTestsContract.sol +0 -190
- package/contracts/mocks/utils/mpc/README.md +0 -486
- package/test/utils/mpc/Unsigned128BitIntegers.test.ts +0 -945
- package/test/utils/mpc/Unsigned256BitIntegers.test.ts +0 -1124
- package/test/utils/mpc/helpers.ts +0 -77
- package/typechain-types/contracts/mocks/utils/mpc/Miscellaneous128BitTestsContract.ts +0 -302
- package/typechain-types/contracts/mocks/utils/mpc/Miscellaneous256BitTestsContract.ts +0 -322
- package/typechain-types/factories/contracts/mocks/utils/mpc/Arithmetic128BitTestsContract__factory.ts +0 -349
- package/typechain-types/factories/contracts/mocks/utils/mpc/Arithmetic256BitTestsContract__factory.ts +0 -364
- package/typechain-types/factories/contracts/mocks/utils/mpc/Bitwise128BitTestsContract__factory.ts +0 -182
- package/typechain-types/factories/contracts/mocks/utils/mpc/Bitwise256BitTestsContract__factory.ts +0 -182
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison128BitTestsContract__factory.ts +0 -255
- package/typechain-types/factories/contracts/mocks/utils/mpc/Comparison256BitTestsContract__factory.ts +0 -255
- package/typechain-types/factories/contracts/mocks/utils/mpc/Miscellaneous128BitTestsContract__factory.ts +0 -332
- package/typechain-types/factories/contracts/mocks/utils/mpc/Miscellaneous256BitTestsContract__factory.ts +0 -380
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.19;
|
|
3
|
+
|
|
4
|
+
import "./PrivacyBridgeERC20.sol";
|
|
5
|
+
import "../token/PrivateERC20/tokens/PrivateTetherUSD.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title PrivacyBridgeUSDT
|
|
9
|
+
* @notice Bridge contract for converting between USDT and privacy-preserving p.USDT tokens
|
|
10
|
+
*/
|
|
11
|
+
contract PrivacyBridgeUSDT is PrivacyBridgeERC20 {
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
address _usdt,
|
|
16
|
+
address _privateUsdt,
|
|
17
|
+
address _feeRecipient,
|
|
18
|
+
address _rescueRecipient,
|
|
19
|
+
address _priceOracle
|
|
20
|
+
) PrivacyBridgeERC20(_usdt, _privateUsdt, "USDT", _feeRecipient, _rescueRecipient, _priceOracle) {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.19;
|
|
3
|
+
|
|
4
|
+
import "./PrivacyBridgeERC20.sol";
|
|
5
|
+
import "../token/PrivateERC20/tokens/PrivateWrappedADA.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title PrivacyBridgeWADA
|
|
9
|
+
* @notice Bridge contract for converting between WADA and privacy-preserving p.WADA tokens
|
|
10
|
+
*/
|
|
11
|
+
contract PrivacyBridgeWADA is PrivacyBridgeERC20 {
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
address _wada,
|
|
16
|
+
address _privateWada,
|
|
17
|
+
address _feeRecipient,
|
|
18
|
+
address _rescueRecipient,
|
|
19
|
+
address _priceOracle
|
|
20
|
+
) PrivacyBridgeERC20(_wada, _privateWada, "ADA", _feeRecipient, _rescueRecipient, _priceOracle) {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.19;
|
|
3
|
+
|
|
4
|
+
import "./PrivacyBridgeERC20.sol";
|
|
5
|
+
import "../token/PrivateERC20/tokens/PrivateWrappedBTC.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title PrivacyBridgeWBTC
|
|
9
|
+
* @notice Bridge contract for converting between WBTC and privacy-preserving p.WBTC tokens
|
|
10
|
+
*/
|
|
11
|
+
contract PrivacyBridgeWBTC is PrivacyBridgeERC20 {
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
address _wbtc,
|
|
16
|
+
address _privateWbtc,
|
|
17
|
+
address _feeRecipient,
|
|
18
|
+
address _rescueRecipient,
|
|
19
|
+
address _priceOracle
|
|
20
|
+
) PrivacyBridgeERC20(_wbtc, _privateWbtc, "WBTC", _feeRecipient, _rescueRecipient, _priceOracle) {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.19;
|
|
3
|
+
|
|
4
|
+
import "./PrivacyBridgeERC20.sol";
|
|
5
|
+
import "../token/PrivateERC20/tokens/PrivateWrappedEther.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title PrivacyBridgeWETH
|
|
9
|
+
* @notice Bridge contract for converting between WETH and privacy-preserving p.WETH tokens
|
|
10
|
+
*/
|
|
11
|
+
contract PrivacyBridgeWETH is PrivacyBridgeERC20 {
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
address _weth,
|
|
16
|
+
address _privateWeth,
|
|
17
|
+
address _feeRecipient,
|
|
18
|
+
address _rescueRecipient,
|
|
19
|
+
address _priceOracle
|
|
20
|
+
) PrivacyBridgeERC20(_weth, _privateWeth, "ETH", _feeRecipient, _rescueRecipient, _priceOracle) {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.19;
|
|
3
|
+
|
|
4
|
+
import "./PrivacyBridgeERC20.sol";
|
|
5
|
+
import "../token/PrivateERC20/tokens/PrivateCOTITreasuryGovernanceToken.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title PrivacyBridgegCoti
|
|
9
|
+
* @notice Bridge contract for converting between gCOTI and privacy-preserving p.gCOTI tokens
|
|
10
|
+
*/
|
|
11
|
+
contract PrivacyBridgegCoti is PrivacyBridgeERC20 {
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
address _gCoti,
|
|
16
|
+
address _privategCoti,
|
|
17
|
+
address _feeRecipient,
|
|
18
|
+
address _rescueRecipient,
|
|
19
|
+
address _priceOracle
|
|
20
|
+
) PrivacyBridgeERC20(_gCoti, _privategCoti, "GCOTI", _feeRecipient, _rescueRecipient, _priceOracle) {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -6,65 +6,158 @@ import "../../utils/mpc/MpcCore.sol";
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @dev Interface of the COTI Private ERC-20 standard.
|
|
9
|
+
*
|
|
10
|
+
* Trust assumptions (MPC — read before deploying or integrating):
|
|
11
|
+
* - Confidential balances, allowances, and transfer arithmetic are executed via `MpcCore` and the
|
|
12
|
+
* chain’s MPC precompile. This interface does not specify a verification layer: **token accounting
|
|
13
|
+
* ultimately follows whatever the precompile returns.** Solidity cannot re-prove MPC soundness on-chain.
|
|
14
|
+
* - Deploying or holding this token means accepting **trust in the network operator**, consensus,
|
|
15
|
+
* precompile implementation, versioning, and any upgrade path that may replace or alter MPC behavior.
|
|
16
|
+
* - Operational controls on the token (e.g. pausing, roles, supply caps) **contain** misuse or
|
|
17
|
+
* incident response; they do **not** substitute for MPC trust and cannot roll back or audit past
|
|
18
|
+
* precompile outputs cryptographically.
|
|
19
|
+
* - Client-side encryption (ciphertext formats, AES keys, wallet/SDK behavior) must stay consistent
|
|
20
|
+
* with the chain’s MPC expectations; malformed or adversarial off-chain inputs are not fully
|
|
21
|
+
* recoverable by the contract alone.
|
|
22
|
+
* - **Canonical empty ciphertext:** an all-zero `ctUint256` in storage (uninitialized or cleared)
|
|
23
|
+
* is read as numeric **zero** using the implementation’s `_safeOnboard` shortcut (`setPublic256(0)`
|
|
24
|
+
* without an extra `onBoard` round-trip). Any other bit pattern is onboarded via `MpcCore.onBoard`.
|
|
25
|
+
* Do not rely on writing raw ciphertext to token storage outside the implementation’s normal
|
|
26
|
+
* `offBoard` paths unless it matches MPC encoding rules.
|
|
27
|
+
*
|
|
28
|
+
* Failure semantics: implementations are expected to use a revert-on-failure model for
|
|
29
|
+
* balance/supply/allowance-changing operations. If the MPC layer reports failure for a core
|
|
30
|
+
* update, the call reverts unless otherwise noted. View/pure reads are not token "operations"
|
|
31
|
+
* in that sense. Encrypted boolean (`gtBool`) is not used as a return type on this interface;
|
|
32
|
+
* success is indicated by the transaction completing without revert.
|
|
33
|
+
*
|
|
34
|
+
* Supply and {totalSupply} (integration rule — read before integrating):
|
|
35
|
+
* - {totalSupply} in the reference implementation does **not** return circulating aggregate supply.
|
|
36
|
+
* It is not a substitute for standard ERC-20 `totalSupply` in vaults, oracles, or pro-rata logic.
|
|
37
|
+
* - For the **maximum mintable** amount (ceiling), use {supplyCap} and the enforcement described in
|
|
38
|
+
* the implementation’s `_update` / mint path — not {totalSupply}.
|
|
39
|
+
* - For **actual** aggregate supply, use off-chain indexing, a privileged operational dashboard,
|
|
40
|
+
* or a concrete extension that exposes encrypted supply to designated parties (see project mocks
|
|
41
|
+
* such as `PrivateERC20AuditorSupplyMock`).
|
|
9
42
|
*/
|
|
10
43
|
interface IPrivateERC20 {
|
|
11
44
|
struct Allowance {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
45
|
+
ctUint256 ciphertext;
|
|
46
|
+
ctUint256 ownerCiphertext;
|
|
47
|
+
ctUint256 spenderCiphertext;
|
|
15
48
|
}
|
|
16
|
-
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @dev Plain {approve} with a non-zero value was called while the current allowance is non-zero.
|
|
52
|
+
* Mitigates the ERC-20 approve race: first set allowance to zero, then set the new value.
|
|
53
|
+
*/
|
|
54
|
+
error ERC20UnsafeApprove();
|
|
55
|
+
|
|
17
56
|
/**
|
|
18
57
|
* @dev Emitted when `senderValue/receiverValue` tokens are moved from one account (`from`) to
|
|
19
58
|
* another (`to`).
|
|
20
59
|
*
|
|
21
60
|
* Note that `senderValue/receiverValue` may be zero.
|
|
22
61
|
*/
|
|
23
|
-
event Transfer(
|
|
62
|
+
event Transfer(
|
|
63
|
+
address indexed from,
|
|
64
|
+
address indexed to,
|
|
65
|
+
ctUint256 senderValue,
|
|
66
|
+
ctUint256 receiverValue
|
|
67
|
+
);
|
|
24
68
|
|
|
25
69
|
/**
|
|
26
70
|
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
|
|
27
71
|
* a call to {approve}. `ownerValue` and `spenderValue` are the new allowance encrypted with the respective users AES key.
|
|
28
72
|
*/
|
|
29
|
-
event Approval(
|
|
73
|
+
event Approval(
|
|
74
|
+
address indexed owner,
|
|
75
|
+
address indexed spender,
|
|
76
|
+
ctUint256 ownerValue,
|
|
77
|
+
ctUint256 spenderValue
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @dev Emitted when an allowance is re-encrypted for the owner or spender view (e.g. after key rotation).
|
|
82
|
+
* `isSpender` is true when the spender's ciphertext was updated; false when the owner's was updated.
|
|
83
|
+
*/
|
|
84
|
+
event AllowanceReencrypted(
|
|
85
|
+
address indexed owner,
|
|
86
|
+
address indexed spender,
|
|
87
|
+
bool isSpender
|
|
88
|
+
);
|
|
30
89
|
|
|
31
90
|
/**
|
|
32
|
-
* @dev
|
|
91
|
+
* @dev **Not** standard ERC-20 aggregate circulating supply in the base implementation.
|
|
92
|
+
*
|
|
93
|
+
* The reference implementation returns `0` on purpose: public aggregate supply is withheld for privacy.
|
|
94
|
+
* Do **not** use this value for collateral math, reward distribution, or any logic that assumes
|
|
95
|
+
* it reflects tokens in existence. For a mint **ceiling**, see {supplyCap}. For real supply metrics,
|
|
96
|
+
* integrate off-chain or via an extended contract that defines explicit semantics.
|
|
33
97
|
*/
|
|
34
98
|
function totalSupply() external view returns (uint256);
|
|
35
99
|
|
|
36
100
|
/**
|
|
37
101
|
* @dev Returns the value of tokens owned by `account` encrypted with their AES key.
|
|
38
102
|
*/
|
|
39
|
-
function balanceOf(
|
|
103
|
+
function balanceOf(
|
|
104
|
+
address account
|
|
105
|
+
) external view returns (ctUint256 memory);
|
|
40
106
|
|
|
41
107
|
/**
|
|
42
108
|
* @dev Returns the value of tokens owned by the caller.
|
|
43
109
|
*/
|
|
44
|
-
function balanceOf() external returns (
|
|
110
|
+
function balanceOf() external returns (gtUint256);
|
|
45
111
|
|
|
46
112
|
/**
|
|
47
113
|
* @dev Reencrypts the caller's balance using the AES key of `addr`.
|
|
48
114
|
*/
|
|
49
115
|
function setAccountEncryptionAddress(address addr) external returns (bool);
|
|
50
116
|
|
|
117
|
+
/**
|
|
118
|
+
* @dev Returns whether clear public `uint256` operations are currently enabled
|
|
119
|
+
* for this token (mint, burn, transfer, transferFrom, approve, transferAndCall
|
|
120
|
+
* variants that take plain amounts).
|
|
121
|
+
*/
|
|
122
|
+
function publicAmountsEnabled() external view returns (bool);
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @dev Enables or disables operations that use clear public `uint256` amounts
|
|
126
|
+
* (mint, burn, transfer, transferFrom, approve, transferAndCall with uint256).
|
|
127
|
+
* Intended for token admins that want to disallow public value usage and
|
|
128
|
+
* enforce encrypted-only flows.
|
|
129
|
+
*/
|
|
130
|
+
function setPublicAmountsEnabled(bool enabled) external;
|
|
131
|
+
|
|
51
132
|
/**
|
|
52
133
|
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
|
|
53
134
|
*
|
|
54
|
-
*
|
|
135
|
+
* Reverts if the transfer does not succeed.
|
|
55
136
|
*
|
|
56
137
|
* Emits a {Transfer} event.
|
|
57
138
|
*/
|
|
58
|
-
function transfer(
|
|
139
|
+
function transfer(
|
|
140
|
+
address to,
|
|
141
|
+
itUint256 calldata value
|
|
142
|
+
) external;
|
|
59
143
|
|
|
60
144
|
/**
|
|
61
|
-
* @dev Moves a `
|
|
145
|
+
* @dev Moves a public `amount` of tokens from the caller's account to `to`.
|
|
62
146
|
*
|
|
63
|
-
*
|
|
147
|
+
* Reverts if the transfer does not succeed.
|
|
64
148
|
*
|
|
65
149
|
* Emits a {Transfer} event.
|
|
66
150
|
*/
|
|
67
|
-
function transfer(address to,
|
|
151
|
+
function transfer(address to, uint256 amount) external;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @dev Moves a garbled-text `value` amount of tokens from the caller's account to `to`.
|
|
155
|
+
*
|
|
156
|
+
* Reverts if the transfer does not succeed.
|
|
157
|
+
*
|
|
158
|
+
* Emits a {Transfer} event.
|
|
159
|
+
*/
|
|
160
|
+
function transferGT(address to, gtUint256 value) external;
|
|
68
161
|
|
|
69
162
|
/**
|
|
70
163
|
* @dev Returns the remaining number of tokens that `spender` will be
|
|
@@ -73,7 +166,10 @@ interface IPrivateERC20 {
|
|
|
73
166
|
*
|
|
74
167
|
* This value changes when {approve} or {transferFrom} are called.
|
|
75
168
|
*/
|
|
76
|
-
function allowance(
|
|
169
|
+
function allowance(
|
|
170
|
+
address owner,
|
|
171
|
+
address spender
|
|
172
|
+
) external view returns (Allowance memory);
|
|
77
173
|
|
|
78
174
|
/**
|
|
79
175
|
* @dev Returns the remaining number of tokens that `account` will be
|
|
@@ -82,61 +178,198 @@ interface IPrivateERC20 {
|
|
|
82
178
|
*
|
|
83
179
|
* This value changes when {approve} or {transferFrom} are called.
|
|
84
180
|
*/
|
|
85
|
-
function allowance(address account, bool isSpender) external returns (
|
|
181
|
+
function allowance(address account, bool isSpender) external returns (gtUint256);
|
|
86
182
|
|
|
87
183
|
/**
|
|
88
184
|
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
|
|
89
185
|
* caller's tokens.
|
|
90
186
|
*
|
|
91
|
-
*
|
|
187
|
+
* Reverts if approval cannot be completed.
|
|
92
188
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* condition is to first reduce the spender's allowance to 0 and set the
|
|
97
|
-
* desired value afterwards:
|
|
98
|
-
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
|
|
189
|
+
* Reverts with {ERC20UnsafeApprove} if both the current allowance and the new `value` are
|
|
190
|
+
* non-zero (mitigation for the ERC-20 approve race). To change a non-zero allowance, first
|
|
191
|
+
* approve zero, then set the new amount, **or** use {increaseAllowance}/{decreaseAllowance}.
|
|
99
192
|
*
|
|
100
193
|
* Emits an {Approval} event.
|
|
101
194
|
*/
|
|
102
|
-
function approve(
|
|
195
|
+
function approve(
|
|
196
|
+
address spender,
|
|
197
|
+
itUint256 calldata value
|
|
198
|
+
) external;
|
|
103
199
|
|
|
104
200
|
/**
|
|
105
|
-
* @dev Sets a `
|
|
201
|
+
* @dev Sets a public `amount` as the allowance of `spender` over the
|
|
106
202
|
* caller's tokens.
|
|
107
203
|
*
|
|
108
|
-
*
|
|
204
|
+
* Reverts with {ERC20UnsafeApprove} if both the current allowance and `amount` are non-zero
|
|
205
|
+
* (mitigation for the ERC-20 approve race). To change a non-zero allowance, first approve zero,
|
|
206
|
+
* then set the new amount, **or** use {increaseAllowance}/{decreaseAllowance}.
|
|
109
207
|
*
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
*
|
|
208
|
+
* Emits an {Approval} event.
|
|
209
|
+
*/
|
|
210
|
+
function approve(address spender, uint256 amount) external;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @dev Sets a garbled-text `value` as the allowance of `spender` over the
|
|
214
|
+
* caller's tokens.
|
|
215
|
+
*
|
|
216
|
+
* Reverts if approval cannot be completed.
|
|
217
|
+
*
|
|
218
|
+
* Reverts with {ERC20UnsafeApprove} if both the current allowance and the new `value` are
|
|
219
|
+
* non-zero (mitigation for the ERC-20 approve race). To change a non-zero allowance, first
|
|
220
|
+
* approve zero, then set the new amount, **or** use {increaseAllowance}/{decreaseAllowance}.
|
|
221
|
+
*
|
|
222
|
+
* Emits an {Approval} event.
|
|
223
|
+
*/
|
|
224
|
+
function approveGT(address spender, gtUint256 value) external;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @dev Increases the allowance granted to `spender` by the caller by `addedValue`.
|
|
228
|
+
* Use this (or {decreaseAllowance}) to change a non-zero allowance without the unsafe
|
|
229
|
+
* “approve non-zero over non-zero” pattern. Reverts on uint256 overflow (including when the
|
|
230
|
+
* current allowance is already unlimited).
|
|
231
|
+
*
|
|
232
|
+
* Emits an {Approval} event.
|
|
233
|
+
*/
|
|
234
|
+
function increaseAllowance(
|
|
235
|
+
address spender,
|
|
236
|
+
itUint256 calldata addedValue
|
|
237
|
+
) external;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* @dev Same as {increaseAllowance(address,(itUint256))} with a public `addedValue`.
|
|
241
|
+
* Requires {publicAmountsEnabled}.
|
|
242
|
+
*/
|
|
243
|
+
function increaseAllowance(address spender, uint256 addedValue) external;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* @dev Same as {increaseAllowance(address,(itUint256))} with a garbled `addedValue`.
|
|
247
|
+
*/
|
|
248
|
+
function increaseAllowanceGT(address spender, gtUint256 addedValue) external;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @dev Decreases the allowance granted to `spender` by the caller by `subtractedValue`.
|
|
252
|
+
* Reverts if the current allowance is less than `subtractedValue`.
|
|
116
253
|
*
|
|
117
254
|
* Emits an {Approval} event.
|
|
118
255
|
*/
|
|
119
|
-
function
|
|
256
|
+
function decreaseAllowance(
|
|
257
|
+
address spender,
|
|
258
|
+
itUint256 calldata subtractedValue
|
|
259
|
+
) external;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @dev Same as {decreaseAllowance(address,(itUint256))} with a public `subtractedValue`.
|
|
263
|
+
* Requires {publicAmountsEnabled}.
|
|
264
|
+
*/
|
|
265
|
+
function decreaseAllowance(address spender, uint256 subtractedValue) external;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @dev Same as {decreaseAllowance(address,(itUint256))} with a garbled `subtractedValue`.
|
|
269
|
+
*/
|
|
270
|
+
function decreaseAllowanceGT(address spender, gtUint256 subtractedValue) external;
|
|
120
271
|
|
|
121
272
|
/**
|
|
122
273
|
* @dev Moves a `value` amount of tokens from `from` to `to` using the
|
|
123
274
|
* allowance mechanism. `value` is then deducted from the caller's
|
|
124
275
|
* allowance.
|
|
125
276
|
*
|
|
126
|
-
*
|
|
277
|
+
* Reverts if the transfer fails.
|
|
127
278
|
*
|
|
128
279
|
* Emits a {Transfer} event.
|
|
129
280
|
*/
|
|
130
|
-
function transferFrom(
|
|
281
|
+
function transferFrom(
|
|
282
|
+
address from,
|
|
283
|
+
address to,
|
|
284
|
+
itUint256 calldata value
|
|
285
|
+
) external;
|
|
131
286
|
|
|
132
287
|
/**
|
|
133
|
-
* @dev Moves a `
|
|
134
|
-
* allowance mechanism. `
|
|
288
|
+
* @dev Moves a public `amount` of tokens from `from` to `to` using the
|
|
289
|
+
* allowance mechanism. `amount` is then deducted from the caller's
|
|
135
290
|
* allowance.
|
|
136
291
|
*
|
|
137
|
-
*
|
|
292
|
+
* Reverts if the transfer fails.
|
|
293
|
+
*
|
|
294
|
+
* Emits a {Transfer} event.
|
|
295
|
+
*/
|
|
296
|
+
function transferFrom(address from, address to, uint256 amount) external;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* @dev Moves a garbled-text `value` amount of tokens from `from` to `to` using the
|
|
300
|
+
* allowance mechanism. `value` is then deducted from the caller's allowance.
|
|
301
|
+
*
|
|
302
|
+
* Reverts if the transfer fails.
|
|
138
303
|
*
|
|
139
304
|
* Emits a {Transfer} event.
|
|
140
305
|
*/
|
|
141
|
-
function
|
|
142
|
-
|
|
306
|
+
function transferFromGT(address from, address to, gtUint256 value) external;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* @dev Moves a `value` amount of tokens from the caller's account to `to`, and then calls `onTokenReceived` on `to`.
|
|
310
|
+
* @param to The address of the recipient
|
|
311
|
+
* @param amount The amount of tokens to be transferred
|
|
312
|
+
* @param data Additional data with no specified format, sent in call to `to`
|
|
313
|
+
*/
|
|
314
|
+
function transferAndCall(
|
|
315
|
+
address to,
|
|
316
|
+
uint256 amount,
|
|
317
|
+
bytes calldata data
|
|
318
|
+
) external;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* @dev Moves an input-text (encrypted) `amount` of tokens from the caller's account to `to`,
|
|
322
|
+
* then calls `ITokenReceiverEncrypted.onPrivateTransferReceived(sender, data)` on `to`.
|
|
323
|
+
* The callback has **no** plaintext amount parameter — receivers must implement {ITokenReceiverEncrypted}.
|
|
324
|
+
* @param to The address of the recipient (must implement {ITokenReceiverEncrypted})
|
|
325
|
+
* @param amount Encrypted input-text amount to be transferred
|
|
326
|
+
* @param data Forwarded to the callback; use for app-specific context (not a substitute for amount)
|
|
327
|
+
*/
|
|
328
|
+
function transferAndCall(
|
|
329
|
+
address to,
|
|
330
|
+
itUint256 calldata amount,
|
|
331
|
+
bytes calldata data
|
|
332
|
+
) external;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* @dev Creates `amount` public tokens and assigns them to `to`, increasing the total supply.
|
|
336
|
+
*
|
|
337
|
+
* Reverts if minting does not succeed.
|
|
338
|
+
*/
|
|
339
|
+
function mint(address to, uint256 amount) external;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* @dev Creates `amount` input-text (encrypted) tokens and assigns them to `to`, increasing the total supply.
|
|
343
|
+
*
|
|
344
|
+
* Reverts if minting does not succeed.
|
|
345
|
+
*/
|
|
346
|
+
function mint(address to, itUint256 calldata amount) external;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* @dev Creates `amount` garbled-text tokens and assigns them to `to` without re-wrapping.
|
|
350
|
+
*
|
|
351
|
+
* Reverts if minting does not succeed.
|
|
352
|
+
*/
|
|
353
|
+
function mintGt(address to, gtUint256 amount) external;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* @dev Destroys `amount` public tokens from the caller.
|
|
357
|
+
*
|
|
358
|
+
* Reverts if burning does not succeed.
|
|
359
|
+
*/
|
|
360
|
+
function burn(uint256 amount) external;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @dev Destroys `amount` input-text (encrypted) tokens from the caller.
|
|
364
|
+
*
|
|
365
|
+
* Reverts if the burn fails.
|
|
366
|
+
*/
|
|
367
|
+
function burn(itUint256 calldata amount) external;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* @dev Destroys `amount` garbled-text tokens from the caller without re-wrapping.
|
|
371
|
+
*
|
|
372
|
+
* Reverts if burning does not succeed.
|
|
373
|
+
*/
|
|
374
|
+
function burnGt(gtUint256 amount) external;
|
|
375
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.19;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @dev Interface for receiving Private ERC-20 tokens via `transferAndCall` with a **public** `uint256` amount.
|
|
7
|
+
*
|
|
8
|
+
* For `transferAndCall` with an **encrypted** `itUint256` amount, use {ITokenReceiverEncrypted} instead —
|
|
9
|
+
* the amount must not be passed in plaintext in the callback.
|
|
10
|
+
*/
|
|
11
|
+
interface ITokenReceiver {
|
|
12
|
+
function onTokenReceived(
|
|
13
|
+
address from,
|
|
14
|
+
uint256 amount,
|
|
15
|
+
bytes calldata data
|
|
16
|
+
) external returns (bool);
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.19;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @dev Callback for the **encrypted-amount** `transferAndCall(to, itUint256, data)` overload on {PrivateERC20}.
|
|
7
|
+
*
|
|
8
|
+
* The transferred amount is intentionally **not** passed in plaintext to the callback. Receivers that
|
|
9
|
+
* handle private transfers must implement this interface. Do **not** use {ITokenReceiver} for that
|
|
10
|
+
* overload — its `amount` parameter cannot carry the real value without breaking privacy.
|
|
11
|
+
*
|
|
12
|
+
* Integrators: derive any needed amount context from `data` you control, or from off-chain decryption
|
|
13
|
+
* of {Transfer} events / balances — not from a callback `amount` field.
|
|
14
|
+
*/
|
|
15
|
+
interface ITokenReceiverEncrypted {
|
|
16
|
+
function onPrivateTransferReceived(
|
|
17
|
+
address from,
|
|
18
|
+
bytes calldata data
|
|
19
|
+
) external returns (bool);
|
|
20
|
+
}
|