@feelyourprotocol/evm 8141.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/README.md +690 -0
- package/dist/cjs/binaryTreeAccessWitness.d.ts +61 -0
- package/dist/cjs/binaryTreeAccessWitness.d.ts.map +1 -0
- package/dist/cjs/binaryTreeAccessWitness.js +314 -0
- package/dist/cjs/binaryTreeAccessWitness.js.map +1 -0
- package/dist/cjs/chunkCache.d.ts +13 -0
- package/dist/cjs/chunkCache.d.ts.map +1 -0
- package/dist/cjs/chunkCache.js +30 -0
- package/dist/cjs/chunkCache.js.map +1 -0
- package/dist/cjs/constructors.d.ts +11 -0
- package/dist/cjs/constructors.d.ts.map +1 -0
- package/dist/cjs/constructors.js +30 -0
- package/dist/cjs/constructors.js.map +1 -0
- package/dist/cjs/eip7708.d.ts +24 -0
- package/dist/cjs/eip7708.d.ts.map +1 -0
- package/dist/cjs/eip7708.js +37 -0
- package/dist/cjs/eip7708.js.map +1 -0
- package/dist/cjs/eof/constants.d.ts +22 -0
- package/dist/cjs/eof/constants.d.ts.map +1 -0
- package/dist/cjs/eof/constants.js +31 -0
- package/dist/cjs/eof/constants.js.map +1 -0
- package/dist/cjs/eof/container.d.ts +87 -0
- package/dist/cjs/eof/container.d.ts.map +1 -0
- package/dist/cjs/eof/container.js +380 -0
- package/dist/cjs/eof/container.js.map +1 -0
- package/dist/cjs/eof/errors.d.ts +66 -0
- package/dist/cjs/eof/errors.d.ts.map +1 -0
- package/dist/cjs/eof/errors.js +200 -0
- package/dist/cjs/eof/errors.js.map +1 -0
- package/dist/cjs/eof/setup.d.ts +9 -0
- package/dist/cjs/eof/setup.d.ts.map +1 -0
- package/dist/cjs/eof/setup.js +26 -0
- package/dist/cjs/eof/setup.js.map +1 -0
- package/dist/cjs/eof/stackDelta.d.ts +10 -0
- package/dist/cjs/eof/stackDelta.d.ts.map +1 -0
- package/dist/cjs/eof/stackDelta.js +164 -0
- package/dist/cjs/eof/stackDelta.js.map +1 -0
- package/dist/cjs/eof/util.d.ts +8 -0
- package/dist/cjs/eof/util.d.ts.map +1 -0
- package/dist/cjs/eof/util.js +18 -0
- package/dist/cjs/eof/util.js.map +1 -0
- package/dist/cjs/eof/verify.d.ts +38 -0
- package/dist/cjs/eof/verify.d.ts.map +1 -0
- package/dist/cjs/eof/verify.js +436 -0
- package/dist/cjs/eof/verify.js.map +1 -0
- package/dist/cjs/errors.d.ts +40 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +43 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/evm.d.ts +181 -0
- package/dist/cjs/evm.d.ts.map +1 -0
- package/dist/cjs/evm.js +1142 -0
- package/dist/cjs/evm.js.map +1 -0
- package/dist/cjs/frameContext.d.ts +50 -0
- package/dist/cjs/frameContext.d.ts.map +1 -0
- package/dist/cjs/frameContext.js +17 -0
- package/dist/cjs/frameContext.js.map +1 -0
- package/dist/cjs/index.d.ts +18 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +43 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interpreter.d.ts +361 -0
- package/dist/cjs/interpreter.d.ts.map +1 -0
- package/dist/cjs/interpreter.js +1057 -0
- package/dist/cjs/interpreter.js.map +1 -0
- package/dist/cjs/journal.d.ts +69 -0
- package/dist/cjs/journal.d.ts.map +1 -0
- package/dist/cjs/journal.js +247 -0
- package/dist/cjs/journal.js.map +1 -0
- package/dist/cjs/logger.d.ts +38 -0
- package/dist/cjs/logger.d.ts.map +1 -0
- package/dist/cjs/logger.js +126 -0
- package/dist/cjs/logger.js.map +1 -0
- package/dist/cjs/memory.d.ts +29 -0
- package/dist/cjs/memory.d.ts.map +1 -0
- package/dist/cjs/memory.js +75 -0
- package/dist/cjs/memory.js.map +1 -0
- package/dist/cjs/message.d.ts +70 -0
- package/dist/cjs/message.d.ts.map +1 -0
- package/dist/cjs/message.js +51 -0
- package/dist/cjs/message.js.map +1 -0
- package/dist/cjs/opcodes/EIP1283.d.ts +13 -0
- package/dist/cjs/opcodes/EIP1283.d.ts.map +1 -0
- package/dist/cjs/opcodes/EIP1283.js +58 -0
- package/dist/cjs/opcodes/EIP1283.js.map +1 -0
- package/dist/cjs/opcodes/EIP2200.d.ts +13 -0
- package/dist/cjs/opcodes/EIP2200.d.ts.map +1 -0
- package/dist/cjs/opcodes/EIP2200.js +64 -0
- package/dist/cjs/opcodes/EIP2200.js.map +1 -0
- package/dist/cjs/opcodes/EIP2929.d.ts +68 -0
- package/dist/cjs/opcodes/EIP2929.d.ts.map +1 -0
- package/dist/cjs/opcodes/EIP2929.js +146 -0
- package/dist/cjs/opcodes/EIP2929.js.map +1 -0
- package/dist/cjs/opcodes/codes.d.ts +45 -0
- package/dist/cjs/opcodes/codes.d.ts.map +1 -0
- package/dist/cjs/opcodes/codes.js +453 -0
- package/dist/cjs/opcodes/codes.js.map +1 -0
- package/dist/cjs/opcodes/functions.d.ts +11 -0
- package/dist/cjs/opcodes/functions.d.ts.map +1 -0
- package/dist/cjs/opcodes/functions.js +1778 -0
- package/dist/cjs/opcodes/functions.js.map +1 -0
- package/dist/cjs/opcodes/gas.d.ts +15 -0
- package/dist/cjs/opcodes/gas.d.ts.map +1 -0
- package/dist/cjs/opcodes/gas.js +1016 -0
- package/dist/cjs/opcodes/gas.js.map +1 -0
- package/dist/cjs/opcodes/index.d.ts +4 -0
- package/dist/cjs/opcodes/index.d.ts.map +1 -0
- package/dist/cjs/opcodes/index.js +20 -0
- package/dist/cjs/opcodes/index.js.map +1 -0
- package/dist/cjs/opcodes/util.d.ts +86 -0
- package/dist/cjs/opcodes/util.d.ts.map +1 -0
- package/dist/cjs/opcodes/util.js +281 -0
- package/dist/cjs/opcodes/util.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/params.d.ts +3 -0
- package/dist/cjs/params.d.ts.map +1 -0
- package/dist/cjs/params.js +424 -0
- package/dist/cjs/params.js.map +1 -0
- package/dist/cjs/precompiles/01-ecrecover.d.ts +4 -0
- package/dist/cjs/precompiles/01-ecrecover.d.ts.map +1 -0
- package/dist/cjs/precompiles/01-ecrecover.js +58 -0
- package/dist/cjs/precompiles/01-ecrecover.js.map +1 -0
- package/dist/cjs/precompiles/02-sha256.d.ts +4 -0
- package/dist/cjs/precompiles/02-sha256.d.ts.map +1 -0
- package/dist/cjs/precompiles/02-sha256.js +27 -0
- package/dist/cjs/precompiles/02-sha256.js.map +1 -0
- package/dist/cjs/precompiles/03-ripemd160.d.ts +4 -0
- package/dist/cjs/precompiles/03-ripemd160.d.ts.map +1 -0
- package/dist/cjs/precompiles/03-ripemd160.js +26 -0
- package/dist/cjs/precompiles/03-ripemd160.js.map +1 -0
- package/dist/cjs/precompiles/04-identity.d.ts +4 -0
- package/dist/cjs/precompiles/04-identity.d.ts.map +1 -0
- package/dist/cjs/precompiles/04-identity.js +24 -0
- package/dist/cjs/precompiles/04-identity.js.map +1 -0
- package/dist/cjs/precompiles/05-modexp.d.ts +5 -0
- package/dist/cjs/precompiles/05-modexp.d.ts.map +1 -0
- package/dist/cjs/precompiles/05-modexp.js +185 -0
- package/dist/cjs/precompiles/05-modexp.js.map +1 -0
- package/dist/cjs/precompiles/06-bn254-add.d.ts +4 -0
- package/dist/cjs/precompiles/06-bn254-add.d.ts.map +1 -0
- package/dist/cjs/precompiles/06-bn254-add.js +42 -0
- package/dist/cjs/precompiles/06-bn254-add.js.map +1 -0
- package/dist/cjs/precompiles/07-bn254-mul.d.ts +4 -0
- package/dist/cjs/precompiles/07-bn254-mul.d.ts.map +1 -0
- package/dist/cjs/precompiles/07-bn254-mul.js +43 -0
- package/dist/cjs/precompiles/07-bn254-mul.js.map +1 -0
- package/dist/cjs/precompiles/08-bn254-pairing.d.ts +4 -0
- package/dist/cjs/precompiles/08-bn254-pairing.d.ts.map +1 -0
- package/dist/cjs/precompiles/08-bn254-pairing.js +45 -0
- package/dist/cjs/precompiles/08-bn254-pairing.js.map +1 -0
- package/dist/cjs/precompiles/09-blake2f.d.ts +5 -0
- package/dist/cjs/precompiles/09-blake2f.d.ts.map +1 -0
- package/dist/cjs/precompiles/09-blake2f.js +201 -0
- package/dist/cjs/precompiles/09-blake2f.js.map +1 -0
- package/dist/cjs/precompiles/0a-kzg-point-evaluation.d.ts +5 -0
- package/dist/cjs/precompiles/0a-kzg-point-evaluation.d.ts.map +1 -0
- package/dist/cjs/precompiles/0a-kzg-point-evaluation.js +68 -0
- package/dist/cjs/precompiles/0a-kzg-point-evaluation.js.map +1 -0
- package/dist/cjs/precompiles/0b-bls12-g1add.d.ts +4 -0
- package/dist/cjs/precompiles/0b-bls12-g1add.d.ts.map +1 -0
- package/dist/cjs/precompiles/0b-bls12-g1add.js +49 -0
- package/dist/cjs/precompiles/0b-bls12-g1add.js.map +1 -0
- package/dist/cjs/precompiles/0c-bls12-g1msm.d.ts +4 -0
- package/dist/cjs/precompiles/0c-bls12-g1msm.d.ts.map +1 -0
- package/dist/cjs/precompiles/0c-bls12-g1msm.js +62 -0
- package/dist/cjs/precompiles/0c-bls12-g1msm.js.map +1 -0
- package/dist/cjs/precompiles/0d-bls12-g2add.d.ts +4 -0
- package/dist/cjs/precompiles/0d-bls12-g2add.d.ts.map +1 -0
- package/dist/cjs/precompiles/0d-bls12-g2add.js +51 -0
- package/dist/cjs/precompiles/0d-bls12-g2add.js.map +1 -0
- package/dist/cjs/precompiles/0e-bls12-g2msm.d.ts +4 -0
- package/dist/cjs/precompiles/0e-bls12-g2msm.d.ts.map +1 -0
- package/dist/cjs/precompiles/0e-bls12-g2msm.js +60 -0
- package/dist/cjs/precompiles/0e-bls12-g2msm.js.map +1 -0
- package/dist/cjs/precompiles/0f-bls12-pairing.d.ts +4 -0
- package/dist/cjs/precompiles/0f-bls12-pairing.d.ts.map +1 -0
- package/dist/cjs/precompiles/0f-bls12-pairing.js +66 -0
- package/dist/cjs/precompiles/0f-bls12-pairing.js.map +1 -0
- package/dist/cjs/precompiles/10-bls12-map-fp-to-g1.d.ts +4 -0
- package/dist/cjs/precompiles/10-bls12-map-fp-to-g1.d.ts.map +1 -0
- package/dist/cjs/precompiles/10-bls12-map-fp-to-g1.js +44 -0
- package/dist/cjs/precompiles/10-bls12-map-fp-to-g1.js.map +1 -0
- package/dist/cjs/precompiles/100-p256verify.d.ts +4 -0
- package/dist/cjs/precompiles/100-p256verify.d.ts.map +1 -0
- package/dist/cjs/precompiles/100-p256verify.js +131 -0
- package/dist/cjs/precompiles/100-p256verify.js.map +1 -0
- package/dist/cjs/precompiles/11-bls12-map-fp2-to-g2.d.ts +4 -0
- package/dist/cjs/precompiles/11-bls12-map-fp2-to-g2.d.ts.map +1 -0
- package/dist/cjs/precompiles/11-bls12-map-fp2-to-g2.js +47 -0
- package/dist/cjs/precompiles/11-bls12-map-fp2-to-g2.js.map +1 -0
- package/dist/cjs/precompiles/bls12_381/constants.d.ts +10 -0
- package/dist/cjs/precompiles/bls12_381/constants.d.ts.map +1 -0
- package/dist/cjs/precompiles/bls12_381/constants.js +274 -0
- package/dist/cjs/precompiles/bls12_381/constants.js.map +1 -0
- package/dist/cjs/precompiles/bls12_381/index.d.ts +5 -0
- package/dist/cjs/precompiles/bls12_381/index.d.ts.map +1 -0
- package/dist/cjs/precompiles/bls12_381/index.js +24 -0
- package/dist/cjs/precompiles/bls12_381/index.js.map +1 -0
- package/dist/cjs/precompiles/bls12_381/mcl.d.ts +45 -0
- package/dist/cjs/precompiles/bls12_381/mcl.d.ts.map +1 -0
- package/dist/cjs/precompiles/bls12_381/mcl.js +264 -0
- package/dist/cjs/precompiles/bls12_381/mcl.js.map +1 -0
- package/dist/cjs/precompiles/bls12_381/noble.d.ts +39 -0
- package/dist/cjs/precompiles/bls12_381/noble.d.ts.map +1 -0
- package/dist/cjs/precompiles/bls12_381/noble.js +228 -0
- package/dist/cjs/precompiles/bls12_381/noble.js.map +1 -0
- package/dist/cjs/precompiles/bls12_381/util.d.ts +35 -0
- package/dist/cjs/precompiles/bls12_381/util.d.ts.map +1 -0
- package/dist/cjs/precompiles/bls12_381/util.js +68 -0
- package/dist/cjs/precompiles/bls12_381/util.js.map +1 -0
- package/dist/cjs/precompiles/bn254/index.d.ts +3 -0
- package/dist/cjs/precompiles/bn254/index.d.ts.map +1 -0
- package/dist/cjs/precompiles/bn254/index.js +8 -0
- package/dist/cjs/precompiles/bn254/index.js.map +1 -0
- package/dist/cjs/precompiles/bn254/noble.d.ts +13 -0
- package/dist/cjs/precompiles/bn254/noble.d.ts.map +1 -0
- package/dist/cjs/precompiles/bn254/noble.js +124 -0
- package/dist/cjs/precompiles/bn254/noble.js.map +1 -0
- package/dist/cjs/precompiles/bn254/rustbn.d.ts +16 -0
- package/dist/cjs/precompiles/bn254/rustbn.d.ts.map +1 -0
- package/dist/cjs/precompiles/bn254/rustbn.js +33 -0
- package/dist/cjs/precompiles/bn254/rustbn.js.map +1 -0
- package/dist/cjs/precompiles/index.d.ts +67 -0
- package/dist/cjs/precompiles/index.d.ts.map +1 -0
- package/dist/cjs/precompiles/index.js +262 -0
- package/dist/cjs/precompiles/index.js.map +1 -0
- package/dist/cjs/precompiles/types.d.ts +13 -0
- package/dist/cjs/precompiles/types.d.ts.map +1 -0
- package/dist/cjs/precompiles/types.js +3 -0
- package/dist/cjs/precompiles/types.js.map +1 -0
- package/dist/cjs/precompiles/util.d.ts +30 -0
- package/dist/cjs/precompiles/util.d.ts.map +1 -0
- package/dist/cjs/precompiles/util.js +63 -0
- package/dist/cjs/precompiles/util.js.map +1 -0
- package/dist/cjs/stack.d.ts +55 -0
- package/dist/cjs/stack.d.ts.map +1 -0
- package/dist/cjs/stack.js +143 -0
- package/dist/cjs/stack.js.map +1 -0
- package/dist/cjs/stemCache.d.ts +20 -0
- package/dist/cjs/stemCache.d.ts.map +1 -0
- package/dist/cjs/stemCache.js +37 -0
- package/dist/cjs/stemCache.js.map +1 -0
- package/dist/cjs/transientStorage.d.ts +54 -0
- package/dist/cjs/transientStorage.d.ts.map +1 -0
- package/dist/cjs/transientStorage.js +113 -0
- package/dist/cjs/transientStorage.js.map +1 -0
- package/dist/cjs/types.d.ts +465 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +28 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/binaryTreeAccessWitness.d.ts +61 -0
- package/dist/esm/binaryTreeAccessWitness.d.ts.map +1 -0
- package/dist/esm/binaryTreeAccessWitness.js +308 -0
- package/dist/esm/binaryTreeAccessWitness.js.map +1 -0
- package/dist/esm/chunkCache.d.ts +13 -0
- package/dist/esm/chunkCache.d.ts.map +1 -0
- package/dist/esm/chunkCache.js +26 -0
- package/dist/esm/chunkCache.js.map +1 -0
- package/dist/esm/constructors.d.ts +11 -0
- package/dist/esm/constructors.d.ts.map +1 -0
- package/dist/esm/constructors.js +27 -0
- package/dist/esm/constructors.js.map +1 -0
- package/dist/esm/eip7708.d.ts +24 -0
- package/dist/esm/eip7708.d.ts.map +1 -0
- package/dist/esm/eip7708.js +32 -0
- package/dist/esm/eip7708.js.map +1 -0
- package/dist/esm/eof/constants.d.ts +22 -0
- package/dist/esm/eof/constants.d.ts.map +1 -0
- package/dist/esm/eof/constants.js +28 -0
- package/dist/esm/eof/constants.js.map +1 -0
- package/dist/esm/eof/container.d.ts +87 -0
- package/dist/esm/eof/container.d.ts.map +1 -0
- package/dist/esm/eof/container.js +375 -0
- package/dist/esm/eof/container.js.map +1 -0
- package/dist/esm/eof/errors.d.ts +66 -0
- package/dist/esm/eof/errors.d.ts.map +1 -0
- package/dist/esm/eof/errors.js +195 -0
- package/dist/esm/eof/errors.js.map +1 -0
- package/dist/esm/eof/setup.d.ts +9 -0
- package/dist/esm/eof/setup.d.ts.map +1 -0
- package/dist/esm/eof/setup.js +23 -0
- package/dist/esm/eof/setup.js.map +1 -0
- package/dist/esm/eof/stackDelta.d.ts +10 -0
- package/dist/esm/eof/stackDelta.d.ts.map +1 -0
- package/dist/esm/eof/stackDelta.js +161 -0
- package/dist/esm/eof/stackDelta.js.map +1 -0
- package/dist/esm/eof/util.d.ts +8 -0
- package/dist/esm/eof/util.d.ts.map +1 -0
- package/dist/esm/eof/util.js +14 -0
- package/dist/esm/eof/util.js.map +1 -0
- package/dist/esm/eof/verify.d.ts +38 -0
- package/dist/esm/eof/verify.d.ts.map +1 -0
- package/dist/esm/eof/verify.js +432 -0
- package/dist/esm/eof/verify.js.map +1 -0
- package/dist/esm/errors.d.ts +40 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +39 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/evm.d.ts +181 -0
- package/dist/esm/evm.d.ts.map +1 -0
- package/dist/esm/evm.js +1131 -0
- package/dist/esm/evm.js.map +1 -0
- package/dist/esm/frameContext.d.ts +50 -0
- package/dist/esm/frameContext.d.ts.map +1 -0
- package/dist/esm/frameContext.js +14 -0
- package/dist/esm/frameContext.js.map +1 -0
- package/dist/esm/index.d.ts +18 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interpreter.d.ts +361 -0
- package/dist/esm/interpreter.d.ts.map +1 -0
- package/dist/esm/interpreter.js +1054 -0
- package/dist/esm/interpreter.js.map +1 -0
- package/dist/esm/journal.d.ts +69 -0
- package/dist/esm/journal.d.ts.map +1 -0
- package/dist/esm/journal.js +243 -0
- package/dist/esm/journal.js.map +1 -0
- package/dist/esm/logger.d.ts +38 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +121 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/memory.d.ts +29 -0
- package/dist/esm/memory.d.ts.map +1 -0
- package/dist/esm/memory.js +71 -0
- package/dist/esm/memory.js.map +1 -0
- package/dist/esm/message.d.ts +70 -0
- package/dist/esm/message.d.ts.map +1 -0
- package/dist/esm/message.js +47 -0
- package/dist/esm/message.js.map +1 -0
- package/dist/esm/opcodes/EIP1283.d.ts +13 -0
- package/dist/esm/opcodes/EIP1283.d.ts.map +1 -0
- package/dist/esm/opcodes/EIP1283.js +55 -0
- package/dist/esm/opcodes/EIP1283.js.map +1 -0
- package/dist/esm/opcodes/EIP2200.d.ts +13 -0
- package/dist/esm/opcodes/EIP2200.d.ts.map +1 -0
- package/dist/esm/opcodes/EIP2200.js +61 -0
- package/dist/esm/opcodes/EIP2200.js.map +1 -0
- package/dist/esm/opcodes/EIP2929.d.ts +68 -0
- package/dist/esm/opcodes/EIP2929.d.ts.map +1 -0
- package/dist/esm/opcodes/EIP2929.js +138 -0
- package/dist/esm/opcodes/EIP2929.js.map +1 -0
- package/dist/esm/opcodes/codes.d.ts +45 -0
- package/dist/esm/opcodes/codes.d.ts.map +1 -0
- package/dist/esm/opcodes/codes.js +448 -0
- package/dist/esm/opcodes/codes.js.map +1 -0
- package/dist/esm/opcodes/functions.d.ts +11 -0
- package/dist/esm/opcodes/functions.d.ts.map +1 -0
- package/dist/esm/opcodes/functions.js +1775 -0
- package/dist/esm/opcodes/functions.js.map +1 -0
- package/dist/esm/opcodes/gas.d.ts +15 -0
- package/dist/esm/opcodes/gas.d.ts.map +1 -0
- package/dist/esm/opcodes/gas.js +1013 -0
- package/dist/esm/opcodes/gas.js.map +1 -0
- package/dist/esm/opcodes/index.d.ts +4 -0
- package/dist/esm/opcodes/index.d.ts.map +1 -0
- package/dist/esm/opcodes/index.js +4 -0
- package/dist/esm/opcodes/index.js.map +1 -0
- package/dist/esm/opcodes/util.d.ts +86 -0
- package/dist/esm/opcodes/util.d.ts.map +1 -0
- package/dist/esm/opcodes/util.js +257 -0
- package/dist/esm/opcodes/util.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/params.d.ts +3 -0
- package/dist/esm/params.d.ts.map +1 -0
- package/dist/esm/params.js +421 -0
- package/dist/esm/params.js.map +1 -0
- package/dist/esm/precompiles/01-ecrecover.d.ts +4 -0
- package/dist/esm/precompiles/01-ecrecover.d.ts.map +1 -0
- package/dist/esm/precompiles/01-ecrecover.js +55 -0
- package/dist/esm/precompiles/01-ecrecover.js.map +1 -0
- package/dist/esm/precompiles/02-sha256.d.ts +4 -0
- package/dist/esm/precompiles/02-sha256.d.ts.map +1 -0
- package/dist/esm/precompiles/02-sha256.js +24 -0
- package/dist/esm/precompiles/02-sha256.js.map +1 -0
- package/dist/esm/precompiles/03-ripemd160.d.ts +4 -0
- package/dist/esm/precompiles/03-ripemd160.d.ts.map +1 -0
- package/dist/esm/precompiles/03-ripemd160.js +23 -0
- package/dist/esm/precompiles/03-ripemd160.js.map +1 -0
- package/dist/esm/precompiles/04-identity.d.ts +4 -0
- package/dist/esm/precompiles/04-identity.d.ts.map +1 -0
- package/dist/esm/precompiles/04-identity.js +21 -0
- package/dist/esm/precompiles/04-identity.js.map +1 -0
- package/dist/esm/precompiles/05-modexp.d.ts +5 -0
- package/dist/esm/precompiles/05-modexp.d.ts.map +1 -0
- package/dist/esm/precompiles/05-modexp.js +181 -0
- package/dist/esm/precompiles/05-modexp.js.map +1 -0
- package/dist/esm/precompiles/06-bn254-add.d.ts +4 -0
- package/dist/esm/precompiles/06-bn254-add.d.ts.map +1 -0
- package/dist/esm/precompiles/06-bn254-add.js +39 -0
- package/dist/esm/precompiles/06-bn254-add.js.map +1 -0
- package/dist/esm/precompiles/07-bn254-mul.d.ts +4 -0
- package/dist/esm/precompiles/07-bn254-mul.d.ts.map +1 -0
- package/dist/esm/precompiles/07-bn254-mul.js +40 -0
- package/dist/esm/precompiles/07-bn254-mul.js.map +1 -0
- package/dist/esm/precompiles/08-bn254-pairing.d.ts +4 -0
- package/dist/esm/precompiles/08-bn254-pairing.d.ts.map +1 -0
- package/dist/esm/precompiles/08-bn254-pairing.js +42 -0
- package/dist/esm/precompiles/08-bn254-pairing.js.map +1 -0
- package/dist/esm/precompiles/09-blake2f.d.ts +5 -0
- package/dist/esm/precompiles/09-blake2f.d.ts.map +1 -0
- package/dist/esm/precompiles/09-blake2f.js +197 -0
- package/dist/esm/precompiles/09-blake2f.js.map +1 -0
- package/dist/esm/precompiles/0a-kzg-point-evaluation.d.ts +5 -0
- package/dist/esm/precompiles/0a-kzg-point-evaluation.d.ts.map +1 -0
- package/dist/esm/precompiles/0a-kzg-point-evaluation.js +64 -0
- package/dist/esm/precompiles/0a-kzg-point-evaluation.js.map +1 -0
- package/dist/esm/precompiles/0b-bls12-g1add.d.ts +4 -0
- package/dist/esm/precompiles/0b-bls12-g1add.d.ts.map +1 -0
- package/dist/esm/precompiles/0b-bls12-g1add.js +46 -0
- package/dist/esm/precompiles/0b-bls12-g1add.js.map +1 -0
- package/dist/esm/precompiles/0c-bls12-g1msm.d.ts +4 -0
- package/dist/esm/precompiles/0c-bls12-g1msm.d.ts.map +1 -0
- package/dist/esm/precompiles/0c-bls12-g1msm.js +59 -0
- package/dist/esm/precompiles/0c-bls12-g1msm.js.map +1 -0
- package/dist/esm/precompiles/0d-bls12-g2add.d.ts +4 -0
- package/dist/esm/precompiles/0d-bls12-g2add.d.ts.map +1 -0
- package/dist/esm/precompiles/0d-bls12-g2add.js +48 -0
- package/dist/esm/precompiles/0d-bls12-g2add.js.map +1 -0
- package/dist/esm/precompiles/0e-bls12-g2msm.d.ts +4 -0
- package/dist/esm/precompiles/0e-bls12-g2msm.d.ts.map +1 -0
- package/dist/esm/precompiles/0e-bls12-g2msm.js +57 -0
- package/dist/esm/precompiles/0e-bls12-g2msm.js.map +1 -0
- package/dist/esm/precompiles/0f-bls12-pairing.d.ts +4 -0
- package/dist/esm/precompiles/0f-bls12-pairing.d.ts.map +1 -0
- package/dist/esm/precompiles/0f-bls12-pairing.js +63 -0
- package/dist/esm/precompiles/0f-bls12-pairing.js.map +1 -0
- package/dist/esm/precompiles/10-bls12-map-fp-to-g1.d.ts +4 -0
- package/dist/esm/precompiles/10-bls12-map-fp-to-g1.d.ts.map +1 -0
- package/dist/esm/precompiles/10-bls12-map-fp-to-g1.js +41 -0
- package/dist/esm/precompiles/10-bls12-map-fp-to-g1.js.map +1 -0
- package/dist/esm/precompiles/100-p256verify.d.ts +4 -0
- package/dist/esm/precompiles/100-p256verify.d.ts.map +1 -0
- package/dist/esm/precompiles/100-p256verify.js +128 -0
- package/dist/esm/precompiles/100-p256verify.js.map +1 -0
- package/dist/esm/precompiles/11-bls12-map-fp2-to-g2.d.ts +4 -0
- package/dist/esm/precompiles/11-bls12-map-fp2-to-g2.d.ts.map +1 -0
- package/dist/esm/precompiles/11-bls12-map-fp2-to-g2.js +44 -0
- package/dist/esm/precompiles/11-bls12-map-fp2-to-g2.js.map +1 -0
- package/dist/esm/precompiles/bls12_381/constants.d.ts +10 -0
- package/dist/esm/precompiles/bls12_381/constants.d.ts.map +1 -0
- package/dist/esm/precompiles/bls12_381/constants.js +271 -0
- package/dist/esm/precompiles/bls12_381/constants.js.map +1 -0
- package/dist/esm/precompiles/bls12_381/index.d.ts +5 -0
- package/dist/esm/precompiles/bls12_381/index.d.ts.map +1 -0
- package/dist/esm/precompiles/bls12_381/index.js +5 -0
- package/dist/esm/precompiles/bls12_381/index.js.map +1 -0
- package/dist/esm/precompiles/bls12_381/mcl.d.ts +45 -0
- package/dist/esm/precompiles/bls12_381/mcl.d.ts.map +1 -0
- package/dist/esm/precompiles/bls12_381/mcl.js +254 -0
- package/dist/esm/precompiles/bls12_381/mcl.js.map +1 -0
- package/dist/esm/precompiles/bls12_381/noble.d.ts +39 -0
- package/dist/esm/precompiles/bls12_381/noble.d.ts.map +1 -0
- package/dist/esm/precompiles/bls12_381/noble.js +218 -0
- package/dist/esm/precompiles/bls12_381/noble.js.map +1 -0
- package/dist/esm/precompiles/bls12_381/util.d.ts +35 -0
- package/dist/esm/precompiles/bls12_381/util.d.ts.map +1 -0
- package/dist/esm/precompiles/bls12_381/util.js +63 -0
- package/dist/esm/precompiles/bls12_381/util.js.map +1 -0
- package/dist/esm/precompiles/bn254/index.d.ts +3 -0
- package/dist/esm/precompiles/bn254/index.d.ts.map +1 -0
- package/dist/esm/precompiles/bn254/index.js +3 -0
- package/dist/esm/precompiles/bn254/index.js.map +1 -0
- package/dist/esm/precompiles/bn254/noble.d.ts +13 -0
- package/dist/esm/precompiles/bn254/noble.d.ts.map +1 -0
- package/dist/esm/precompiles/bn254/noble.js +120 -0
- package/dist/esm/precompiles/bn254/noble.js.map +1 -0
- package/dist/esm/precompiles/bn254/rustbn.d.ts +16 -0
- package/dist/esm/precompiles/bn254/rustbn.d.ts.map +1 -0
- package/dist/esm/precompiles/bn254/rustbn.js +29 -0
- package/dist/esm/precompiles/bn254/rustbn.js.map +1 -0
- package/dist/esm/precompiles/index.d.ts +67 -0
- package/dist/esm/precompiles/index.d.ts.map +1 -0
- package/dist/esm/precompiles/index.js +251 -0
- package/dist/esm/precompiles/index.js.map +1 -0
- package/dist/esm/precompiles/types.d.ts +13 -0
- package/dist/esm/precompiles/types.d.ts.map +1 -0
- package/dist/esm/precompiles/types.js +2 -0
- package/dist/esm/precompiles/types.js.map +1 -0
- package/dist/esm/precompiles/util.d.ts +30 -0
- package/dist/esm/precompiles/util.d.ts.map +1 -0
- package/dist/esm/precompiles/util.js +57 -0
- package/dist/esm/precompiles/util.js.map +1 -0
- package/dist/esm/stack.d.ts +55 -0
- package/dist/esm/stack.d.ts.map +1 -0
- package/dist/esm/stack.js +139 -0
- package/dist/esm/stack.js.map +1 -0
- package/dist/esm/stemCache.d.ts +20 -0
- package/dist/esm/stemCache.d.ts.map +1 -0
- package/dist/esm/stemCache.js +33 -0
- package/dist/esm/stemCache.js.map +1 -0
- package/dist/esm/transientStorage.d.ts +54 -0
- package/dist/esm/transientStorage.d.ts.map +1 -0
- package/dist/esm/transientStorage.js +109 -0
- package/dist/esm/transientStorage.js.map +1 -0
- package/dist/esm/types.d.ts +465 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +23 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/tsconfig.prod.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.prod.esm.tsbuildinfo +1 -0
- package/package.json +98 -0
- package/src/binaryTreeAccessWitness.ts +447 -0
- package/src/chunkCache.ts +36 -0
- package/src/constructors.ts +35 -0
- package/src/eip7708.ts +47 -0
- package/src/eof/constants.ts +36 -0
- package/src/eof/container.ts +495 -0
- package/src/eof/errors.ts +214 -0
- package/src/eof/setup.ts +27 -0
- package/src/eof/stackDelta.ts +169 -0
- package/src/eof/util.ts +16 -0
- package/src/eof/verify.ts +531 -0
- package/src/errors.ts +45 -0
- package/src/evm.ts +1415 -0
- package/src/frameContext.ts +56 -0
- package/src/index.ts +75 -0
- package/src/interpreter.ts +1437 -0
- package/src/journal.ts +317 -0
- package/src/logger.ts +180 -0
- package/src/memory.ts +82 -0
- package/src/message.ts +114 -0
- package/src/opcodes/EIP1283.ts +77 -0
- package/src/opcodes/EIP2200.ts +87 -0
- package/src/opcodes/EIP2929.ts +173 -0
- package/src/opcodes/codes.ts +528 -0
- package/src/opcodes/functions.ts +1937 -0
- package/src/opcodes/gas.ts +1329 -0
- package/src/opcodes/index.ts +3 -0
- package/src/opcodes/util.ts +313 -0
- package/src/params.ts +423 -0
- package/src/precompiles/01-ecrecover.ts +77 -0
- package/src/precompiles/02-sha256.ts +32 -0
- package/src/precompiles/03-ripemd160.ts +32 -0
- package/src/precompiles/04-identity.ts +29 -0
- package/src/precompiles/05-modexp.ts +215 -0
- package/src/precompiles/06-bn254-add.ts +49 -0
- package/src/precompiles/07-bn254-mul.ts +50 -0
- package/src/precompiles/08-bn254-pairing.ts +54 -0
- package/src/precompiles/09-blake2f.ts +243 -0
- package/src/precompiles/0a-kzg-point-evaluation.ts +94 -0
- package/src/precompiles/0b-bls12-g1add.ts +63 -0
- package/src/precompiles/0c-bls12-g1msm.ts +87 -0
- package/src/precompiles/0d-bls12-g2add.ts +66 -0
- package/src/precompiles/0e-bls12-g2msm.ts +84 -0
- package/src/precompiles/0f-bls12-pairing.ts +86 -0
- package/src/precompiles/10-bls12-map-fp-to-g1.ts +58 -0
- package/src/precompiles/100-p256verify.ts +152 -0
- package/src/precompiles/11-bls12-map-fp2-to-g2.ts +61 -0
- package/src/precompiles/bls12_381/constants.ts +278 -0
- package/src/precompiles/bls12_381/index.ts +4 -0
- package/src/precompiles/bls12_381/mcl.ts +376 -0
- package/src/precompiles/bls12_381/noble.ts +307 -0
- package/src/precompiles/bls12_381/util.ts +78 -0
- package/src/precompiles/bn254/index.ts +2 -0
- package/src/precompiles/bn254/noble.ts +156 -0
- package/src/precompiles/bn254/rustbn.ts +35 -0
- package/src/precompiles/index.ts +344 -0
- package/src/precompiles/types.ts +15 -0
- package/src/precompiles/util.ts +70 -0
- package/src/stack.ts +166 -0
- package/src/stemCache.ts +45 -0
- package/src/transientStorage.ts +131 -0
- package/src/types.ts +538 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { bytesToHex } from '@feelyourprotocol/util'
|
|
2
|
+
|
|
3
|
+
import { EVMError } from '../errors.ts'
|
|
4
|
+
import type { EVM } from '../evm.ts'
|
|
5
|
+
import { EVMErrorResult, OOGResult } from '../evm.ts'
|
|
6
|
+
|
|
7
|
+
import { leading16ZeroBytesCheck } from './bls12_381/index.ts'
|
|
8
|
+
import { getPrecompileName } from './index.ts'
|
|
9
|
+
import { equalityLengthCheck, gasLimitCheck } from './util.ts'
|
|
10
|
+
|
|
11
|
+
import type { ExecResult } from '../types.ts'
|
|
12
|
+
import type { PrecompileInput } from './types.ts'
|
|
13
|
+
|
|
14
|
+
export async function precompile0b(opts: PrecompileInput): Promise<ExecResult> {
|
|
15
|
+
const pName = getPrecompileName('0b')
|
|
16
|
+
const bls = (opts._EVM as EVM)['_bls']!
|
|
17
|
+
|
|
18
|
+
// note: the gas used is constant; even if the input is incorrect.
|
|
19
|
+
const gasUsed = opts.common.param('bls12381G1AddGas')
|
|
20
|
+
if (!gasLimitCheck(opts, gasUsed, pName)) {
|
|
21
|
+
return OOGResult(opts.gasLimit)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!equalityLengthCheck(opts, 256, pName)) {
|
|
25
|
+
return EVMErrorResult(
|
|
26
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_INVALID_INPUT_LENGTH),
|
|
27
|
+
opts.gasLimit,
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// check if some parts of input are zero bytes.
|
|
32
|
+
const zeroByteRanges = [
|
|
33
|
+
[0, 16],
|
|
34
|
+
[64, 80],
|
|
35
|
+
[128, 144],
|
|
36
|
+
[192, 208],
|
|
37
|
+
]
|
|
38
|
+
if (!leading16ZeroBytesCheck(opts, zeroByteRanges, pName)) {
|
|
39
|
+
return EVMErrorResult(
|
|
40
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_POINT_NOT_ON_CURVE),
|
|
41
|
+
opts.gasLimit,
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let returnValue
|
|
46
|
+
try {
|
|
47
|
+
returnValue = bls.addG1(opts.data)
|
|
48
|
+
} catch (e: any) {
|
|
49
|
+
if (opts._debug !== undefined) {
|
|
50
|
+
opts._debug(`${pName} failed: ${e.message}`)
|
|
51
|
+
}
|
|
52
|
+
return EVMErrorResult(e, opts.gasLimit)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (opts._debug !== undefined) {
|
|
56
|
+
opts._debug(`${pName} return value=${bytesToHex(returnValue)}`)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
executionGasUsed: gasUsed,
|
|
61
|
+
returnValue,
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { bytesToHex } from '@feelyourprotocol/util'
|
|
2
|
+
|
|
3
|
+
import { EVMError } from '../errors.ts'
|
|
4
|
+
import type { EVM } from '../evm.ts'
|
|
5
|
+
import { EVMErrorResult, OOGResult } from '../evm.ts'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
BLS_GAS_DISCOUNT_PAIRS_G1,
|
|
9
|
+
leading16ZeroBytesCheck,
|
|
10
|
+
msmGasUsed,
|
|
11
|
+
} from './bls12_381/index.ts'
|
|
12
|
+
import { getPrecompileName } from './index.ts'
|
|
13
|
+
import { gasLimitCheck, moduloLengthCheck } from './util.ts'
|
|
14
|
+
|
|
15
|
+
import type { ExecResult } from '../types.ts'
|
|
16
|
+
import type { PrecompileInput } from './types.ts'
|
|
17
|
+
|
|
18
|
+
export async function precompile0c(opts: PrecompileInput): Promise<ExecResult> {
|
|
19
|
+
const pName = getPrecompileName('0d')
|
|
20
|
+
const bls = (opts._EVM as EVM)['_bls']!
|
|
21
|
+
|
|
22
|
+
const inputData = opts.data
|
|
23
|
+
|
|
24
|
+
if (inputData.length === 0) {
|
|
25
|
+
if (opts._debug !== undefined) {
|
|
26
|
+
opts._debug(`${pName} failed: Empty input`)
|
|
27
|
+
}
|
|
28
|
+
return EVMErrorResult(
|
|
29
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_INPUT_EMPTY),
|
|
30
|
+
opts.gasLimit,
|
|
31
|
+
) // follow Geth's implementation
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// TODO: Double-check respectively confirm that this order is really correct that the gas check
|
|
35
|
+
// on this eventually to be "floored" pair number should happen before the input length modulo
|
|
36
|
+
// validation (same for g2msm)
|
|
37
|
+
const numPairs = Math.floor(inputData.length / 160)
|
|
38
|
+
const gasUsedPerPair = opts.common.param('bls12381G1MulGas')
|
|
39
|
+
const gasUsed = msmGasUsed(numPairs, gasUsedPerPair, BLS_GAS_DISCOUNT_PAIRS_G1)
|
|
40
|
+
|
|
41
|
+
if (!gasLimitCheck(opts, gasUsed, pName)) {
|
|
42
|
+
return OOGResult(opts.gasLimit)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!moduloLengthCheck(opts, 160, pName)) {
|
|
46
|
+
return EVMErrorResult(
|
|
47
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_INVALID_INPUT_LENGTH),
|
|
48
|
+
opts.gasLimit,
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// prepare pairing list and check for mandatory zero bytes
|
|
53
|
+
const zeroByteRanges = [
|
|
54
|
+
[0, 16],
|
|
55
|
+
[64, 80],
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
for (let k = 0; k < numPairs; k++) {
|
|
59
|
+
// zero bytes check
|
|
60
|
+
const pairStart = 160 * k
|
|
61
|
+
if (!leading16ZeroBytesCheck(opts, zeroByteRanges, pName, pairStart)) {
|
|
62
|
+
return EVMErrorResult(
|
|
63
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_POINT_NOT_ON_CURVE),
|
|
64
|
+
opts.gasLimit,
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
let returnValue
|
|
70
|
+
try {
|
|
71
|
+
returnValue = bls.msmG1(opts.data)
|
|
72
|
+
} catch (e: any) {
|
|
73
|
+
if (opts._debug !== undefined) {
|
|
74
|
+
opts._debug(`${pName} failed: ${e.message}`)
|
|
75
|
+
}
|
|
76
|
+
return EVMErrorResult(e, opts.gasLimit)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (opts._debug !== undefined) {
|
|
80
|
+
opts._debug(`${pName} return value=${bytesToHex(returnValue)}`)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
executionGasUsed: gasUsed,
|
|
85
|
+
returnValue,
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { bytesToHex } from '@feelyourprotocol/util'
|
|
2
|
+
|
|
3
|
+
import { EVMError } from '../errors.ts'
|
|
4
|
+
import type { EVM } from '../evm.ts'
|
|
5
|
+
import { EVMErrorResult, OOGResult } from '../evm.ts'
|
|
6
|
+
|
|
7
|
+
import { leading16ZeroBytesCheck } from './bls12_381/index.ts'
|
|
8
|
+
import { getPrecompileName } from './index.ts'
|
|
9
|
+
import { equalityLengthCheck, gasLimitCheck } from './util.ts'
|
|
10
|
+
|
|
11
|
+
import type { ExecResult } from '../types.ts'
|
|
12
|
+
import type { PrecompileInput } from './types.ts'
|
|
13
|
+
|
|
14
|
+
export async function precompile0d(opts: PrecompileInput): Promise<ExecResult> {
|
|
15
|
+
const pName = getPrecompileName('0e')
|
|
16
|
+
const bls = (opts._EVM as EVM)['_bls']!
|
|
17
|
+
|
|
18
|
+
// note: the gas used is constant; even if the input is incorrect.
|
|
19
|
+
const gasUsed = opts.common.param('bls12381G2AddGas')
|
|
20
|
+
if (!gasLimitCheck(opts, gasUsed, pName)) {
|
|
21
|
+
return OOGResult(opts.gasLimit)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!equalityLengthCheck(opts, 512, pName)) {
|
|
25
|
+
return EVMErrorResult(
|
|
26
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_INVALID_INPUT_LENGTH),
|
|
27
|
+
opts.gasLimit,
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// check if some parts of input are zero bytes.
|
|
32
|
+
const zeroByteRanges = [
|
|
33
|
+
[0, 16],
|
|
34
|
+
[64, 80],
|
|
35
|
+
[128, 144],
|
|
36
|
+
[192, 208],
|
|
37
|
+
[256, 272],
|
|
38
|
+
[320, 336],
|
|
39
|
+
[384, 400],
|
|
40
|
+
[448, 464],
|
|
41
|
+
]
|
|
42
|
+
if (!leading16ZeroBytesCheck(opts, zeroByteRanges, pName)) {
|
|
43
|
+
return EVMErrorResult(
|
|
44
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_POINT_NOT_ON_CURVE),
|
|
45
|
+
opts.gasLimit,
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// TODO: verify that point is on G2
|
|
50
|
+
|
|
51
|
+
let returnValue
|
|
52
|
+
try {
|
|
53
|
+
returnValue = bls.addG2(opts.data)
|
|
54
|
+
} catch (e: any) {
|
|
55
|
+
return EVMErrorResult(e, opts.gasLimit)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (opts._debug !== undefined) {
|
|
59
|
+
opts._debug(`${pName} return value=${bytesToHex(returnValue)}`)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
executionGasUsed: gasUsed,
|
|
64
|
+
returnValue,
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { bytesToHex } from '@feelyourprotocol/util'
|
|
2
|
+
|
|
3
|
+
import { EVMError } from '../errors.ts'
|
|
4
|
+
import type { EVM } from '../evm.ts'
|
|
5
|
+
import { EVMErrorResult, OOGResult } from '../evm.ts'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
BLS_GAS_DISCOUNT_PAIRS_G2,
|
|
9
|
+
leading16ZeroBytesCheck,
|
|
10
|
+
msmGasUsed,
|
|
11
|
+
} from './bls12_381/index.ts'
|
|
12
|
+
import { getPrecompileName } from './index.ts'
|
|
13
|
+
import { gasLimitCheck, moduloLengthCheck } from './util.ts'
|
|
14
|
+
|
|
15
|
+
import type { ExecResult } from '../types.ts'
|
|
16
|
+
import type { PrecompileInput } from './types.ts'
|
|
17
|
+
|
|
18
|
+
export async function precompile0e(opts: PrecompileInput): Promise<ExecResult> {
|
|
19
|
+
const pName = getPrecompileName('10')
|
|
20
|
+
const bls = (opts._EVM as EVM)['_bls']!
|
|
21
|
+
|
|
22
|
+
if (opts.data.length === 0) {
|
|
23
|
+
if (opts._debug !== undefined) {
|
|
24
|
+
opts._debug(`${pName} failed: Empty input`)
|
|
25
|
+
}
|
|
26
|
+
return EVMErrorResult(
|
|
27
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_INPUT_EMPTY),
|
|
28
|
+
opts.gasLimit,
|
|
29
|
+
) // follow Geth's implementation
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const numPairs = Math.floor(opts.data.length / 288)
|
|
33
|
+
const gasUsedPerPair = opts.common.param('bls12381G2MulGas')
|
|
34
|
+
const gasUsed = msmGasUsed(numPairs, gasUsedPerPair, BLS_GAS_DISCOUNT_PAIRS_G2)
|
|
35
|
+
|
|
36
|
+
if (!gasLimitCheck(opts, gasUsed, pName)) {
|
|
37
|
+
return OOGResult(opts.gasLimit)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!moduloLengthCheck(opts, 288, pName)) {
|
|
41
|
+
return EVMErrorResult(
|
|
42
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_INVALID_INPUT_LENGTH),
|
|
43
|
+
opts.gasLimit,
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// prepare pairing list and check for mandatory zero bytes
|
|
48
|
+
const zeroByteRanges = [
|
|
49
|
+
[0, 16],
|
|
50
|
+
[64, 80],
|
|
51
|
+
[128, 144],
|
|
52
|
+
[192, 208],
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
for (let k = 0; k < numPairs; k++) {
|
|
56
|
+
// zero bytes check
|
|
57
|
+
const pairStart = 288 * k
|
|
58
|
+
if (!leading16ZeroBytesCheck(opts, zeroByteRanges, pName, pairStart)) {
|
|
59
|
+
return EVMErrorResult(
|
|
60
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_POINT_NOT_ON_CURVE),
|
|
61
|
+
opts.gasLimit,
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let returnValue
|
|
67
|
+
try {
|
|
68
|
+
returnValue = bls.msmG2(opts.data)
|
|
69
|
+
} catch (e: any) {
|
|
70
|
+
if (opts._debug !== undefined) {
|
|
71
|
+
opts._debug(`${pName} failed: ${e.message}`)
|
|
72
|
+
}
|
|
73
|
+
return EVMErrorResult(e, opts.gasLimit)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (opts._debug !== undefined) {
|
|
77
|
+
opts._debug(`${pName} return value=${bytesToHex(returnValue)}`)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
executionGasUsed: gasUsed,
|
|
82
|
+
returnValue,
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { bytesToHex } from '@feelyourprotocol/util'
|
|
2
|
+
|
|
3
|
+
import { EVMError } from '../errors.ts'
|
|
4
|
+
import type { EVM } from '../evm.ts'
|
|
5
|
+
import { EVMErrorResult, OOGResult } from '../evm.ts'
|
|
6
|
+
|
|
7
|
+
import { leading16ZeroBytesCheck } from './bls12_381/index.ts'
|
|
8
|
+
import { getPrecompileName } from './index.ts'
|
|
9
|
+
import { gasLimitCheck, moduloLengthCheck } from './util.ts'
|
|
10
|
+
|
|
11
|
+
import type { ExecResult } from '../types.ts'
|
|
12
|
+
import type { PrecompileInput } from './types.ts'
|
|
13
|
+
|
|
14
|
+
export async function precompile0f(opts: PrecompileInput): Promise<ExecResult> {
|
|
15
|
+
const pName = getPrecompileName('11')
|
|
16
|
+
const bls = (opts._EVM as EVM)['_bls']!
|
|
17
|
+
|
|
18
|
+
const baseGas = opts.common.param('bls12381PairingBaseGas')
|
|
19
|
+
|
|
20
|
+
// TODO: confirm that this is not a thing for the other precompiles
|
|
21
|
+
if (opts.data.length === 0) {
|
|
22
|
+
if (opts._debug !== undefined) {
|
|
23
|
+
opts._debug(`${pName} failed: Empty input`)
|
|
24
|
+
}
|
|
25
|
+
return EVMErrorResult(
|
|
26
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_INPUT_EMPTY),
|
|
27
|
+
opts.gasLimit,
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const gasUsedPerPair = opts.common.param('bls12381PairingPerPairGas')
|
|
32
|
+
|
|
33
|
+
// TODO: For this precompile it is the only exception that the length check is placed before the
|
|
34
|
+
// gas check. I will keep it there to not side-change the existing implementation, but we should
|
|
35
|
+
// check (respectively Jochem can maybe have a word) if this is something intended or not
|
|
36
|
+
if (!moduloLengthCheck(opts, 384, pName)) {
|
|
37
|
+
return EVMErrorResult(
|
|
38
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_INVALID_INPUT_LENGTH),
|
|
39
|
+
opts.gasLimit,
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const gasUsed = baseGas + gasUsedPerPair * BigInt(Math.floor(opts.data.length / 384))
|
|
44
|
+
if (!gasLimitCheck(opts, gasUsed, pName)) {
|
|
45
|
+
return OOGResult(opts.gasLimit)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// check for mandatory zero bytes
|
|
49
|
+
const zeroByteRanges = [
|
|
50
|
+
[0, 16],
|
|
51
|
+
[64, 80],
|
|
52
|
+
[128, 144],
|
|
53
|
+
[192, 208],
|
|
54
|
+
[256, 272],
|
|
55
|
+
[320, 336],
|
|
56
|
+
]
|
|
57
|
+
for (let k = 0; k < opts.data.length / 384; k++) {
|
|
58
|
+
// zero bytes check
|
|
59
|
+
const pairStart = 384 * k
|
|
60
|
+
if (!leading16ZeroBytesCheck(opts, zeroByteRanges, pName, pairStart)) {
|
|
61
|
+
return EVMErrorResult(
|
|
62
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_POINT_NOT_ON_CURVE),
|
|
63
|
+
opts.gasLimit,
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let returnValue
|
|
69
|
+
try {
|
|
70
|
+
returnValue = bls.pairingCheck(opts.data)
|
|
71
|
+
} catch (e: any) {
|
|
72
|
+
if (opts._debug !== undefined) {
|
|
73
|
+
opts._debug(`${pName} failed: ${e.message}`)
|
|
74
|
+
}
|
|
75
|
+
return EVMErrorResult(e, opts.gasLimit)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (opts._debug !== undefined) {
|
|
79
|
+
opts._debug(`${pName} return value=${bytesToHex(returnValue)}`)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
executionGasUsed: gasUsed,
|
|
84
|
+
returnValue,
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { bytesToHex } from '@feelyourprotocol/util'
|
|
2
|
+
|
|
3
|
+
import { EVMError } from '../errors.ts'
|
|
4
|
+
import type { EVM } from '../evm.ts'
|
|
5
|
+
import { EVMErrorResult, OOGResult } from '../evm.ts'
|
|
6
|
+
|
|
7
|
+
import { leading16ZeroBytesCheck } from './bls12_381/index.ts'
|
|
8
|
+
import { getPrecompileName } from './index.ts'
|
|
9
|
+
import { equalityLengthCheck, gasLimitCheck } from './util.ts'
|
|
10
|
+
|
|
11
|
+
import type { ExecResult } from '../types.ts'
|
|
12
|
+
import type { PrecompileInput } from './types.ts'
|
|
13
|
+
|
|
14
|
+
export async function precompile10(opts: PrecompileInput): Promise<ExecResult> {
|
|
15
|
+
const pName = getPrecompileName('12')
|
|
16
|
+
const bls = (opts._EVM as EVM)['_bls']!
|
|
17
|
+
|
|
18
|
+
// note: the gas used is constant; even if the input is incorrect.
|
|
19
|
+
const gasUsed = opts.common.param('bls12381MapG1Gas')
|
|
20
|
+
if (!gasLimitCheck(opts, gasUsed, pName)) {
|
|
21
|
+
return OOGResult(opts.gasLimit)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!equalityLengthCheck(opts, 64, pName)) {
|
|
25
|
+
return EVMErrorResult(
|
|
26
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_INVALID_INPUT_LENGTH),
|
|
27
|
+
opts.gasLimit,
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// check if some parts of input are zero bytes.
|
|
32
|
+
const zeroByteRanges = [[0, 16]]
|
|
33
|
+
if (!leading16ZeroBytesCheck(opts, zeroByteRanges, pName)) {
|
|
34
|
+
return EVMErrorResult(
|
|
35
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_POINT_NOT_ON_CURVE),
|
|
36
|
+
opts.gasLimit,
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let returnValue
|
|
41
|
+
try {
|
|
42
|
+
returnValue = bls.mapFPtoG1(opts.data)
|
|
43
|
+
} catch (e: any) {
|
|
44
|
+
if (opts._debug !== undefined) {
|
|
45
|
+
opts._debug(`${pName} failed: ${e.message}`)
|
|
46
|
+
}
|
|
47
|
+
return EVMErrorResult(e, opts.gasLimit)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (opts._debug !== undefined) {
|
|
51
|
+
opts._debug(`${pName} return value=${bytesToHex(returnValue)}`)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
executionGasUsed: gasUsed,
|
|
56
|
+
returnValue,
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { bytesToBigInt, bytesToHex, setLengthLeft } from '@feelyourprotocol/util'
|
|
2
|
+
import { p256 } from '@noble/curves/nist.js'
|
|
3
|
+
|
|
4
|
+
import { OOGResult } from '../evm.ts'
|
|
5
|
+
|
|
6
|
+
import { getPrecompileName } from './index.ts'
|
|
7
|
+
import type { PrecompileInput } from './types.ts'
|
|
8
|
+
import { gasLimitCheck } from './util.ts'
|
|
9
|
+
|
|
10
|
+
import type { ExecResult } from '../types.ts'
|
|
11
|
+
|
|
12
|
+
const P256VERIFY_GAS_COST = BigInt(6900)
|
|
13
|
+
const SUCCESS_RETURN = new Uint8Array(32).fill(0).map((_, i) => (i === 31 ? 1 : 0))
|
|
14
|
+
|
|
15
|
+
// Curve parameters for secp256r1
|
|
16
|
+
const P256_N = BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551') // Subgroup order
|
|
17
|
+
const P256_P = BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff') // Base field modulus
|
|
18
|
+
const P256_A = BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc') // Curve coefficient a
|
|
19
|
+
const P256_B = BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b') // Curve coefficient b
|
|
20
|
+
|
|
21
|
+
export function precompile100(opts: PrecompileInput): ExecResult {
|
|
22
|
+
const pName = getPrecompileName('100')
|
|
23
|
+
const gasUsed = P256VERIFY_GAS_COST
|
|
24
|
+
|
|
25
|
+
if (!gasLimitCheck(opts, gasUsed, pName)) {
|
|
26
|
+
return OOGResult(opts.gasLimit)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const data = opts.data
|
|
30
|
+
|
|
31
|
+
// 1. Input length: Input MUST be exactly 160 bytes
|
|
32
|
+
if (data.length !== 160) {
|
|
33
|
+
if (opts._debug !== undefined) {
|
|
34
|
+
opts._debug(`${pName} failed: invalid input length ${data.length}, expected 160`)
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
executionGasUsed: gasUsed,
|
|
38
|
+
returnValue: new Uint8Array(),
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const msgHash = data.subarray(0, 32)
|
|
43
|
+
const r = data.subarray(32, 64)
|
|
44
|
+
const s = data.subarray(64, 96)
|
|
45
|
+
const qx = data.subarray(96, 128)
|
|
46
|
+
const qy = data.subarray(128, 160)
|
|
47
|
+
|
|
48
|
+
const rBigInt = bytesToBigInt(r)
|
|
49
|
+
const sBigInt = bytesToBigInt(s)
|
|
50
|
+
const qxBigInt = bytesToBigInt(qx)
|
|
51
|
+
const qyBigInt = bytesToBigInt(qy)
|
|
52
|
+
|
|
53
|
+
// 2. Signature component bounds: Both r and s MUST satisfy 0 < r < n and 0 < s < n
|
|
54
|
+
if (!(rBigInt > BigInt(0) && rBigInt < P256_N && sBigInt > BigInt(0) && sBigInt < P256_N)) {
|
|
55
|
+
if (opts._debug !== undefined) {
|
|
56
|
+
opts._debug(
|
|
57
|
+
`${pName} failed: signature component out of bounds: r=${bytesToHex(r)}, s=${bytesToHex(s)}`,
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
executionGasUsed: gasUsed,
|
|
62
|
+
returnValue: new Uint8Array(),
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 3. Public key bounds: Both qx and qy MUST satisfy 0 ≤ qx < p and 0 ≤ qy < p
|
|
67
|
+
if (!(qxBigInt >= BigInt(0) && qxBigInt < P256_P && qyBigInt >= BigInt(0) && qyBigInt < P256_P)) {
|
|
68
|
+
if (opts._debug !== undefined) {
|
|
69
|
+
opts._debug(
|
|
70
|
+
`${pName} failed: public key component out of bounds: qx=${bytesToHex(qx)}, qy=${bytesToHex(qy)}`,
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
executionGasUsed: gasUsed,
|
|
75
|
+
returnValue: new Uint8Array(),
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// 4. Point validity: The point (qx, qy) MUST satisfy the curve equation qy^2 ≡ qx^3 + a*qx + b (mod p)
|
|
80
|
+
const leftSide = (qyBigInt * qyBigInt) % P256_P
|
|
81
|
+
const rightSide = (qxBigInt * qxBigInt * qxBigInt + P256_A * qxBigInt + P256_B) % P256_P
|
|
82
|
+
|
|
83
|
+
if (leftSide !== rightSide) {
|
|
84
|
+
if (opts._debug !== undefined) {
|
|
85
|
+
opts._debug(`${pName} failed: point not on curve`)
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
executionGasUsed: gasUsed,
|
|
89
|
+
returnValue: new Uint8Array(),
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 5. Point not at infinity: The point (qx, qy) MUST NOT be the point at infinity (represented as (0, 0))
|
|
94
|
+
if (qxBigInt === BigInt(0) && qyBigInt === BigInt(0)) {
|
|
95
|
+
if (opts._debug !== undefined) {
|
|
96
|
+
opts._debug(`${pName} failed: public key is point at infinity`)
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
executionGasUsed: gasUsed,
|
|
100
|
+
returnValue: new Uint8Array(),
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
// Create public key point
|
|
106
|
+
const publicKey = p256.Point.fromAffine({
|
|
107
|
+
x: qxBigInt,
|
|
108
|
+
y: qyBigInt,
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
// Create signature
|
|
112
|
+
const rBytes = setLengthLeft(r, 32)
|
|
113
|
+
const sBytes = setLengthLeft(s, 32)
|
|
114
|
+
const signatureBytes = new Uint8Array(64)
|
|
115
|
+
signatureBytes.set(rBytes, 0)
|
|
116
|
+
signatureBytes.set(sBytes, 32)
|
|
117
|
+
|
|
118
|
+
const signature = p256.Signature.fromBytes(signatureBytes).toBytes()
|
|
119
|
+
|
|
120
|
+
// Verify signature
|
|
121
|
+
const isValid = p256.verify(signature, msgHash, publicKey.toBytes(false), {
|
|
122
|
+
lowS: false,
|
|
123
|
+
prehash: false,
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
if (isValid) {
|
|
127
|
+
if (opts._debug !== undefined) {
|
|
128
|
+
opts._debug(`${pName} succeeded: signature verification passed`)
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
executionGasUsed: gasUsed,
|
|
132
|
+
returnValue: SUCCESS_RETURN,
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
if (opts._debug !== undefined) {
|
|
136
|
+
opts._debug(`${pName} failed: signature verification failed`)
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
executionGasUsed: gasUsed,
|
|
140
|
+
returnValue: new Uint8Array(),
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} catch (error) {
|
|
144
|
+
if (opts._debug !== undefined) {
|
|
145
|
+
opts._debug(`${pName} failed: verification error: ${error}`)
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
executionGasUsed: gasUsed,
|
|
149
|
+
returnValue: new Uint8Array(),
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { bytesToHex } from '@feelyourprotocol/util'
|
|
2
|
+
|
|
3
|
+
import { EVMError } from '../errors.ts'
|
|
4
|
+
import type { EVM } from '../evm.ts'
|
|
5
|
+
import { EVMErrorResult, OOGResult } from '../evm.ts'
|
|
6
|
+
|
|
7
|
+
import { leading16ZeroBytesCheck } from './bls12_381/index.ts'
|
|
8
|
+
import { getPrecompileName } from './index.ts'
|
|
9
|
+
import { equalityLengthCheck, gasLimitCheck } from './util.ts'
|
|
10
|
+
|
|
11
|
+
import type { ExecResult } from '../types.ts'
|
|
12
|
+
import type { PrecompileInput } from './types.ts'
|
|
13
|
+
|
|
14
|
+
export async function precompile11(opts: PrecompileInput): Promise<ExecResult> {
|
|
15
|
+
const pName = getPrecompileName('13')
|
|
16
|
+
const bls = (opts._EVM as EVM)['_bls']!
|
|
17
|
+
|
|
18
|
+
// note: the gas used is constant; even if the input is incorrect.
|
|
19
|
+
const gasUsed = opts.common.param('bls12381MapG2Gas')
|
|
20
|
+
if (!gasLimitCheck(opts, gasUsed, pName)) {
|
|
21
|
+
return OOGResult(opts.gasLimit)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!equalityLengthCheck(opts, 128, pName)) {
|
|
25
|
+
return EVMErrorResult(
|
|
26
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_INVALID_INPUT_LENGTH),
|
|
27
|
+
opts.gasLimit,
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// check if some parts of input are zero bytes.
|
|
32
|
+
const zeroByteRanges = [
|
|
33
|
+
[0, 16],
|
|
34
|
+
[64, 80],
|
|
35
|
+
]
|
|
36
|
+
if (!leading16ZeroBytesCheck(opts, zeroByteRanges, pName)) {
|
|
37
|
+
return EVMErrorResult(
|
|
38
|
+
new EVMError(EVMError.errorMessages.BLS_12_381_POINT_NOT_ON_CURVE),
|
|
39
|
+
opts.gasLimit,
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let returnValue
|
|
44
|
+
try {
|
|
45
|
+
returnValue = bls.mapFP2toG2(opts.data)
|
|
46
|
+
} catch (e: any) {
|
|
47
|
+
if (opts._debug !== undefined) {
|
|
48
|
+
opts._debug(`${pName} failed: ${e.message}`)
|
|
49
|
+
}
|
|
50
|
+
return EVMErrorResult(e, opts.gasLimit)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (opts._debug !== undefined) {
|
|
54
|
+
opts._debug(`${pName} return value=${bytesToHex(returnValue)}`)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
executionGasUsed: gasUsed,
|
|
59
|
+
returnValue,
|
|
60
|
+
}
|
|
61
|
+
}
|