Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
QiteBlock committed Sep 7, 2024
1 parent a882d61 commit 8c8a5ce
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 306 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export OPTIMISM_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
export POLYGONSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
export SNOWTRACE_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"

export TOKEN_TREX_A=0xb372A4E8dda7Be2a9c9aC974b04D67ab4b31f53f
export TOKEN_TREX_B=0xc906e3984740eF4074b681E58CC3cC4c8c711aca
export DVD_MANAGER=0xc37Cc18c3722AB44d4D261614Bc7E524c2C37901
export TOKEN_TREX_A=0xF229Ac63a3283eF8F740cdEb6aAe573ceA7c6Bd4
export TOKEN_TREX_B=0xbde3D6095e85c822CAA2144C13497Da24b8BB076
export DVD_MANAGER=0xA3Ac498301992Dd6830974E7B6CdbCc170BeE15b
138 changes: 71 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,89 +230,93 @@ pnpm script:executeDVD

#### T-Rex token A

- ClaimTopicsRegistry: 0x21D7A817AC349Bacb8d11A7a8816F0234c04be4a
- TrustedIssuersRegistry: 0x364Af1aD133c171EC952C632B3Adcdaed4d7A0B4
- IdentityRegistryStorage: 0x3C69096593A90A7e57b5453279fD0200C7713743
- IdentityRegistry: 0xc3310b1155f0d70462e3fb8B5f160D67bfE55836
- ModularCompliance: 0x7A502507e5f73C8363149b192B0DBE47426c2BD1
- Token Implementation: 0x7cF8Be79E60DD4cDDaC283615C0d0c03A497923e
- identityImplementationAuthority: 0x434650FAC599C689dbE9067Eb3b78C2cd2516765
- TREXImplementationAuthority: 0xb687B524c617eE34A17c991d3746D5bca9e53953
- TREXFactory: 0x18CF6e20dB450187ebBa683fC1E12447e94A20D4
- ClaimTopicsRegistryProxy: 0xB65312b87FA7c2741675C957952d40dE18800c4a
- TrustedIssuersRegistryProxy: 0xaC66Aab27633820b2CE34EA6F42e3EAE58Abb4c9
- IdentityRegistryStorageProxy: 0x1dD7778b0A870D6eB7d6dBB469A49de7cE0160FE
- IdentityRegistry: 0x17b6d63C331A442055d21a5c2D943b1C5a2fD58c
- Token: 0xD3d16aB1f6942d75947C47D253D678Af3d1fddA5
- ClaimIssuer: 0x51d1cB10f84FBB1e667e3FDA00D4C304cE159C72
- Token Address : 0xD3d16aB1f6942d75947C47D253D678Af3d1fddA5
- ClaimTopicsRegistry: 0x7C547CCBf006E1006b91613723A1C9601b7cDC24
- TrustedIssuersRegistry: 0x83CDB3f4A621f37e1e88F05EB469E69B5dc011c4
- IdentityRegistryStorage: 0x92e6950B5c4d57e97DD74dC9427C1D2eb8dA529a
- IdentityRegistry: 0x2f3595f5E7fB2b4c598e31f617A293c3BD9f9651
- ModularCompliance: 0x2FbDF3a294012c2CD10eDd60C2fcF110D999c431
- Token: 0x0e1cE0b2782127a1a156Ece0a1a448fBA7344EAd
- identityImplementationAuthority: 0xd60Ea44B5e1438458Ec2768fD14735A995c1c7cc
- TREXImplementationAuthority: 0x444aC71c8f624Cc0ace5922097FeDF5e5d70f026
- TREXFactory: 0xC6c9DE17858159039955Dc9803851106e25e0fd8
- ClaimTopicsRegistryProxy: 0x6EDaE25094B5d2B350F75418623C6567C00a3513
- TrustedIssuersRegistryProxy: 0x0D437D0e3bfb8801D7c61e399C89A355f02c82C0
- IdentityRegistryStorageProxy: 0xb82aC5e885FC20E6e61CdffBa609AeA3A6681027
- IdentityRegistry: 0x6086368F3c5ec0AeF255a589A784021EFDfc4266
- Token: 0xF229Ac63a3283eF8F740cdEb6aAe573ceA7c6Bd4
- ClaimIssuer: 0x4D3fD28893CA137547C7303f0992BB835079Cc24
- Token Address : 0xF229Ac63a3283eF8F740cdEb6aAe573ceA7c6Bd4

