Git Product home page Git Product logo

cairo-evm's People

Watchers

zpoken avatar

cairo-evm's Issues

EVM Opcodes (tracking issue)

  • 0x00 STOP
  • 0x01 ADD
  • 0x02 MUL
  • 0x03 SUB
  • 0x04 DIV
  • 0x05 SDIV
  • 0x06 MOD
  • 0x07 SMOD
  • 0x08 ADDMOD
  • 0x09 MULMOD
  • 0x0a EXP
  • 0x0b SIGNEXTEND
  • 0x10 LT
  • 0x11 GT
  • 0x12 SLT
  • 0x13 SGT
  • 0x14 EQ
  • 0x15 ISZERO
  • 0x16 AND
  • 0x17 OR
  • 0x18 XOR
  • 0x19 NOT
  • 0x1a BYTE
  • 0x1b SHL
  • 0x1c SHR
  • 0x1d SAR
  • 0x20 KECCAK256
  • 0x23 ADDRESS
  • 0x24 BALANCE
  • 0x25 ORIGIN
  • 0x26 CALLER
  • 0x27 CALLVALUE
  • 0x28 CALLDATALOAD
  • 0x29 CALLDATASIZE
  • 0x2a CALLDATACOPY
  • 0x2b CODESIZE
  • 0x2c CODECOPY
  • 0x2d GASPRICE
  • 0x2e EXTCODESIZE
  • 0x2f EXTCODECOPY
  • 0x30 RETURNDATASIZE
  • 0x31 RETURNDATACOPY
  • 0x40 BLOCKHASH
  • 0x41 COINBASE
  • 0x42 TIMESTAMP
  • 0x43 NUMBER
  • 0x44 DIFFICULTY
  • 0x45 GASLIMIT
  • 0x46 CHAINID
  • 0x47 SELFBALANCE
  • 0x48 BASEFEE
  • 0x60 PUSH1
  • 0x61 PUSH2
  • 0x62 PUSH3
  • 0x63 PUSH4
  • 0x64 PUSH5
  • 0x65 PUSH6
  • 0x66 PUSH7
  • 0x67 PUSH8
  • 0x68 PUSH9
  • 0x69 PUSH10
  • 0x6a PUSH11
  • 0x6b PUSH12
  • 0x6c PUSH13
  • 0x6d PUSH14
  • 0x6e PUSH15
  • 0x6f PUSH16
  • 0x70 PUSH17
  • 0x71 PUSH18
  • 0x72 PUSH19
  • 0x73 PUSH20
  • 0x74 PUSH21
  • 0x75 PUSH22
  • 0x76 PUSH23
  • 0x77 PUSH24
  • 0x78 PUSH25
  • 0x79 PUSH26
  • 0x7a PUSH27
  • 0x7b PUSH28
  • 0x7c PUSH29
  • 0x7d PUSH30
  • 0x7e PUSH31
  • 0x7f PUSH32
  • 0x80 DUP1
  • 0x81 DUP2
  • 0x82 DUP3
  • 0x83 DUP4
  • 0x84 DUP5
  • 0x85 DUP6
  • 0x86 DUP7
  • 0x87 DUP8
  • 0x88 DUP9
  • 0x89 DUP10
  • 0x8a DUP11
  • 0x8b DUP12
  • 0x8c DUP13
  • 0x8d DUP14
  • 0x8e DUP15
  • 0x8f DUP16
  • 0x90 SWAP1
  • 0x91 SWAP2
  • 0x92 SWAP3
  • 0x93 SWAP4
  • 0x94 SWAP5
  • 0x95 SWAP6
  • 0x96 SWAP7
  • 0x97 SWAP8
  • 0x98 SWAP9
  • 0x99 SWAP10
  • 0x9a SWAP11
  • 0x9b SWAP12
  • 0x9c SWAP13
  • 0x9d SWAP14
  • 0x9e SWAP15
  • 0x9f SWAP16
  • 0xa0 LOG0
  • 0xa1 LOG1
  • 0xa2 LOG2
  • 0xa3 LOG3
  • 0xa4 LOG4
  • 0xa5 DELEGATECALL
  • 0xa7 STATICCALL
  • 0xa8 REVERT
  • 0xa9 INVALID
  • 0xaa SELFDESTRUCT
  • 0xf0 CREATE
  • 0xf1 CALL
  • 0xf2 CALLCODE
  • 0xf3 RETURN
  • 0xf4 DELEGATECALL
  • 0xf5 CREATE2
  • 0xf6 REVERT
  • 0xf7 INVALID
  • 0xf8 SELFDESTRUCT

Cairo to EVM Proof of Concept

The first stage of compiler development is to achieve compilation of the simplest "Cairo" contract in evm
Cairo contract:

fn main() -> felt252 {
    1
}

Sierra code:

type felt252 = felt252;

libfunc felt_const<1> = felt_const<1>;
libfunc store_temp<felt252> = store_temp<felt252>;

felt_const<1>() -> ([0]);
store_temp<felt252>([0]) -> ([1]);
return([1]);

program::program::main@0() -> (felt252);

The implementation of Proof of Concept involves, at a minimum, resolving these issues:

  • necessary to provide data type conversion during compilation for felt252, since it is known that EVM uses 32 byte integers
  • require implementation of at least a few opcodes from the #1
  • research regarding whether we can inherit the compiler cairo-lang-sierra-to-casm
  • We must study well implementation kakarot. Although kakarot solves the reverse issue (solidity to cairo) it is likely to be useful to us, as it has already encountered and successfully solved Cairo and EVM compatibility issues.
  • It seems RUST will be the priority language for compiler development, but it is worth exploring other options

Proof of Concept Success Criteria:

  • byte code resulting from cairo compilation is successfully executed in EVM with the expected result

Timeline:
Target 1 month of research and development to demonstrate a working Proof of Concept and then evaluate our estimates of the timeline for full implementation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.