Updated scripts for testing
This commit is contained in:
parent
7958750a81
commit
720aeda9fd
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
goal app delete --app-id $1 --from "$OWNER_ADDR" -o delete.txn
|
||||
algokey -t delete.txn -o delete.stxn sign -m "$OWNER_MNEMO"
|
||||
goal clerk rawsend -f delete.stxn
|
|
@ -1,6 +1,24 @@
|
|||
const TestLib = require('../test/testlib.js')
|
||||
const t = new TestLib.TestLib()
|
||||
const sigkeys = ['563d8d2fd4e701901d3846dee7ae7a92c18f1975195264d676f8407ac5976757', '8d97f25916a755df1d9ef74eb4dbebc5f868cb07830527731e94478cdc2b9d5f', '9bd728ad7617c05c31382053b57658d4a8125684c0098f740a054d87ddc0e93b']
|
||||
const sigkeys = ['563d8d2fd4e701901d3846dee7ae7a92c18f1975195264d676f8407ac5976757', '8d97f25916a755df1d9ef74eb4dbebc5f868cb07830527731e94478cdc2b9d5f', '9bd728ad7617c05c31382053b57658d4a8125684c0098f740a054d87ddc0e93b',
|
||||
'5a02c4cd110d20a83a7ce8d1a2b2ae5df252b4e5f6781c7855db5cc28ed2d1b4',
|
||||
'93d4e3b443bf11f99a00901222c032bd5f63cf73fc1bcfa40829824d121be9b2',
|
||||
'ea40e40c63c6ff155230da64a2c44fcd1f1c9e50cacb752c230f77771ce1d856',
|
||||
'87eaabe9c27a82198e618bca20f48f9679c0f239948dbd094005e262da33fe6a',
|
||||
'61ffed2bff38648a6d36d6ed560b741b1ca53d45391441124f27e1e48ca04770',
|
||||
'bd12a242c6da318fef8f98002efb98efbf434218a78730a197d981bebaee826e',
|
||||
'20d3597bb16525b6d09e5fb56feb91b053d961ab156f4807e37d980f50e71aff',
|
||||
'344b313ffbc0199ff6ca08cacdaf5dc1d85221e2f2dc156a84245bd49b981673',
|
||||
'848b93264edd3f1a521274ca4da4632989eb5303fd15b14e5ec6bcaa91172b05',
|
||||
'c6f2046c1e6c172497fc23bd362104e2f4460d0f61984938fa16ef43f27d93f6',
|
||||
'693b256b1ee6b6fb353ba23274280e7166ab3be8c23c203cc76d716ba4bc32bf',
|
||||
'13c41508c0da03018d61427910b9922345ced25e2bbce50652e939ee6e5ea56d',
|
||||
'460ee0ee403be7a4f1eb1c63dd1edaa815fbaa6cf0cf2344dcba4a8acf9aca74',
|
||||
'b25148579b99b18c8994b0b86e4dd586975a78fa6e7ad6ec89478d7fbafd2683',
|
||||
'90d7ac6a82166c908b8cf1b352f3c9340a8d1f2907d7146fb7cd6354a5436cca',
|
||||
'b71d23908e4cf5d6cd973394f3a4b6b164eb1065785feee612efdfd8d30005ed'
|
||||
|
||||
]
|
||||
const vaa = t.createSignedVAA(0, sigkeys, 1, 1, 1, '0x71f8dcb863d176e2c420ad6610cf687359612b6fb392e0642b0ca6b1f186aa3b', 0, 0, '0x12345678')
|
||||
if (process.argv[2] === '--sig') {
|
||||
console.log(vaa.substr(12, sigkeys.length * 132))
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
export OWNER_ADDR=OPDM7ACAW64Q4VBWAL77Z5SHSJVZZ44V3BAN7W44U43SUXEOUENZMZYOQU
|
||||
export OWNER_MNEMO='assault approve result rare float sugar power float soul kind galaxy edit unusual pretty tone tilt net range pelican avoid unhappy amused recycle abstract master'
|
||||
export GUARDIAN_KEYS='52A26Ce40F8CAa8D36155d37ef0D5D783fc614d2389A74E8FFa224aeAD0778c786163a7A2150768CB4459EA6482D4aE574305B239B4f2264239e7599072491bd66F63356090C11Aae8114F5372aBf12B51280eA1fd2B0A1c76Ae29a7d54dda68860A2bfFfa9Aa60CfF05e20E2CcAA784eE89A0A16C2057CBe42d59F8FCd86a1c5c4bA351bD251A5c5B05DF6A4B07fF9D5cE1A6ed58b6e9e7d6974d1baBEc087ec8306B84235D7b0478c61783C50F990bfC44cFc0C8C1035110a13fe788259A4148F871b52bAbcb1B58A2508A20A7198E131503ce26bBE119aA8c62b28390820f04ddA22AFe03be1c3bb10f4ba6CF94A01FD6e97387C34a1F36DE0f8341E9D409E06ec45b255a41fC2792209CB998A8287204D40996df9E54bA663B12DD23fbF4FbAC618Be140727986B3BBd079040E577aC50486d0F6930e160A5C75FD1203C63580D2F00309A9A85efFAf02564Fc183C0183A963869795913D3B6dBF3B24a1C7654672c69A23c351c0Cc52D7673c52DE99785741344662F5b2308a0'
|
||||
export GKEYSBASE64=`node -e "console.log(Buffer.from('$GUARDIAN_KEYS', 'hex').toString('base64'))"`
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
export SIGNATURES064=`node -e "console.log(Buffer.from('003fe8e05b0d3594bbf0ab1da0110dded88930a181ace6089a2442a8e58b293b23777331d928ab36c85de11e6f2874c1cc12c418fc4e0c1e344864a8b85fda042e0001791d7134fba47002376841fe688f7c478ba223580ec25ad5046a93db477d36fb4afa241ea95bf3c02b378a24220ff0f2ea035d088a0011bff9a4743d88f5c1b4010281940f26308012efd7a307960223638abde4fb55abcaac04a9fa97bf92e5518e5903396bf7e807eb0e97e3009f7e679c0dcece45cd659ab6cf45fed9add2d6a10103470cda5780ffb89118f152c449b4137f6c4f5413c4193d8a4169b31712d6c6583a90d34a31184cc5f3c8e8c987753a69ceadb2a46fcd31cd2db8fba4f918f5270004376beb1f765fe3222cc3fc0a891f731a7c9cdb762b5997e8bd9e32e473c2cf8b63db7fbb06156ec90990e6edd39cf3402054c2ca34bbec6fc2ab1cbfe49c9a860005058e4f1150dcdba98b8054f99dfe75fa2c2c8f0c9b23a858c9e5abff85e535f317627ddf5ec51b43182b382811f8a52c7832be5c7c630eb45d9213a96989c25c01','hex').toString('base64'))"`
|
||||
export SIGNATURES164=`node -e "console.log(Buffer.from('0699f7fe9387cbc7c6528f7b7183042efb8d52f5e2811dc274c3e90141ff187fa21761f04e0d9b99f7bb40ad48709532c40b012de07d5253696aae4972ed1db2130107bfcf86e950316e431874dc755acafdbaf9c28d62b3731f76abe2f7299add68d0629fc5df238856ba6ad1c9ab6a5ed3f0c43a350250005274bdadbc2c697eb63b0108d69cae6a854c5468415c51747c9d7861ca5d5b164d100486c40477602a1c2e983da703866ffb2d3c9a642681e0c97c1ba8927d38b1d583c03a89d4f277a9a33900097e82cad360d4bb4f71e74e2ce0bdc067c38a97bd000fb397c99dbed63013179000b47e534028300a99ba5f722877164341ab859f8e7c21f815a77d54fd78aba2000ab009ea66dd2d7114952b3a667bd603110f08bd20ac03a79b672049e4a2f515b713527db7db0a3c13442ba8f2dad37cb255e4c660251cb96784ce7d385576eed5010b5ef9003237297028d98779f43041bd3141b4219ffa5965cf806d23188bb0538f0639aaadcda9d62a402df3a48da7cae5cc25e1a129ba30cf08cf5ff4da49bd0c00', 'hex').toString('base64'))"`
|
||||
|
||||
export SIGNATURES264=`node -e "console.log(Buffer.from('0cca7cd22e1514f0022666b35379f0685bfebbd5b80832d77eae6f57f52d351509093c433774d07ff6f3a4698331333a1dbb5478c4a51e20c15380d5dc68575f66000d525ac1524ec9d9ee623ef535a867e8f86d9b3f8e4c7b4234dbe7bb40dc8494327af2fa37c3db50064d6114f2e1441c4eee444b83636f11ce1f730f7b38490e28000e4528d8e7556ac14c74260f4ca5ed62c275324adec5a1146ac1abf6b41fcec88a24b4b797ed5370f648647904662e1fe2da2b4dea4327dfd2b94ca7080ed569f7010f5c84b1ef2ff5938ecdfd7048b2323b3e3568b2e0a62c8c513f60a4dfce8ee48e3fc7409caad8be1185be42c8a5e81d1fa4c4c98f6f53cdcddab6add2384dc5f20110cad08c66411cde321ce5b598ee4620e098e18a0427444c57923507064368912a3fab73a6b40dc050fbdaf340409583735a2528fde9b9b0322bd317f804b4767b0011c17a151c7d37376a3f7ea45030a18c4e3791dc5e376c350fe7838548506f64ee19e946fcb1b258394c6b6964608fc0a9d6a5ef682b3faded66b214637220dab300', 'hex').toString('base64'))"`
|
||||
|
||||
export SIGNATURES364=`node -e "console.log(Buffer.from('12af4f9015c9f11da3cb5457be96db960d49b37e59ec2bfce2b21dd2dfd28305f560e7977994a8380b7486361758a3eeace18aa1781bfcd79ad27995b41e504cd701','hex').toString('base64'))"`
|
||||
|
||||
|
||||
export GK0='52A26Ce40F8CAa8D36155d37ef0D5D783fc614d2389A74E8FFa224aeAD0778c786163a7A2150768CB4459EA6482D4aE574305B239B4f2264239e7599072491bd66F63356090C11Aae8114F5372aBf12B51280eA1fd2B0A1c76Ae29a7d54dda68860A2bfFfa9Aa60CfF05e20E2CcAA784eE89A0A16C2057CB'
|
||||
|
||||
export GK1='e42d59F8FCd86a1c5c4bA351bD251A5c5B05DF6A4B07fF9D5cE1A6ed58b6e9e7d6974d1baBEc087ec8306B84235D7b0478c61783C50F990bfC44cFc0C8C1035110a13fe788259A4148F871b52bAbcb1B58A2508A20A7198E131503ce26bBE119aA8c62b28390820f04ddA22AFe03be1c3bb10f4ba6CF94A0'
|
||||
|
||||
export GK2='1FD6e97387C34a1F36DE0f8341E9D409E06ec45b255a41fC2792209CB998A8287204D40996df9E54bA663B12DD23fbF4FbAC618Be140727986B3BBd079040E577aC50486d0F6930e160A5C75FD1203C63580D2F00309A9A85efFAf02564Fc183C0183A963869795913D3B6dBF3B24a1C7654672c69A23c35'
|
||||
|
||||
export GK3='1c0Cc52D7673c52DE99785741344662F5b2308a0'
|
||||
|
||||
export GK064=`node -e "console.log(Buffer.from('$GK0', 'hex').toString('base64'))"`
|
||||
export GK164=`node -e "console.log(Buffer.from('$GK1', 'hex').toString('base64'))"`
|
||||
export GK264=`node -e "console.log(Buffer.from('$GK2', 'hex').toString('base64'))"`
|
||||
export GK364=`node -e "console.log(Buffer.from('$GK3', 'hex').toString('base64'))"`
|
||||
|
||||
export VAABODY='0000000100000001000171f8dcb863d176e2c420ad6610cf687359612b6fb392e0642b0ca6b1f186aa3b00000000000000000012345678'
|
||||
export VAABODY64=`node -e "console.log(Buffer.from('$VAABODY', 'hex').toString('base64'))"`
|
||||
rm -f verify?.txn verify?.stxn verify?.dump
|
||||
|
||||
if [[ $1 == '' ]]
|
||||
then
|
||||
echo 'No appid specified'
|
||||
exit
|
||||
fi
|
||||
|
||||
# Verification step for keys 0..5
|
||||
goal app call --app-id $1 --from "$STATELESS_ADDR" --app-arg "str:verify" --app-arg "b64:$GK064" --app-arg "int:19" --noteb64 "$VAABODY64" -o verify0.txn
|
||||
goal app call --app-id $1 --from "$STATELESS_ADDR" --app-arg "str:verify" --app-arg "b64:$GK164" --app-arg "int:19" --noteb64 "$VAABODY64" -o verify1.txn
|
||||
goal app call --app-id $1 --from "$STATELESS_ADDR" --app-arg "str:verify" --app-arg "b64:$GK264" --app-arg "int:19" --noteb64 "$VAABODY64" -o verify2.txn
|
||||
goal app call --app-id $1 --from "$STATELESS_ADDR" --app-arg "str:verify" --app-arg "b64:$GK364" --app-arg "int:19" --noteb64 "$VAABODY64" -o verify3.txn
|
||||
cat verify0.txn verify1.txn verify2.txn verify3.txn > verifycc.txn
|
||||
goal clerk group -i verifycc.txn -o group.txn
|
||||
goal clerk sign --program vaa-verify.teal --argb64 "$SIGNATURES064" --infile verify0.txn --outfile verify0.stxn
|
||||
goal clerk sign --program vaa-verify.teal --argb64 "$SIGNATURES164" --infile verify1.txn --outfile verify1.stxn
|
||||
goal clerk sign --program vaa-verify.teal --argb64 "$SIGNATURES264" --infile verify2.txn --outfile verify2.stxn
|
||||
goal clerk sign --program vaa-verify.teal --argb64 "$SIGNATURES364" --infile verify3.txn --outfile verify3.stxn
|
||||
cat verify0.stxn verify1.sxtn verify2.stxn verify3.stxn > verifygroup.stxn
|
||||
goal clerk dryrun -t verifygroup.stxn --dryrun-dump --outfile verifygroup.dump
|
||||
goal clerk dryrun-remote -D verifygroup.dump --verbose
|
||||
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
#!/bin/bash
|
||||
export SIGNATURES64=`node -e "console.log(Buffer.from('$2','hex').toString('base64'))"`
|
||||
export GUARDIAN_KEYS='52A26Ce40F8CAa8D36155d37ef0D5D783fc614d2389A74E8FFa224aeAD0778c786163a7A2150768CB4459EA6482D4aE574305B239B4f2264239e7599'
|
||||
export GUARDIAN_KEYS='52A26Ce40F8CAa8D36155d37ef0D5D783fc614d2389A74E8FFa224aeAD0778c786163a7A2150768CB4459EA6482D4aE574305B239B4f2264239e7599072491bd66F63356090C11Aae8114F5372aBf12B51280eA1fd2B0A1c76Ae29a7d54dda68860A2bfFfa9Aa60CfF05e20E2CcAA784eE89A0A16C2057CBe42d59F8FCd86a1c5c4bA351bD251A5c5B05DF6A4B07fF9D5cE1A6ed58b6e9e7d6974d1baBEc087ec8306B84235D7b0478c61783C50F990bfC44cFc0C8C1035110a13fe788259A4148F871b52bAbcb1B58A2508A20A7198E131503ce26bBE119aA8c62b28390820f04ddA22AFe03be1c3bb10f4ba6CF94A01FD6e97387C34a1F36DE0f8341E9D409E06ec45b255a41fC2792209CB998A8287204D40996df9E54bA663B12DD23fbF4FbAC618Be140727986B3BBd079040E577aC50486d0F6930e160A5C75FD1203C63580D2F00309A9A85efFAf02564Fc183C0183A963869795913D3B6dBF3B24a1C7654672c69A23c351c0Cc52D7673c52DE99785741344662F5b2308a0'
|
||||
export GKEYSBASE64=`node -e "console.log(Buffer.from('$GUARDIAN_KEYS', 'hex').toString('base64'))"`
|
||||
export VAABODY=$3
|
||||
export VAABODY64=`node -e "console.log(Buffer.from('$VAABODY', 'hex').toString('base64'))"`
|
||||
rm verify.txn verify.stxn
|
||||
goal app call --app-id $1 --from "$STATELESS_ADDR" --app-arg "str:verify" --app-arg "b64:$GKEYSBASE64" --app-arg "int:3" --noteb64 "$VAABODY64" -o verify.txn
|
||||
goal clerk sign --program vaa-verify.teal --argb64 "$SIGNATURES64" --infile verify.txn --outfile verify.stxn
|
||||
goal clerk dryrun -t verify.stxn
|
||||
goal clerk dryrun -t verify.stxn --dryrun-dump --outfile verify.dump
|
||||
goal clerk dryrun-remote -D verify.dump --verbose
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,94 @@
|
|||
Hand-testing guide
|
||||
------------------
|
||||
|
||||
Compile PyTEAL sources,
|
||||
|
||||
The nineteen sample guardian keys:
|
||||
|
||||
```
|
||||
Key PK
|
||||
------------------------------------------ ----------------------------------------------------------------
|
||||
0x52A26Ce40F8CAa8D36155d37ef0D5D783fc614d2 563d8d2fd4e701901d3846dee7ae7a92c18f1975195264d676f8407ac5976757
|
||||
0x389A74E8FFa224aeAD0778c786163a7A2150768C 8d97f25916a755df1d9ef74eb4dbebc5f868cb07830527731e94478cdc2b9d5f
|
||||
0xB4459EA6482D4aE574305B239B4f2264239e7599 9bd728ad7617c05c31382053b57658d4a8125684c0098f740a054d87ddc0e93b
|
||||
0x072491bd66F63356090C11Aae8114F5372aBf12B 5a02c4cd110d20a83a7ce8d1a2b2ae5df252b4e5f6781c7855db5cc28ed2d1b4
|
||||
0x51280eA1fd2B0A1c76Ae29a7d54dda68860A2bfF 93d4e3b443bf11f99a00901222c032bd5f63cf73fc1bcfa40829824d121be9b2
|
||||
0xfa9Aa60CfF05e20E2CcAA784eE89A0A16C2057CB ea40e40c63c6ff155230da64a2c44fcd1f1c9e50cacb752c230f77771ce1d856
|
||||
0xe42d59F8FCd86a1c5c4bA351bD251A5c5B05DF6A 87eaabe9c27a82198e618bca20f48f9679c0f239948dbd094005e262da33fe6a
|
||||
0x4B07fF9D5cE1A6ed58b6e9e7d6974d1baBEc087e 61ffed2bff38648a6d36d6ed560b741b1ca53d45391441124f27e1e48ca04770
|
||||
0xc8306B84235D7b0478c61783C50F990bfC44cFc0 bd12a242c6da318fef8f98002efb98efbf434218a78730a197d981bebaee826e
|
||||
0xC8C1035110a13fe788259A4148F871b52bAbcb1B 20d3597bb16525b6d09e5fb56feb91b053d961ab156f4807e37d980f50e71aff
|
||||
0x58A2508A20A7198E131503ce26bBE119aA8c62b2 344b313ffbc0199ff6ca08cacdaf5dc1d85221e2f2dc156a84245bd49b981673
|
||||
0x8390820f04ddA22AFe03be1c3bb10f4ba6CF94A0 848b93264edd3f1a521274ca4da4632989eb5303fd15b14e5ec6bcaa91172b05
|
||||
0x1FD6e97387C34a1F36DE0f8341E9D409E06ec45b c6f2046c1e6c172497fc23bd362104e2f4460d0f61984938fa16ef43f27d93f6
|
||||
0x255a41fC2792209CB998A8287204D40996df9E54 693b256b1ee6b6fb353ba23274280e7166ab3be8c23c203cc76d716ba4bc32bf
|
||||
0xbA663B12DD23fbF4FbAC618Be140727986B3BBd0 13c41508c0da03018d61427910b9922345ced25e2bbce50652e939ee6e5ea56d
|
||||
0x79040E577aC50486d0F6930e160A5C75FD1203C6 460ee0ee403be7a4f1eb1c63dd1edaa815fbaa6cf0cf2344dcba4a8acf9aca74
|
||||
0x3580D2F00309A9A85efFAf02564Fc183C0183A96 b25148579b99b18c8994b0b86e4dd586975a78fa6e7ad6ec89478d7fbafd2683
|
||||
0x3869795913D3B6dBF3B24a1C7654672c69A23c35 90d7ac6a82166c908b8cf1b352f3c9340a8d1f2907d7146fb7cd6354a5436cca
|
||||
0x1c0Cc52D7673c52DE99785741344662F5b2308a0 b71d23908e4cf5d6cd973394f3a4b6b164eb1065785feee612efdfd8d30005ed
|
||||
------------------------------------------ ----------------------------------------------------------------
|
||||
```
|
||||
|
||||
|
||||
keys for tx0:
|
||||
52A26Ce40F8CAa8D36155d37ef0D5D783fc614d2389A74E8FFa224aeAD0778c786163a7A2150768CB4459EA6482D4aE574305B239B4f2264239e7599072491bd66F63356090C11Aae8114F5372aBf12B51280eA1fd2B0A1c76Ae29a7d54dda68860A2bfFfa9Aa60CfF05e20E2CcAA784eE89A0A16C2057CB
|
||||
|
||||
keys for tx1:
|
||||
e42d59F8FCd86a1c5c4bA351bD251A5c5B05DF6A4B07fF9D5cE1A6ed58b6e9e7d6974d1baBEc087ec8306B84235D7b0478c61783C50F990bfC44cFc0C8C1035110a13fe788259A4148F871b52bAbcb1B58A2508A20A7198E131503ce26bBE119aA8c62b28390820f04ddA22AFe03be1c3bb10f4ba6CF94A0
|
||||
|
||||
keys for tx2:
|
||||
1FD6e97387C34a1F36DE0f8341E9D409E06ec45b255a41fC2792209CB998A8287204D40996df9E54bA663B12DD23fbF4FbAC618Be140727986B3BBd079040E577aC50486d0F6930e160A5C75FD1203C63580D2F00309A9A85efFAf02564Fc183C0183A963869795913D3B6dBF3B24a1C7654672c69A23c35
|
||||
|
||||
keys for tx3:
|
||||
1c0Cc52D7673c52DE99785741344662F5b2308a0
|
||||
|
||||
|
||||
563d8d2fd4e701901d3846dee7ae7a92c18f1975195264d676f8407ac5976757
|
||||
8d97f25916a755df1d9ef74eb4dbebc5f868cb07830527731e94478cdc2b9d5f
|
||||
9bd728ad7617c05c31382053b57658d4a8125684c0098f740a054d87ddc0e93b
|
||||
5a02c4cd110d20a83a7ce8d1a2b2ae5df252b4e5f6781c7855db5cc28ed2d1b4
|
||||
93d4e3b443bf11f99a00901222c032bd5f63cf73fc1bcfa40829824d121be9b2
|
||||
ea40e40c63c6ff155230da64a2c44fcd1f1c9e50cacb752c230f77771ce1d856
|
||||
87eaabe9c27a82198e618bca20f48f9679c0f239948dbd094005e262da33fe6a
|
||||
61ffed2bff38648a6d36d6ed560b741b1ca53d45391441124f27e1e48ca04770
|
||||
bd12a242c6da318fef8f98002efb98efbf434218a78730a197d981bebaee826e
|
||||
20d3597bb16525b6d09e5fb56feb91b053d961ab156f4807e37d980f50e71aff
|
||||
344b313ffbc0199ff6ca08cacdaf5dc1d85221e2f2dc156a84245bd49b981673
|
||||
848b93264edd3f1a521274ca4da4632989eb5303fd15b14e5ec6bcaa91172b05
|
||||
c6f2046c1e6c172497fc23bd362104e2f4460d0f61984938fa16ef43f27d93f6
|
||||
693b256b1ee6b6fb353ba23274280e7166ab3be8c23c203cc76d716ba4bc32bf
|
||||
13c41508c0da03018d61427910b9922345ced25e2bbce50652e939ee6e5ea56d
|
||||
460ee0ee403be7a4f1eb1c63dd1edaa815fbaa6cf0cf2344dcba4a8acf9aca74
|
||||
b25148579b99b18c8994b0b86e4dd586975a78fa6e7ad6ec89478d7fbafd2683
|
||||
90d7ac6a82166c908b8cf1b352f3c9340a8d1f2907d7146fb7cd6354a5436cca
|
||||
b71d23908e4cf5d6cd973394f3a4b6b164eb1065785feee612efdfd8d30005ed
|
||||
|
||||
|
||||
003fe8e05b0d3594bbf0ab1da0110dded88930a181ace6089a2442a8e58b293b23777331d928ab36c85de11e6f2874c1cc12c418fc4e0c1e344864a8b85fda042e00
|
||||
01791d7134fba47002376841fe688f7c478ba223580ec25ad5046a93db477d36fb4afa241ea95bf3c02b378a24220ff0f2ea035d088a0011bff9a4743d88f5c1b401
|
||||
0281940f26308012efd7a307960223638abde4fb55abcaac04a9fa97bf92e5518e5903396bf7e807eb0e97e3009f7e679c0dcece45cd659ab6cf45fed9add2d6a101
|
||||
03470cda5780ffb89118f152c449b4137f6c4f5413c4193d8a4169b31712d6c6583a90d34a31184cc5f3c8e8c987753a69ceadb2a46fcd31cd2db8fba4f918f52700
|
||||
04376beb1f765fe3222cc3fc0a891f731a7c9cdb762b5997e8bd9e32e473c2cf8b63db7fbb06156ec90990e6edd39cf3402054c2ca34bbec6fc2ab1cbfe49c9a8600
|
||||
05058e4f1150dcdba98b8054f99dfe75fa2c2c8f0c9b23a858c9e5abff85e535f317627ddf5ec51b43182b382811f8a52c7832be5c7c630eb45d9213a96989c25c01
|
||||
|
||||
0699f7fe9387cbc7c6528f7b7183042efb8d52f5e2811dc274c3e90141ff187fa21761f04e0d9b99f7bb40ad48709532c40b012de07d5253696aae4972ed1db21301
|
||||
07bfcf86e950316e431874dc755acafdbaf9c28d62b3731f76abe2f7299add68d0629fc5df238856ba6ad1c9ab6a5ed3f0c43a350250005274bdadbc2c697eb63b01
|
||||
08d69cae6a854c5468415c51747c9d7861ca5d5b164d100486c40477602a1c2e983da703866ffb2d3c9a642681e0c97c1ba8927d38b1d583c03a89d4f277a9a33900
|
||||
097e82cad360d4bb4f71e74e2ce0bdc067c38a97bd000fb397c99dbed63013179000b47e534028300a99ba5f722877164341ab859f8e7c21f815a77d54fd78aba200
|
||||
0ab009ea66dd2d7114952b3a667bd603110f08bd20ac03a79b672049e4a2f515b713527db7db0a3c13442ba8f2dad37cb255e4c660251cb96784ce7d385576eed501
|
||||
0b5ef9003237297028d98779f43041bd3141b4219ffa5965cf806d23188bb0538f0639aaadcda9d62a402df3a48da7cae5cc25e1a129ba30cf08cf5ff4da49bd0c00
|
||||
|
||||
0cca7cd22e1514f0022666b35379f0685bfebbd5b80832d77eae6f57f52d351509093c433774d07ff6f3a4698331333a1dbb5478c4a51e20c15380d5dc68575f6600
|
||||
0d525ac1524ec9d9ee623ef535a867e8f86d9b3f8e4c7b4234dbe7bb40dc8494327af2fa37c3db50064d6114f2e1441c4eee444b83636f11ce1f730f7b38490e2800
|
||||
0e4528d8e7556ac14c74260f4ca5ed62c275324adec5a1146ac1abf6b41fcec88a24b4b797ed5370f648647904662e1fe2da2b4dea4327dfd2b94ca7080ed569f701
|
||||
0f5c84b1ef2ff5938ecdfd7048b2323b3e3568b2e0a62c8c513f60a4dfce8ee48e3fc7409caad8be1185be42c8a5e81d1fa4c4c98f6f53cdcddab6add2384dc5f201
|
||||
10cad08c66411cde321ce5b598ee4620e098e18a0427444c57923507064368912a3fab73a6b40dc050fbdaf340409583735a2528fde9b9b0322bd317f804b4767b00
|
||||
11c17a151c7d37376a3f7ea45030a18c4e3791dc5e376c350fe7838548506f64ee19e946fcb1b258394c6b6964608fc0a9d6a5ef682b3faded66b214637220dab300
|
||||
|
||||
12af4f9015c9f11da3cb5457be96db960d49b37e59ec2bfce2b21dd2dfd28305f560e7977994a8380b7486361758a3eeace18aa1781bfcd79ad27995b41e504cd701
|
||||
|
||||
|
||||
* Compile PyTEAL sources,
|
||||
|
||||
```
|
||||
C:\src\PriceCasterService>python teal\wormhole\pyteal\vaa-processor.py vaap.teal vaap-clear.teal
|
||||
|
@ -13,7 +100,7 @@ Written to vaap-clear.teal
|
|||
|
||||
```
|
||||
|
||||
Copy compiled teal files to Sandbox (optional):
|
||||
* Copy compiled teal files to Sandbox (optional):
|
||||
|
||||
```
|
||||
./sandbox copyTo /mnt/c/src/PriceCasterService/vaap.teal
|
||||
|
@ -24,49 +111,10 @@ Now copying /mnt/c/src/PriceCasterService/vaap.teal to Algod container in /opt/d
|
|||
Now copying /mnt/c/src/PriceCasterService/vaap-clear.teal to Algod container in /opt/data//mnt/c/src/PriceCasterService/vaap-clear.teal
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
The nineteen sample guardian keys:
|
||||
0x52A26Ce40F8CAa8D36155d37ef0D5D783fc614d2 K: 563d8d2fd4e701901d3846dee7ae7a92c18f1975195264d676f8407ac5976757
|
||||
0x389A74E8FFa224aeAD0778c786163a7A2150768C K: 8d97f25916a755df1d9ef74eb4dbebc5f868cb07830527731e94478cdc2b9d5f
|
||||
0xB4459EA6482D4aE574305B239B4f2264239e7599 K: 9bd728ad7617c05c31382053b57658d4a8125684c0098f740a054d87ddc0e93b
|
||||
|
||||
0x072491bd66F63356090C11Aae8114F5372aBf12B K: 5a02c4cd110d20a83a7ce8d1a2b2ae5df252b4e5f6781c7855db5cc28ed2d1b4
|
||||
0x51280eA1fd2B0A1c76Ae29a7d54dda68860A2bfF 93d4e3b443bf11f99a00901222c032bd5f63cf73fc1bcfa40829824d121be9b2
|
||||
0xfa9Aa60CfF05e20E2CcAA784eE89A0A16C2057CB ea40e40c63c6ff155230da64a2c44fcd1f1c9e50cacb752c230f77771ce1d856
|
||||
|
||||
0xe42d59F8FCd86a1c5c4bA351bD251A5c5B05DF6A 87eaabe9c27a82198e618bca20f48f9679c0f239948dbd094005e262da33fe6a
|
||||
0x4B07fF9D5cE1A6ed58b6e9e7d6974d1baBEc087e 61ffed2bff38648a6d36d6ed560b741b1ca53d45391441124f27e1e48ca04770
|
||||
0xc8306B84235D7b0478c61783C50F990bfC44cFc0 bd12a242c6da318fef8f98002efb98efbf434218a78730a197d981bebaee826e
|
||||
|
||||
0xC8C1035110a13fe788259A4148F871b52bAbcb1B 20d3597bb16525b6d09e5fb56feb91b053d961ab156f4807e37d980f50e71aff
|
||||
0x58A2508A20A7198E131503ce26bBE119aA8c62b2 344b313ffbc0199ff6ca08cacdaf5dc1d85221e2f2dc156a84245bd49b981673
|
||||
0x8390820f04ddA22AFe03be1c3bb10f4ba6CF94A0 848b93264edd3f1a521274ca4da4632989eb5303fd15b14e5ec6bcaa91172b05
|
||||
|
||||
0x1FD6e97387C34a1F36DE0f8341E9D409E06ec45b c6f2046c1e6c172497fc23bd362104e2f4460d0f61984938fa16ef43f27d93f6
|
||||
0x255a41fC2792209CB998A8287204D40996df9E54 693b256b1ee6b6fb353ba23274280e7166ab3be8c23c203cc76d716ba4bc32bf
|
||||
0xbA663B12DD23fbF4FbAC618Be140727986B3BBd0 13c41508c0da03018d61427910b9922345ced25e2bbce50652e939ee6e5ea56d
|
||||
|
||||
0x79040E577aC50486d0F6930e160A5C75FD1203C6 460ee0ee403be7a4f1eb1c63dd1edaa815fbaa6cf0cf2344dcba4a8acf9aca74
|
||||
0x3580D2F00309A9A85efFAf02564Fc183C0183A96 b25148579b99b18c8994b0b86e4dd586975a78fa6e7ad6ec89478d7fbafd2683
|
||||
0x3869795913D3B6dBF3B24a1C7654672c69A23c35 90d7ac6a82166c908b8cf1b352f3c9340a8d1f2907d7146fb7cd6354a5436cca
|
||||
|
||||
0x1c0Cc52D7673c52DE99785741344662F5b2308a0 b71d23908e4cf5d6cd973394f3a4b6b164eb1065785feee612efdfd8d30005ed
|
||||
|
||||
|
||||
|
||||
Set environment variables for convenience.
|
||||
|
||||
|
||||
* Execute `setvars` from scripts directory
|
||||
|
||||
```
|
||||
|
||||
export OWNER_ADDR=OPDM7ACAW64Q4VBWAL77Z5SHSJVZZ44V3BAN7W44U43SUXEOUENZMZYOQU
|
||||
export OWNER_MNEMO='assault approve result rare float sugar power float soul kind galaxy edit unusual pretty tone tilt net range pelican avoid unhappy amused recycle abstract master'
|
||||
export GUARDIAN_KEYS='52A26Ce40F8CAa8D36155d37ef0D5D783fc614d2389A74E8FFa224aeAD0778c786163a7A2150768CB4459EA6482D4aE574305B239B4f2264239e7599'
|
||||
export GKEYSBASE64=`node -e "console.log(Buffer.from('$GUARDIAN_KEYS', 'hex').toString('base64'))"`
|
||||
|
||||
source scripts/setvars.sh
|
||||
```
|
||||
|
||||
* Make sure to clear previously created VAA Processor Apps, example:
|
||||
|
@ -83,28 +131,22 @@ Opted In Apps:
|
|||
ID 14713804, local state used 1/3 uints, 1/2 byte slices
|
||||
|
||||
|
||||
goal app delete --app-id 45231352 --from OPDM7ACAW64Q4VBWAL77Z5SHSJVZZ44V3BAN7W44U43SUXEOUENZMZYOQU -o delete.txn
|
||||
algokey -t delete.txn -o delete.stxn sign -m $OWNER_MNEMO
|
||||
goal clerk rawsend -f delete.sxtn
|
||||
```
|
||||
|
||||
|
||||
* Deploy and bootstrap the VAA Processor contract.
|
||||
|
||||
```
|
||||
goal app create --creator "$OWNER_ADDR" --global-ints 4 --global-byteslices 20 --local-byteslices 0 --local-ints 0 --approval-prog vaap.teal --clear-prog vaap-clear.teal --app-arg "b64:$GKEYSBASE64" --app-arg 'int:0' --app-arg 'int:0' -o create.txn
|
||||
algokey -t create.txn -o create.stxn sign -m "$OWNER_MNEMO" && goal clerk rawsend -f create.stxn
|
||||
scripts/deleteapp.sh 45231352
|
||||
|
||||
```
|
||||
|
||||
* Create the application and Check the deployed application ID according to the final TX ID.
|
||||
|
||||
```
|
||||
scripts/createapp.sh
|
||||
```
|
||||
|
||||
Check the deployed application ID according to the final TX ID.
|
||||
|
||||
* Compile the stateless logic with the VAA Processor ID, for example:
|
||||
|
||||
|
||||
```
|
||||
python teal\wormhole\pyteal\vaa-verify.py 45504480 vaaverify.teal
|
||||
python teal\wormhole\pyteal\vaa-verify.py <APP-ID> vaaverify.teal
|
||||
|
||||
goal clerk compile vaaverify.teal
|
||||
vaaverify.teal: 4H2VD6GY4L7HEOVTZBKGTO6EYFASYFOWN34ONR5HIFEE2JIJ2M5GK26SXI
|
||||
|
@ -113,8 +155,7 @@ vaaverify.teal: 4H2VD6GY4L7HEOVTZBKGTO6EYFASYFOWN34ONR5HIFEE2JIJ2M5GK26SXI
|
|||
* Set the stateless program hash with the "setvphash" appcall:
|
||||
|
||||
```
|
||||
goal app call --app-id 45504480 --from "$OWNER_ADDR" --app-arg "str:setvphash" --app-arg "addr:4H2VD6GY4L7HEOVTZBKGTO6EYFASYFOWN34ONR5HIFEE2JIJ2M5GK26SXI" -o setvphash.txn
|
||||
algokey -t setvphash.txn -o setvphash.stxn sign -m "$OWNER_MNEMO" && goal clerk rawsend -f setvphash.stxn
|
||||
source scripts/setvphash <APP-ID>
|
||||
```
|
||||
|
||||
* To verify a sample VAA, you can use the testing library using Nodejs as follows:
|
||||
|
@ -166,7 +207,7 @@ payload:
|
|||
```
|
||||
|
||||
VAA Body:
|
||||
00 00 00 01 00 00 00 01 00 01 71f8dcb863d176e2c420ad6610cf687359612b6fb392e0642b0ca6b1f186aa3b00000000000000010012345678
|
||||
0000000100000001000171f8dcb863d176e2c420ad6610cf687359612b6fb392e0642b0ca6b1f186aa3b00000000000000010012345678
|
||||
|
||||
Since there are three signers, VAA can be verified in a group transaction with just one step.
|
||||
|
||||
|
@ -186,3 +227,11 @@ goal app call --app-id 45504480 --from "$STATELESS_ADDR" --app-arg "str:verify"
|
|||
|
||||
```
|
||||
|
||||
00 3fe8e05b0d3594bbf0ab1da0110dded88930a181ace6089a2442a8e58b293b23777331d928ab36c85de11e6f2874c1cc12c418fc4e0c1e344864a8b85fda042e00
|
||||
01 791d7134fba47002376841fe688f7c478ba223580ec25ad5046a93db477d36fb 4afa241ea95bf3c02b378a24220ff0f2ea035d088a0011bff9a4743d88f5c1b401
|
||||
02 81940f26308012efd7a307960223638abde4fb55abcaac04a9fa97bf92e5518e5903396bf7e807eb0e97e3009f7e679c0dcece45cd659ab6cf45fed9add2d6a10
|
||||
|
||||
|
||||
52a26ce40f8caa8d36155d37ef0d5d783fc614d2
|
||||
389a74e8ffa224aead0778c786163a7a2150768c
|
||||
b4459ea6482d4ae574305b239b4f2264239e7599
|
Loading…
Reference in New Issue