Back to Eos

Code

docs/02_cleos/03_command-reference/get/code.md

2.1.0999 B
Original Source

Description

Retrieves the code and ABI for an account

Positional Parameters

  • name TEXT - The name of the account whose code should be retrieved

Options

  • -c,--code TEXT - The name of the file to save the contract .wast to
  • -a,--abi TEXT - The name of the file to save the contract .abi to
  • --wasm Save contract as wasm

Examples

Simply output the hash of eosio.token contract

sh
cleos get code eosio.token
console
code hash: f675e7aeffbf562c033acfaf33eadff255dacb90d002db51c7ad7cbf057eb791

Retrieve and save abi for eosio.token contract

sh
cleos get code eosio.token -a eosio.token.abi
console
code hash: f675e7aeffbf562c033acfaf33eadff255dacb90d002db51c7ad7cbf057eb791
saving abi to eosio.token.abi

Retrieve and save wast code for eosio.token contract

sh
cleos get code eosio.token -c eosio.token.wast
console
code hash: f675e7aeffbf562c033acfaf33eadff255dacb90d002db51c7ad7cbf057eb791
saving wast to eosio.token.wast