Skip to content

Instantly share code, notes, and snippets.

@deckb
Last active October 15, 2018 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deckb/311fa74bbac0f046c706ebc1dc7dd7f2 to your computer and use it in GitHub Desktop.
Save deckb/311fa74bbac0f046c706ebc1dc7dd7f2 to your computer and use it in GitHub Desktop.
Deploying eosio.wrap
{
"version": "eosio::abi/1.0",
"types": [
{
"new_type_name": "account_name",
"type": "name"
},
{
"new_type_name": "permission_name",
"type": "name"
},
{
"new_type_name": "action_name",
"type": "name"
}
],
"structs": [
{
"name": "permission_level",
"base": "",
"fields": [
{
"name": "actor",
"type": "account_name"
},
{
"name": "permission",
"type": "permission_name"
}
]
},
{
"name": "action",
"base": "",
"fields": [
{
"name": "account",
"type": "account_name"
},
{
"name": "name",
"type": "action_name"
},
{
"name": "authorization",
"type": "permission_level[]"
},
{
"name": "data",
"type": "bytes"
}
]
},
{
"name": "transaction_header",
"base": "",
"fields": [
{
"name": "expiration",
"type": "time_point_sec"
},
{
"name": "ref_block_num",
"type": "uint16"
},
{
"name": "ref_block_prefix",
"type": "uint32"
},
{
"name": "max_net_usage_words",
"type": "varuint32"
},
{
"name": "max_cpu_usage_ms",
"type": "uint8"
},
{
"name": "delay_sec",
"type": "varuint32"
}
]
},
{
"name": "extension",
"base": "",
"fields": [
{
"name": "type",
"type": "uint16"
},
{
"name": "data",
"type": "bytes"
}
]
},
{
"name": "transaction",
"base": "transaction_header",
"fields": [
{
"name": "context_free_actions",
"type": "action[]"
},
{
"name": "actions",
"type": "action[]"
},
{
"name": "transaction_extensions",
"type": "extension[]"
}
]
},
{
"name": "exec",
"base": "",
"fields": [
{
"name": "executer",
"type": "account_name"
},
{
"name": "trx",
"type": "transaction"
}
]
}
],
"actions": [
{
"name": "exec",
"type": "exec",
"ricardian_contract": "Allows block producers to bypass authorization checks or run privileged actions with 15/21 producer approval"
}
],
"tables": [],
"ricardian_clauses": [],
"error_messages": [],
"abi_extensions": [],
"variants": []
}

Deploy of wrap contract

Links

msig transaction

https://eosflare.io/tx/8c00287e334031feb3c58dca43e9f8d3f9fffa26cb4d0130f55c0e6be40f63fb

liberty block writeup

https://steemit.com/eos/@blockliberty/eosio-wrap-eosio-sudo-demystified

setcode action

cleos multisig review libertyblock deploywrap | jq -r .transaction.actions[0].data.code | xxd -r -p | sha256sum
1a4d66fc40479949e47c517f057efd76f9861f7c6c6d4eeefaeb156866209d0a -

# check our locally built version
sha256sum eosio.sudo.wasm
1a4d66fc40479949e47c517f057efd76f9861f7c6c6d4eeefaeb156866209d0a  eosio.sudo.wasm
  

setabi action

# get the deploying abi
cleos multisig review libertyblock deploywrap | jq -r .transaction.actions[1].data.abi | abi_hex_to_json | jq '' > /tmp/deploywrap.abi

# get contract abi from github
wget https://raw.githubusercontent.com/EOSIO/eosio.contracts/v1.3.1/eosio.sudo/abi/eosio.sudo.abi -O /tmp/eosio.sudo.abi

# diff the two
# there are a lot of "differences" between the abis however upon closer inspection they are all cosmetic changes except for the RC statement.

RC: "ricardian_contract": "Allows block producers to bypass authorization checks or run privileged actions with 15/21 producer approval"

