erigon-pulse/cmd/starknet
Alexandr Borodulin bbb3cc978f
Starknet getcode (#3038)
* deploy_cairo_smartcontract

* deploy_cairo_smartcontract / 2

Add new transaction type for cairo and vm factory

* starknet_getcode

* deploy_cairo_smartcontract / 3

* deploy_cairo_smartcontract / 4

* deploy_cairo_smartcontract / 5

Co-authored-by: Aleksandr Borodulin <a.borodulin@axioma.lv>
2021-12-06 14:58:53 +00:00
..
cmd Starknet getcode (#3038) 2021-12-06 14:58:53 +00:00
services Starknet getcode (#3038) 2021-12-06 14:58:53 +00:00
main.go Starknet getcode (#3038) 2021-12-06 14:58:53 +00:00
README.md Starknet getcode (#3038) 2021-12-06 14:58:53 +00:00

How to deploy cairo smart contract

  1. Compile cairo smart contract

    starknet-compile contract.cairo --output contract_compiled.json --abi contract_abi.json

  2. Generate payload for starknet_sendRawTransaction PRC method

    go run ./cmd/starknet/main.go generateRawTx -c ./cairo/contract.json -o /cairo/send_raw_transaction -k b9a8b19ff082a7f4b943fcbe0da6cce6ce2c860090f05d031f463412ab534e95

    Command syntax: go run main.go generateRawTx --help

  3. Use command output in RPC call

"params":["0x03f86583127ed80180800180019637623232363136323639323233613230356235643764c080a0b44c2f4e18ca27e621171da5cf3a0c875c0749c7b998ec2759974280d987143aa04f01823122d972baa1a03b113535d9f9057fd9366fd8770e766b91f835b88ea6"],