-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V3.1 audit fixes #255
V3.1 audit fixes #255
Changes from 22 commits
21d74ab
de92e66
81cdbfb
d9d15f1
bd18c31
70a9a35
50657a4
939ad9d
f25b8ef
fe6ea58
e8ad785
46c4ab2
2a63507
82684b2
c7f9490
74b68f2
0da9aa3
a4f51fa
dab4a14
6c13007
2f1b424
87441db
0c4a1b2
b620abe
bba190b
05616f4
b560b2e
52f720a
bfc081c
d8637b2
2924e4f
7499d01
65aba3d
566a2a0
7cc699c
f18a048
13d34c7
5f05e2e
13f8018
8f1211f
3e1d993
e6d3095
87f80bd
ad82d8f
227e6da
4f6a6eb
05515ec
7db4577
247fb5b
38538b9
ddb2146
fdcecd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,105 +19,12 @@ | |
"gasLimit": "5,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"status": "0", | ||
"message": "", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"txId": "unwrap-token", | ||
"tx": { | ||
"from": "address:user", | ||
"to": "sc:bridged_tokens_wrapper", | ||
"value": "0", | ||
"esdt": { | ||
"tokenIdentifier": "str:WUSDC-abcdef", | ||
"value": "100" | ||
}, | ||
"function": "unwrapToken", | ||
"arguments": [ | ||
"str:USDC-aaaaaa" | ||
], | ||
"gasLimit": "5,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"status": "4", | ||
"message": "str:Esdt token unavailable", | ||
"message": "str:Cannot blacklist token due to remaining liquidity", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "checkState", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this can be kept as it is, onyl the unwrap-token and the expect message is different, right ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct. Added the check |
||
"accounts": { | ||
"address:owner": { | ||
"nonce": "4", | ||
"balance": "0", | ||
"storage": {} | ||
}, | ||
"address:user": { | ||
"nonce": "5", | ||
"esdt": { | ||
"str:USDC-aaaaaa": { | ||
"balance": "200000000000000" | ||
}, | ||
"str:USDC-bbbbbb": { | ||
"balance": "500000000000000" | ||
}, | ||
"str:USDC-cccccc": { | ||
"balance": "400000000000000" | ||
}, | ||
"str:WUSDC-abcdef": { | ||
"balance": "900" | ||
} | ||
}, | ||
"storage": {} | ||
}, | ||
"sc:bridged_tokens_wrapper": { | ||
"nonce": "0", | ||
"esdt": { | ||
"str:WUSDC-abcdef": { | ||
"balance": "1", | ||
"roles": [ | ||
"ESDTRoleLocalMint", | ||
"ESDTRoleLocalBurn" | ||
] | ||
}, | ||
"str:WUSDC-uvwxyz": { | ||
"balance": "1", | ||
"roles": [ | ||
"ESDTRoleLocalMint", | ||
"ESDTRoleLocalBurn" | ||
] | ||
}, | ||
"str:USDC-aaaaaa": { | ||
"balance": "300000000000000" | ||
}, | ||
"str:USDC-cccccc": { | ||
"balance": "100000000000000" | ||
} | ||
}, | ||
"storage": { | ||
"str:chainSpecificTokenIds|nested:str:WUSDC-abcdef|str:.len": "1", | ||
"str:chainSpecificTokenIds|nested:str:WUSDC-abcdef|str:.index|nested:str:USDC-cccccc": "1", | ||
"str:chainSpecificTokenIds|nested:str:WUSDC-abcdef|str:.item|u32:1": "str:USDC-cccccc", | ||
"str:chainSpecificToUniversalMapping|nested:str:USDC-cccccc": "str:WUSDC-abcdef", | ||
"str:universalBridgedTokenIds.len": "1", | ||
"str:universalBridgedTokenIds.index|nested:str:WUSDC-abcdef": "1", | ||
"str:universalBridgedTokenIds.item|u32:1": "str:WUSDC-abcdef", | ||
"str:tokenLiquidity|nested:str:USDC-aaaaaa": "300000000000000", | ||
"str:tokenLiquidity|nested:str:USDC-cccccc": "100000000000000", | ||
"str:token_decimals_num|nested:str:WUSDC-abcdef": "6", | ||
"str:token_decimals_num|nested:str:USDC-cccccc": "18" | ||
}, | ||
"code": "file:../output/bridged-tokens-wrapper.wasm", | ||
"owner": "address:owner" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if i send empty endpoint and some arguments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the
if
statement would be executed and we wouldThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrote an integration test for this. Apparently, if I send this RAW SC call data
000000000000000002faf08000
(empty function and 50 mil gas limit) it does not refund the transfer. Good catch @dragos-rebegeaThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the condition to
Added unit test.