Closed BorisI closed 4 months ago
$ cat cksign.sol
pragma ton-solidity >= 0.74.0; contract cksign { function foo(uint a, bytes signature, uint pk) external pure returns (bool) { TvmBuilder bb; bb.store(a); return tvm.checkSign(bb.toSlice(), TvmSlice(signature), pk); } }
$ ever-cli -c etc/cksign.conf runx -m foo -- --a 0x78b5273b33b8874229fae2aaaa6ce9da0220bb352cbceb3ed0565a589aa5dd0a --signature 307837386235323733623333623838373432323966616532616161613663653964613032323062623335326362636562336564303536356135383961613564643061 --pk 0x23c360a02e649543250080cda562d22af35f587cfae711a765ee41e65a0379e7 Error: { "code": 414, "message": "Contract execution was terminated with error: fatal error, code 12, value: 0 .../ever-vm-87527072ab50ad1b/ef47923/src/executor/crypto.rs:153, exit code: -13 (fatal error).\n ... err: cannot load signature signature error
Hello! It's fixed if GlobalCapabilities::CapsTvmBugfixes2022 capability is set. https://github.com/everx-labs/ever-vm/blob/master/src/executor/crypto.rs#L141
GlobalCapabilities::CapsTvmBugfixes2022
$ cat cksign.sol
pragma ton-solidity >= 0.74.0; contract cksign { function foo(uint a, bytes signature, uint pk) external pure returns (bool) { TvmBuilder bb; bb.store(a); return tvm.checkSign(bb.toSlice(), TvmSlice(signature), pk); } }
$ ever-cli -c etc/cksign.conf runx -m foo -- --a 0x78b5273b33b8874229fae2aaaa6ce9da0220bb352cbceb3ed0565a589aa5dd0a --signature 307837386235323733623333623838373432323966616532616161613663653964613032323062623335326362636562336564303536356135383961613564643061 --pk 0x23c360a02e649543250080cda562d22af35f587cfae711a765ee41e65a0379e7 Error: { "code": 414, "message": "Contract execution was terminated with error: fatal error, code 12, value: 0 .../ever-vm-87527072ab50ad1b/ef47923/src/executor/crypto.rs:153, exit code: -13 (fatal error).\n ... err: cannot load signature signature error