Skip to content
This repository was archived by the owner on Jan 5, 2019. It is now read-only.

Commit 4327ad3

Browse files
committed
Do not charge gas for interface methods
1 parent a9b26e9 commit 4327ad3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ exports.evm2wast = function (evmCode, opts = {
189189
if (opts.chargePerOp) {
190190
segment += `(call $useGas (i64.const ${op.fee})) `
191191
}
192-
gasCount += op.fee
192+
// do not charge gas for interface methods
193+
// TODO: implement proper gas charging and enable this here
194+
if (opint < 0x30 || (opint > 0x45 && opint < 0xa0)) {
195+
gasCount += op.fee
196+
}
193197

194198
segmentStackDeta += op.on
195199
if (segmentStackDeta > segmentStackHigh) {

0 commit comments

Comments
 (0)