diff -y --suppress-common-lines /tmp/deploywrap.abi /tmp/eosio.sudo.abi
  "types": [                                                  |   "types": [{
    {                                                         <
    },                                                        |    },{
    {                                                         <
    },                                                        |    },{
    {                                                         <
    }                                                         |   }],
  ],                                                          |   "structs": [{
  "structs": [                                                <
    {                                                         <
        {                                                     |         {"name": "actor", "type": "account_name"},
          "name": "actor",                                    |         {"name": "permission", "type": "permission_name"}
          "type": "account_name"                              <
        },                                                    <
        {                                                     <
          "name": "permission",                               <
          "type": "permission_name"                           <
        }                                                     <
    },                                                        |     },{
    {                                                         <
        {                                                     |          {"name": "account", "type": "account_name"},
          "name": "account",                                  |          {"name": "name", "type": "action_name"},
          "type": "account_name"                              |          {"name": "authorization", "type": "permission_level[
        },                                                    |          {"name": "data", "type": "bytes"}
        {                                                     <
          "name": "name",                                     <
          "type": "action_name"                               <
        },                                                    <
        {                                                     <
          "name": "authorization",                            <
          "type": "permission_level[]"                        <
        },                                                    <
        {                                                     <
          "name": "data",                                     <
          "type": "bytes"                                     <
        }                                                     <
    },                                                        |     },{
    {                                                         <
        {                                                     |          {"name": "expiration", "type": "time_point_sec"},
          "name": "expiration",                               |          {"name": "ref_block_num", "type": "uint16"},
          "type": "time_point_sec"                            |          {"name": "ref_block_prefix", "type": "uint32"},
        },                                                    |          {"name": "max_net_usage_words", "type": "varuint32"}
        {                                                     |          {"name": "max_cpu_usage_ms", "type": "uint8"},
          "name": "ref_block_num",                            |          {"name": "delay_sec", "type": "varuint32"}
          "type": "uint16"                                    <
        },                                                    <
        {                                                     <
          "name": "ref_block_prefix",                         <
          "type": "uint32"                                    <
        },                                                    <
        {                                                     <
          "name": "max_net_usage_words",                      <
          "type": "varuint32"                                 <
        },                                                    <
        {                                                     <
          "name": "max_cpu_usage_ms",                         <
          "type": "uint8"                                     <
        },                                                    <
        {                                                     <
          "name": "delay_sec",                                <
          "type": "varuint32"                                 <
        }                                                     <
    },                                                        |    },{
    {                                                         <
        {                                                     |          {"name": "type", "type" : "uint16" },
          "name": "type",                                     |          {"name": "data", "type": "bytes"}
          "type": "uint16"                                    <
        },                                                    <
        {                                                     <
          "name": "data",                                     <
          "type": "bytes"                                     <
        }                                                     <
    },                                                        |    },{
    {                                                         <
        {                                                     |          {"name": "context_free_actions", "type": "action[]"}
          "name": "context_free_actions",                     |          {"name": "actions", "type": "action[]"},
          "type": "action[]"                                  |          {"name": "transaction_extensions", "type": "extensio
        },                                                    <
        {                                                     <
          "name": "actions",                                  <
          "type": "action[]"                                  <
        },                                                    <
        {                                                     <
          "name": "transaction_extensions",                   <
          "type": "extension[]"                               <
        }                                                     <
    },                                                        |    },{
    {                                                         <
        {                                                     |         {"name":"executer", "type":"account_name"},
          "name": "executer",                                 |         {"name":"trx", "type":"transaction"}
          "type": "account_name"                              <
        },                                                    <
        {                                                     <
          "name": "trx",                                      <
          "type": "transaction"                               <
        }                                                     <
  "actions": [                                                |   "actions": [{
    {                                                         <
      "ricardian_contract": "Allows block producers to bypass |       "ricardian_contract": ""
  "error_messages": [],                                       |   "abi_extensions": []
  "abi_extensions": [],                                       <
  "variants": []                                              <
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment