ethers-io / ext-evm Goto Github PK
View Code? Open in Web Editor NEWEthers extension package for EVM utilities.
Ethers extension package for EVM utilities.
5.7.0
asm
I am using asm disassemble
on bytecode generated by solitidty 0.8.13 and got several unknown opcodes
// SPDX-License-Identifier: AGPL-1.0
pragma solidity 0.8.13;
contract Test {
constructor() {}
function test() external {}
}
generated asm: using disassemble + formatBytecode
```asm
0000 : 0x80 ; ethers-io/ethers.js#1
0002 : 0x40 ; ethers-io/ethers.js#1
0004 : MSTORE
0005 : CALLVALUE
0006 : DUP1
0007 : ISZERO
0008 : 0x0f ; ethers-io/ethers.js#1
000a : JUMPI
000b : 0x00 ; ethers-io/ethers.js#1
000d : DUP1
000e : REVERT
000f*: JUMPDEST
0010 : POP
0011 : 0x65 ; ethers-io/ethers.js#1
0013 : DUP1
0014 : 0x1d ; ethers-io/ethers.js#1
0016 : 0x00 ; ethers-io/ethers.js#1
0018 : CODECOPY
0019 : 0x00 ; ethers-io/ethers.js#1
001b : RETURN
001c : INVALID
001d : 0x80 ; ethers-io/ethers.js#1
001f : 0x40 ; ethers-io/ethers.js#1
0021 : MSTORE
0022 : CALLVALUE
0023 : DUP1
0024 : ISZERO
0025 : 0x0f ; ethers-io/ethers.js#1
0027 : JUMPI
0028 : 0x00 ; ethers-io/ethers.js#1
002a : DUP1
002b : REVERT
002c*: JUMPDEST
002d : POP
002e : 0x04 ; ethers-io/ethers.js#1
0030 : CALLDATASIZE
0031 : LT
0032 : 0x28 ; ethers-io/ethers.js#1
0034 : JUMPI
0035 : 0x00 ; ethers-io/ethers.js#1
0037 : CALLDATALOAD
0038 : 0xe0 ; ethers-io/ethers.js#1
003a : SHR
003b : DUP1
003c : 0xf8a8fd6d ; ethers-io/ethers.js#4
0041 : EQ
0042 : 0x2d ; ethers-io/ethers.js#1
0044 : JUMPI
0045*: JUMPDEST
0046 : 0x00 ; ethers-io/ethers.js#1
0048 : DUP1
0049 : REVERT
004a*: JUMPDEST
004b : STOP
004c : INVALID
004d : LOG2
004e : 0x6970667358 ; ethers-io/ethers.js#5
0054 : unknown (0x22)
0055 : SLT
0056 : SHA3
0057 : unknown (0xaf)
0058 : unknown (0xdd)
0059 : 0x49bbc60d2b1ec3cd669ec0f050abeb9f ; ethers-io/ethers.js#16
006a : EXP
006b : unknown (0xbc)
006c : PUSH22 ; OOB!!
006d : unknown (0xae)
006e : unknown (0xfb)
006f : unknown (0xbd)
0070 : 0x9c811407c2f464736f6c63 ; ethers-io/ethers.js#11
007c : NUMBER
007d : STOP
007e : ADDMOD
007f : unknown (0x0d)
0080 : STOP
0081 : CALLER
### Contract ABI
_No response_
### Errors
_No response_
### Environment
node.js (v12 or newer)
### Environment (Other)
_No response_
5.7.0
asm,browser
I am using vitejs.dev/ and I get this error when using @ethersproject/asm in browser :
client-manifest.js?t=1663412740209:14 ReferenceError: exports is not defined
at _parser.js:785:15
No response
No response
client-manifest.js?t=1663412740209:14 ReferenceError: exports is not defined
at _parser.js:785:15
### Environment
Browser (Chrome, Safari, etc)
### Environment (Other)
_No response_
Starting to play with asm to make some small contract but I am having hard time figuring out how the whole thing works
I looked at lurch for inspiration, but I do not know what $$ means for example
Any pointer, example of smart contract in asm would be helpful :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.