everx-labs / TVM-Solidity-Compiler

Solidity compiler for TVM
GNU General Public License v3.0
125 stars 72 forks source link

Bug: invalid abi.encode for lot of params #124

Closed FairyFromAlfeya closed 1 year ago

FairyFromAlfeya commented 1 year ago

Description:

abi.encode passes, but transaction reverts with code 7 after abi.decode (with valid types)

TvmCell:

Tuple (Tuple (124711402, 0, 0, 1666614155, 31787919000007, 31787919000007, 0, Tuple (2955743846, Null), Slice x8018dd1229cd5e8f662163fcd0876ec56085305d3537aca261aeedc985317b5710d_, Cell x0a9fb4949d9bd5a2633a2e375fe4e96fe962d55830edd84242b55e09376782b2 xcd4_, Cell xddf73f1108c1a2c69e415165f834139ee986c7a6840c496b4eb55fe23e0a1b33 x8aed5320e30320c0ffe30220c0fee302f20b), Null, 0, 0, Tuple (Null, -1, 10000000, Null, 0), Null, -1, Null, Null, Slice x80109d345cdd81be52021a54e306f3f0e6019effe0ed2929bf6c716efd3065d3745_, Slice x8000000000000000000000000000000000000000000000000000000000000000001_, Slice x8000000000000000000000000000000000000000000000000000000000000000001_, 0, Cell x96a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7 x, Cell x96a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7 x, 0, Slice x8000000000000000000000000000000000000000000000000000000000000000001_, Slice x8000000000000000000000000000000000000000000000000000000000000000001_, 0, 0, 0, 0, 0, 0, 0, 0, 0, Null, Null, Null, 0, 0, 0, 0, 0, 1000000000000000000, 1000000000000000000, 1666613441, 0, 0, Null, Null, Null, 0)

Transaction: d1381282ee1999a46186ab60aa4e900dd03cbd3f4b05f4d39b2f5e8d867a166e

Move around solution:

Pack some variables to structure and pass this structure to abi.encode & abi.decode

cryshado commented 1 year ago

@FairyFromAlfeya Thanks for the issue. If the problem is still relevant please create a new issue and attach a sample smart contract source code, message and script to reproduce the issue.