#### T-Rex token B

- ClaimTopicsRegistry: 0xbB48b28BF9239BD184014F97819FFb09F7619530
- TrustedIssuersRegistry: 0x240eD9a3ed747C5EE3aaA64F1032AaB7568fdf59
- IdentityRegistryStorage: 0xF286117581F6Ea4C52591bAc32902867058870aA
- IdentityRegistry: 0x18b9AB40291366456c0627b7962049134459473D
- ModularCompliance: 0x7981ac1FeD650aa1fD299F84669704B37EadBBA5
- Token Implementation: 0x4beb05CD187f412C0C613D2fA6ba83aF9eE18020
- identityImplementationAuthority: 0x284CB8888406fFca114852dA572086eA2572ab7E
- TREXImplementationAuthority: 0xE228a684CF85e67e960fF4D53CA0dc88846528f2
- TREXFactory: 0x0a138D685C8cffEF49D88b6d8b00E389D6e0Fd8C
- ClaimTopicsRegistryProxy: 0x2e7e0D3728741D4326c7179fBF75718ADbea7197
- TrustedIssuersRegistryProxy: 0x61b45f5ab492236e24F28C96c30c41002205bdde
- IdentityRegistryStorageProxy: 0x8070F4A000715C051EB9193bc7d09C4a3fdcFeC5
- IdentityRegistry: 0x88501334eA247a71c780130E727D395746eDB177
- Token: 0xdE6B91aA4433fDa9eD1608d181A5FbbcAdc3bA0A
- ClaimIssuer: 0x18FE743DE619d1D2a981E797DC800FEf373E2350
- Token Address : 0xdE6B91aA4433fDa9eD1608d181A5FbbcAdc3bA0A
- ClaimTopicsRegistry: 0xB142D73E2d27d4ADAc6a8Ba6318c922Bb2A2751e
- TrustedIssuersRegistry: 0x0FB2c0253b702C07CB12eD3e84Ae57C4Ad3ee389
- IdentityRegistryStorage: 0x73EB565AbF39B46722Bbc55c74fB1935e458a315
- IdentityRegistry: 0x59Fc7585fB74afB869FeB1f05a17380D65632C5E
- ModularCompliance: 0x84398F663560bC04f898E765D58b17997D6697c0
- Token: 0x6893e54298d30e432EA055e35fF0461FEeFc16D7
- identityImplementationAuthority: 0x146Ed57f7Bc4900766bEDF9988e12C07CC6969F2
- TREXImplementationAuthority: 0xa600222B99beCe6055ab42bfe3d7002C760d7dCb
- TREXFactory: 0x342CDC4cDa84945a9B7067a36de00f034DDF9b5F
- ClaimTopicsRegistryProxy: 0x840434F30c0169b993342C69B8A7C9cafb7df815
- TrustedIssuersRegistryProxy: 0x10f79e2De7C68D003C6e13123fec30c21dE7CcEe
- IdentityRegistryStorageProxy: 0x5A6c34958d7a1850f74cA68F34e55C56F2d24d54
- IdentityRegistry: 0xd50b4cE73A39B433651788942bB8817bCb5bdFA9
- Token: 0xbde3D6095e85c822CAA2144C13497Da24b8BB076
- ClaimIssuer: 0xB678Df3AB09331C84748fe7C2FB2f704F04e6404
- Token Address : 0xbde3D6095e85c822CAA2144C13497Da24b8BB076

#### DVD Contract

- Transfer Manager Address : 0x04e6b3F413B3EB518dEa2547F80b0C717bDF278d
- Transfer Manager Address : 0xA3Ac498301992Dd6830974E7B6CdbCc170BeE15b

### 2. Deployment with Zama account
#### Result in Devnet

![Tests](./screenshots/dvd_result_using_zama_account.png)

### 2. Deployment with my account (Get some Zama token)

#### T-Rex token A

- ClaimTopicsRegistry: 0xB59D305341bD3e81023A3719E9245E538d394df1
- TrustedIssuersRegistry: 0xcbCE6559841b75f51862B205a896560aD3904D0e
- IdentityRegistryStorage: 0xfccE1C043c38FEa9F3D5a7680Ef4C150a2CDcA0b
- IdentityRegistry: 0xC16b7D2f0b77CA15179eC280919494116d00A307
- ModularCompliance: 0x4b761135323425599dAeCB6da9Ae0aC4A4020B22
- Token Implementation: 0x772e184790cff7B049eCc93e5D385C0F2DEf7A50
- identityImplementationAuthority: 0x8B4E62632cC0029aD36a63e84ea3d12A624111e9
- TREXImplementationAuthority: 0xf5F56C964133B33377F1F219b42Bd16c4244Ae37
- TREXFactory: 0xC0B5077619d3A2Fb460f41ef7531881481B16480
- ClaimTopicsRegistryProxy: 0x911e8e1ab0493DC560A140103D1602F97DD3FF69
- TrustedIssuersRegistryProxy: 0xEB201909eD7891849475ca5B85004C63AD3D5F35
- IdentityRegistryStorageProxy: 0xf5461FCBFF669Bda6d76f194FA9D53172ac77681
- IdentityRegistry: 0xBD1Cdcd7e5BB7762e981141370110F5EE6eBcdc6
- Token: 0x630bA2F2C2eCed7576F64c439079Af2A0253d695
- ClaimIssuer: 0x0475aE2D213D051A29E7fF2072CdF8d7347fE590
- Token Address : 0x630bA2F2C2eCed7576F64c439079Af2A0253d695
- ClaimTopicsRegistry: 0x3a92280BE1AaD4f41F695D4d473b5Ef984239C67
- TrustedIssuersRegistry: 0xb3bad50A6bBcda892c7C8Db80493EBd518D69084
- IdentityRegistryStorage: 0xed376b1280EEDB6E0F42725Be8f47D9B8305c808
- IdentityRegistry: 0x8e5547bD15024eB11e1c6F0d2FF674589aEa0bF5
- ModularCompliance: 0x002047D5A69D9e6d4553dF9d698895F17e7E6526
- Token: 0xCe367a9355dCf347582b110DCb544BdEdcf71E51
- identityImplementationAuthority: 0x1c9cA5a3e38a66C772cc7f1068dB596C13EC013c
- TREXImplementationAuthority: 0xBe4346F858E41826218bC0dCdA0145e9606c7344
- TREXFactory: 0x98CFFd819F5ee4903eA3A3f165b8E9fF680dfd8E
- ClaimTopicsRegistryProxy: 0x172bC8CA8521Ec05863165E34CE96D4eE272836e
- TrustedIssuersRegistryProxy: 0x3B2a425e4C65622D15f7579C9A802109AD70E112
- IdentityRegistryStorageProxy: 0x6e7F8a81FceE513903F35b44736B787714c82DcD
- IdentityRegistry: 0x41618CC59932871df486Ed2D0869C1E1C96e67E1
- Token: 0x26bD50BA2E69Cd1716D1ABAa66A52Ec14122f649
- ClaimIssuer: 0xb24C4F10a6bD4e9a115342988bd4EB4e10587121
- Token Address : 0x26bD50BA2E69Cd1716D1ABAa66A52Ec14122f649

#### T-Rex token B

- ClaimTopicsRegistry: 0xB8C93d533CC05e55133bB8a9989997A3b3B93C4A
- TrustedIssuersRegistry: 0x497b3033ECB4b1B8C1FE4DD2F01448c8f9EC8965
- IdentityRegistryStorage: 0xB3b6cAc9C20238eE6c67668d105515905bfbA95C
- IdentityRegistry: 0xA370D679B69991a9FBea79A58D2f43e1A72D7fb0
- ModularCompliance: 0x2617535a8a280606D71728210Eb8e59863f52b0e
- Token Implementation: 0x8270330e1d6C815c9e943122d99602a5eDA49b07
- identityImplementationAuthority: 0xF2285dC42F21334926145442ebe529B9D5c47e3A
- TREXImplementationAuthority: 0x4a82ed9645DbBf7370ad5A0F4378B1191A4990e4
- TREXFactory: 0x7f8e3AD49F85bE46791d90A125cF50D5F0C1e931
- ClaimTopicsRegistryProxy: 0x7BdAE9D6609a045AB38Bf49aB27edFAD95D8953D
- TrustedIssuersRegistryProxy: 0xBa99395Cd5D5Dfaa00331f15cf59Ac742be0A0A7
- IdentityRegistryStorageProxy: 0xc70d6cFb4B50F44295fD83Ec1d271529924bD7CB
- IdentityRegistry: 0xDef6a0d58bEF6591476A55B26740b4c1Ab8E69f0
- Token: 0xF4Fb71Cf075a207bADa7462a03F8e8BfE3aa871d
- ClaimIssuer: 0x0C027CA42AF7D21FFC231DD4c2Fb8228402dBF49
- Token Address : 0xF4Fb71Cf075a207bADa7462a03F8e8BfE3aa871d
- ClaimTopicsRegistry: 0x1f906731f0B5372f85f102c58FEDD4280d0D5391
- TrustedIssuersRegistry: 0x1105F9d87758B5c26Eb5F8fFf03f49e4813F31cc
- IdentityRegistryStorage: 0x8c439643E984A93bc4f48645EcD65Cb67d540ec7
- IdentityRegistry: 0xF3AF800399E59f1D1e7eE6269FAE674DCA720c40
- ModularCompliance: 0xA392d63ed3a3FB78A016592fbf0A696557073C7E
- Token: 0xF17A779C607793FD2864C7f9c4d98e1eBb79125d
- identityImplementationAuthority: 0x51e90903b55d3D92B168615F99e336CB388C63EB
- TREXImplementationAuthority: 0x48444ee50cA8f08529E308a0D6A444762c36381e
- TREXFactory: 0xBfCFf52689754e486230B90d1CB909eB76B22F83
- ClaimTopicsRegistryProxy: 0x3940aBf98686044DAA85D77e252e6E8260CDC91D
- TrustedIssuersRegistryProxy: 0x327C8cFb1548F76390882034E296A3Eeef673e53
- IdentityRegistryStorageProxy: 0xEFd3750b8a91A283a63352B70a258CaEA7743154
- IdentityRegistry: 0x1e344EFA7cFCfbbC4f5C1aD50290F2CD49740FF2
- Token: 0xa839d945bAB88b36b6DC885631AAA5ae8942471F
- ClaimIssuer: 0xef40bFf54ADf9618F2EAF313D1E311cc871078a3
- Token Address : 0xa839d945bAB88b36b6DC885631AAA5ae8942471F

#### DVD Contract

- Transfer Manager Address : 0x3Bfd30061ba098da2077f3583b3a6bBDf9d89f1f
- Transfer Manager Address : 0x885eF30fa1dE57f80cA1084CBA9fCf75f7925Ecf

#### Result in Devnet

Expand Down
18 changes: 8 additions & 10 deletions contracts/DVD/DVDTransferManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,27 @@ contract DVDTransferManager is Ownable {
* @param _token1 the address of the token (ERC20 or TREX) provided by `msg.sender`
* @param _encryptedAmountToken1 the amount of `_token1` encrypted that `msg.sender` will send to
* `_counterpart` at DVD execution time
* @param _inputProofToken1 the proof that the msg.sender have access to the cypher
* @param _encryptedAmountToken2 the amount of `_token2` encrypted that `_counterpart` will send to
* `msg.sender` at DVD execution time
* @param _inputProof the proof that the msg.sender have access to the cypher
* @param _counterpart the address of the counterpart, which will receive `_token1Amount` of
* `_token1` in exchange for `_token2Amount` of `_token2`
* @param _token2 the address of the token (ERC20 or TREX) provided by `_counterpart`
* @param _encryptedAmountToken2 the amount of `_token2` encrypted that `_counterpart` will send to
* `msg.sender` at DVD execution time
* @param _inputProofToken2 the proof that the msg.sender have access to the cypher
*/
function initiateDVDTransfer(
address _token1,
einput _encryptedAmountToken1,
bytes calldata _inputProofToken1,
address _counterpart,
address _token2,
einput _encryptedAmountToken2,
bytes calldata _inputProofToken2
bytes calldata _inputProof,
address _counterpart,
address _token2
) external {
initiateDVDTransfer(
_token1,
TFHE.asEuint64(_encryptedAmountToken1, _inputProofToken1),
TFHE.asEuint64(_encryptedAmountToken1, _inputProof),
_counterpart,
_token2,
TFHE.asEuint64(_encryptedAmountToken2, _inputProofToken2)
TFHE.asEuint64(_encryptedAmountToken2, _inputProof)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ contract ConditionalTransferModule is AbstractModuleUpgradeable {
address[] calldata _from,
address[] calldata _to,
einput[] calldata _encryptedAmount,
bytes[] calldata _inputProof
bytes calldata _inputProof
) external onlyComplianceCall {
for (uint256 i = 0; i < _from.length; i++) {
approveTransfer(_from[i], _to[i], _encryptedAmount[i], _inputProof[i]);
approveTransfer(_from[i], _to[i], _encryptedAmount[i], _inputProof);
}
}

Expand Down Expand Up @@ -141,10 +141,10 @@ contract ConditionalTransferModule is AbstractModuleUpgradeable {
address[] calldata _from,
address[] calldata _to,
einput[] calldata _encryptedAmount,
bytes[] calldata _inputProof
bytes calldata _inputProof
) external onlyComplianceCall {
for (uint256 i = 0; i < _from.length; i++) {
unApproveTransfer(_from[i], _to[i], _encryptedAmount[i], _inputProof[i]);
unApproveTransfer(_from[i], _to[i], _encryptedAmount[i], _inputProof);
}
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/compliance/modular/modules/MaxBalanceModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ contract MaxBalanceModule is AbstractModuleUpgradeable {
address _compliance,
address[] calldata _id,
einput[] calldata _encryptedAmount,
bytes[] calldata _inputProof
bytes calldata _inputProof
) public {
if (_id.length == 0 || _id.length != _encryptedAmount.length) {
revert InvalidPresetValues(_compliance, _id);
Expand All @@ -186,7 +186,7 @@ contract MaxBalanceModule is AbstractModuleUpgradeable {
}

for (uint256 i = 0; i < _id.length; i++) {
_preSetModuleState(_compliance, _id[i], TFHE.asEuint64(_encryptedAmount[i], _inputProof[i]));
_preSetModuleState(_compliance, _id[i], TFHE.asEuint64(_encryptedAmount[i], _inputProof));
}

_compliancePresetStatus[_compliance] = true;
Expand Down
28 changes: 12 additions & 16 deletions contracts/token/Token.sol
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,9 @@ contract Token is IToken, AgentRoleUpgradeable, TokenStorage {
emit Unpaused(msg.sender);
}

function batchTransfer(
address[] calldata _toList,
einput[] calldata _encryptedAmount,
bytes[] calldata _inputProof
) external {
function batchTransfer(address[] calldata _toList, einput[] calldata _encryptedAmount, bytes calldata _inputProof) external {
for (uint256 i = 0; i < _toList.length; i++) {
transfer(_toList[i], _encryptedAmount[i], _inputProof[i]);
transfer(_toList[i], _encryptedAmount[i], _inputProof);
}
}

Expand Down Expand Up @@ -301,10 +297,10 @@ contract Token is IToken, AgentRoleUpgradeable, TokenStorage {
address[] calldata _fromList,
address[] calldata _toList,
einput[] calldata _encryptedAmount,
bytes[] calldata _inputProof
bytes calldata _inputProof
) external {
for (uint256 i = 0; i < _toList.length; i++) {
forcedTransfer(_fromList[i], _toList[i], _encryptedAmount[i], _inputProof[i]);
forcedTransfer(_fromList[i], _toList[i], _encryptedAmount[i], _inputProof);
}
}

Expand All @@ -321,9 +317,9 @@ contract Token is IToken, AgentRoleUpgradeable, TokenStorage {
}
}

function batchMint(address[] calldata _toList, einput[] calldata _encryptedAmount, bytes[] calldata _inputProof) external {
function batchMint(address[] calldata _toList, einput[] calldata _encryptedAmount, bytes calldata _inputProof) external {
for (uint256 i = 0; i < _toList.length; i++) {
mint(_toList[i], _encryptedAmount[i], _inputProof[i]);
mint(_toList[i], _encryptedAmount[i], _inputProof);
}
}

Expand All @@ -336,9 +332,9 @@ contract Token is IToken, AgentRoleUpgradeable, TokenStorage {
}
}

function batchBurn(address[] calldata _toList, einput[] calldata _encryptedAmount, bytes[] calldata _inputProof) external {
function batchBurn(address[] calldata _toList, einput[] calldata _encryptedAmount, bytes calldata _inputProof) external {
for (uint256 i = 0; i < _toList.length; i++) {
burn(_toList[i], _encryptedAmount[i], _inputProof[i]);
burn(_toList[i], _encryptedAmount[i], _inputProof);
}
}

Expand All @@ -363,10 +359,10 @@ contract Token is IToken, AgentRoleUpgradeable, TokenStorage {
function batchFreezePartialTokens(
address[] calldata _userAddresses,
einput[] calldata _encryptedAmount,
bytes[] calldata _inputProof
bytes calldata _inputProof
) external {
for (uint256 i = 0; i < _userAddresses.length; i++) {
freezePartialTokens(_userAddresses[i], _encryptedAmount[i], _inputProof[i]);
freezePartialTokens(_userAddresses[i], _encryptedAmount[i], _inputProof);
}
}

Expand All @@ -382,10 +378,10 @@ contract Token is IToken, AgentRoleUpgradeable, TokenStorage {
function batchUnfreezePartialTokens(
address[] calldata _userAddresses,
einput[] calldata _encryptedAmount,
bytes[] calldata _inputProof
bytes calldata _inputProof
) external {
for (uint256 i = 0; i < _userAddresses.length; i++) {
unfreezePartialTokens(_userAddresses[i], _encryptedAmount[i], _inputProof[i]);
unfreezePartialTokens(_userAddresses[i], _encryptedAmount[i], _inputProof);
}
}

Expand Down
Binary file modified screenshots/devnet_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/dvd_result_using_zama_account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 9 additions & 16 deletions scripts/executeDVD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,33 +139,26 @@ async function executeDVD() {
async function initiateTransfer(instances: FhevmInstances, tokenA: any, tokenB: any, signers: any, transferManager: any) {
// Approve the usage of transfer manager of the tokenA to swap
const inputAlice = instances.aliceWallet.createEncryptedInput(await tokenA.getAddress(), signers.aliceWallet.address);
inputAlice.add64(1000);
const encryptedAllowanceAmount = inputAlice.encrypt();
inputAlice.add64(1000).add64(500);
const encryptedAmount = inputAlice.encrypt();
const tx1 = await tokenA
.connect(signers.aliceWallet)
["approve(address,bytes32,bytes)"](
await transferManager.getAddress(),
encryptedAllowanceAmount.handles[0],
encryptedAllowanceAmount.inputProof
encryptedAmount.handles[0],
encryptedAmount.inputProof
);
await tx1.wait();
// Initiate the exchange of 1000 tokenA from Alice with 500 tokenB of Bob
const inputAlice1 = instances.aliceWallet.createEncryptedInput(await tokenA.getAddress(), signers.aliceWallet.address);
inputAlice1.add64(1000);
const encryptedInitTransfer = inputAlice1.encrypt();
const inputBob = instances.bobWallet.createEncryptedInput(await tokenB.getAddress(), signers.bobWallet.address);
inputBob.add64(500);
const encryptedInitTransfer2 = inputBob.encrypt();
const tx2 = await transferManager
.connect(signers.aliceWallet)
.initiateDVDTransfer(
["initiateDVDTransfer(address,bytes32,bytes32,bytes,address,address)"](
await tokenA.getAddress(),
encryptedInitTransfer.handles[0],
encryptedInitTransfer.inputProof,
encryptedAmount.handles[0],
encryptedAmount.handles[1],
encryptedAmount.inputProof,
signers.bobWallet.address,
await tokenB.getAddress(),
encryptedInitTransfer2.handles[0],
encryptedInitTransfer2.inputProof
await tokenB.getAddress()
);

const txReceipt = await tx2.wait();
Expand Down
Loading

0 comments on commit 8c8a5ce

Please sign in to comment.