Skip to content

Instantly share code, notes, and snippets.

@TrevorJTClarke
Created August 23, 2021 23:38
Show Gist options
  • Select an option

  • Save TrevorJTClarke/ec21de3956e4ded37983f4b0cd4c69dd to your computer and use it in GitHub Desktop.

Select an option

Save TrevorJTClarke/ec21de3956e4ded37983f4b0cd4c69dd to your computer and use it in GitHub Desktop.

Revisions

  1. TrevorJTClarke created this gist Aug 23, 2021.
    89 changes: 89 additions & 0 deletions sputnikv2-deploy.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,89 @@
    set -e
    NETWORK=mainnet
    OWNER=sputnik-dao.$NETWORK

    COUNCIL_ACC=CHANGE_ME.near
    export DAO_NAME=hack #mynewdao.sputnikv2.testnet

    ##Change NODE_ENV between mainnet, testnet and betanet
    export NODE_ENV=mainnet

    #DAO Policy
    export POLICY='{
    "roles": [
    {
    "name": "all",
    "kind": "Everyone",
    "permissions": [
    "*:AddProposal"
    ],
    "vote_policy": {}
    },
    {
    "name": "council",
    "kind": {
    "Group": [
    "hack.near",
    "agency.near",
    "tjtc.near",
    "metabuild.near"
    ]
    },
    "permissions": [
    "*:*"
    ],
    "vote_policy": {
    "Group": {
    "weight_kind": "RoleWeight",
    "quorum": "0",
    "threshold": [
    1,
    8
    ]
    }
    }
    },
    {
    "name": "hacker",
    "kind": {
    "Group": [
    "tjtc.near",
    "create.near",
    "devs.near"
    ]
    },
    "permissions": [
    "*:*"
    ],
    "vote_policy": {
    "Group": {
    "weight_kind": "RoleWeight",
    "quorum": "0",
    "threshold": [
    1,
    2
    ]
    }
    }
    }
    ],
    "default_vote_policy": {
    "weight_kind": "RoleWeight",
    "quorum": "0",
    "threshold": [
    1,
    2
    ]
    },
    "proposal_bond": "10000000000000000000000",
    "proposal_period": "604800000000000",
    "bounty_bond": "1000000000000000000000000",
    "bounty_forgiveness_period": "86400000000000"
    }'

    #Args for creating DAO in sputnik-factory2
    ARGS=`echo "{\"config\": {\"name\": \"testpolicy\", \"purpose\": \"Test DAO Policy\", \"metadata\":\"\"}, \"policy\": $POLICY}" | base64`

    # Call sputnik factory for deploying new dao with custom policy
    near call $OWNER create "{\"name\": \"$DAO_NAME\", \"args\": \"$ARGS\"}" --accountId $COUNCIL_ACC --amount 5 --gas 150000000000000
    near view $DAO_NAME.$OWNER get_policy