Created
October 15, 2019 06:16
-
-
Save yurenju/d5b6f5aa97a3c5155636ab3466a188b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function transferFromBobToAlice() { | |
const msg = | |
`Split note to note A with ${splitValues[0]} value for bob & ` + | |
`note B with ${splitValues[1]} value for alice`; | |
console.log(chalk.green(msg)); | |
const noteA = await note.create(bob.publicKey, splitValues[0]); | |
const noteB = await note.create(alice.publicKey, splitValues[1]); | |
transferNotes = [noteA, noteB]; | |
const transferProof = new JoinSplitProof( | |
depositNotes, | |
transferNotes, | |
bob.address, | |
0, | |
bob.address | |
); | |
const transferData = transferProof.encodeABI(contractAddresses.zkAsset); | |
const transferSignatures = transferProof.constructSignatures(contractAddresses.zkAsset, [ | |
bob.aztecAccount | |
]); | |
console.log("- executing transfer: zkAssetSigner.confidentialTransfer()"); | |
await (await bob.signers.zkAsset.confidentialTransfer( | |
transferData, | |
transferSignatures, | |
ethOptions | |
)).wait(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment