Skip to content

Instantly share code, notes, and snippets.

@bensig
Last active March 16, 2023 23:17
Show Gist options
  • Save bensig/cd42b714f43d59c7a5087a92fbd55ac5 to your computer and use it in GitHub Desktop.
Save bensig/cd42b714f43d59c7a5087a92fbd55ac5 to your computer and use it in GitHub Desktop.
Getting eosio.wrap working

Steps to get eosio.wrap working:

Generated a JSON of all producers and their perms - alphabetized:

[
    {
        "actor": "amsterdam",
        "permission": "active"
    },
    {
        "actor": "blocktime",
        "permission": "active"
    },
    {
        "actor": "blokcrafters",
        "permission": "active"
    },
    {
        "actor": "cryptobloks",
        "permission": "active"
    },
    {
        "actor": "cryptolions",
        "permission": "active"
    },
    {
        "actor": "cultureblock",
        "permission": "active"
    },
    {
        "actor": "detroit",
        "permission": "active"
    },
    {
        "actor": "draperx",
        "permission": "active"
    },
    {
        "actor": "echobasefour",
        "permission": "active"
    },
    {
        "actor": "edeniaedenia",
        "permission": "active"
    },
    {
        "actor": "eosphere",
        "permission": "active"
    },
    {
        "actor": "eosusa",
        "permission": "active"
    },
    {
        "actor": "fortisblocks",
        "permission": "active"
    },
    {
        "actor": "genereos",
        "permission": "active"
    },
    {
        "actor": "goodblock",
        "permission": "active"
    },
    {
        "actor": "heliosblocks",
        "permission": "active"
    },
    {
        "actor": "hotstart",
        "permission": "active"
    },
    {
        "actor": "interchainbp",
        "permission": "active"
    },
    {
        "actor": "libremt",
        "permission": "active"
    },
    {
        "actor": "librenodeone",
        "permission": "active"
    },
    {
        "actor": "libretech",
        "permission": "active"
    },
    {
        "actor": "quantum",
        "permission": "active"
    },
    {
        "actor": "rioblocks",
        "permission": "active"
    },
    {
        "actor": "sweden",
        "permission": "active"
    },
    {
        "actor": "teamgreymass",
        "permission": "active"
    },
    {
        "actor": "uberleap",
        "permission": "active"
    },
    {
        "actor": "zenhash",
        "permission": "active"
    },
    {
        "actor": "zuexeuz",
        "permission": "active"
    }
]

Generated a transaction - first got this hex data from bloks using the multisig tool and the command line account option:

libre.sh push transaction -s -j -d '{
                    "expiration": "2023-04-06T23:16:15",
                    "ref_block_num": 0,       
                    "ref_block_prefix": 0,
                    "max_net_usage_words": 0,
                    "max_cpu_usage_ms": 0,      
                    "delay_sec": 0,           
                    "context_free_actions": [],
                    "actions": [
                        {                       
                            "account": "eosio",
                            "name": "updateauth",
                            "authorization": [
                                {          
                                    "actor": "dao.libre",
                                    "permission": "owner"
                                }
                            ],             
                            "data": "000050f7b808a84900000000a8ed32320000000080ab26a70100000000020070a2b702ea305500000000a8ed32320100000050f7b808a84900804a1401ea3055010000"
                        },
                        {
                            "account": "eosio", 
                            "name": "updateauth",
                            "authorization": [
                                {
                                    "actor": "dao.libre",
                                    "permission": "owner"
                                }
                            ],
                            "data": "000050f7b808a8490000000080ab26a700000000000000000100000000010070a2b702ea305500000000a8ed3232010000"                                                                                                                                                                                                                     
                        }        
                    ],                                   
                    "transaction_extensions": []         
                } ' > update_dao_perms-trx.json

Edited the outputted json to:

  • set expiration to one month in future
  • ref_block_num and ref_block_prefix to 0,
  • removed "data"{} and everything inside of it
  • renamed "hex-data" to "data"
  • added "transaction_extensions": [],
{
  "expiration": "2023-04-16T00:00:00",
  "ref_block_num": 0,
  "ref_block_prefix": 0,
  "max_net_usage_words": 0,
  "max_cpu_usage_ms": 0,
  "delay_sec": 0,
  "context_free_actions": [],
  "actions": [
    {
      "account": "eosio",
      "name": "updateauth",
      "authorization": [
        {
          "actor": "dao.libre",
          "permission": "owner"
        }
      ],
      "data": "000050f7b808a84900000000a8ed32320000000080ab26a70100000000020070a2b702ea305500000000a8ed32320100000050f7b808a84900804a1401ea3055010000"
    },
    {
      "account": "eosio",
      "name": "updateauth",
      "authorization": [
        {
          "actor": "dao.libre",
          "permission": "owner"
        }
      ],
      "data": "000050f7b808a8490000000080ab26a700000000000000000100000000010070a2b702ea305500000000a8ed3232010000"
    }
  ],
  "transaction_extensions": [],
  "signatures": [],
  "context_free_data": []
}

Next, I was able to generate the wrap:

libre.sh wrap exec -s -j -d quantum update_dao_perms-trx.json > wrap_update_dao_perms-trx.json

Edited the outputted json again:

  • set expiration to a date one month in the future
  • ref_block_num and ref_block_prefix to 0,
  • removed "data"{} and everything inside of it
  • renamed "hex-data" to "data"
  • added "transaction_extensions": [],

Finally I was able to run:

libre.sh multisig propose_trx daopermfix libre-producer-perms.json wrap_update_dao_perms-trx.json quantum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment