The two DAOs created by this test rehearsal can be found here:
The bonding curve for the test DAO is open here:
We will go through all the steps we used to create them and do the migration of the tokens and the funds.
Create the DAOs
We create one DAO for TEC and another one for the Reputation Board. We have to separate the DAO creation in two scripts due to a bug in EVMcrispr.
load aragonos as ar
ar:new-dao testtec # It will be just "tec"
load aragonos as ar
ar:new-dao testtecrep # It will be just "tecrep"
Reassign permissions
We have to run these transactions so the DAO can be configured from the TEC Guardians DAO.
load aragonos as ar
switch optimism
# DAOs
set $guardians sem # tecguardians
set $dao testtec # tec
set $reputationDAO testtecrep #tecrep
ar:connect $guardians (
set $tm token-manager
ar:connect $dao (
grant $tm kernel APP_MANAGER_ROLE @me
revoke @me kernel APP_MANAGER_ROLE false
exec acl setPermissionManager $tm kernel @id(APP_MANAGER_ROLE)
grant $tm acl CREATE_PERMISSIONS_ROLE @me
revoke @me acl CREATE_PERMISSIONS_ROLE false
exec acl setPermissionManager $tm acl @id(CREATE_PERMISSIONS_ROLE)
)
ar:connect $reputationDAO (
grant $tm kernel APP_MANAGER_ROLE @me
revoke @me kernel APP_MANAGER_ROLE false
exec acl setPermissionManager $tm kernel @id(APP_MANAGER_ROLE)
grant $tm acl CREATE_PERMISSIONS_ROLE @me
revoke @me acl CREATE_PERMISSIONS_ROLE false
exec acl setPermissionManager $tm acl @id(CREATE_PERMISSIONS_ROLE)
)
)
Create the tokens
We create the three tokens involved (TEC, rTEC, and TECRB) in one transaction separated from the rest of the architecture because otherwise we had out of gas errors.
# **Important:** Remove "Test" from the names when done for real
load aragonos as ar
switch optimism
# DAOs
set $guardians sem # tecguardians
set $dao testtec # tec
set $reputationDAO testtecrep #tecrep
ar:connect $guardians token-manager (
ar:connect $reputationDAO (
new-token "Test TEC Reputation Board" TECRB token-manager:tecrb 0 false
install token-manager:tecrb token:TECRB false 0
)
ar:connect $dao (
new-token "Test Token Engineering Commons" TEC token-manager:contribution
install token-manager:contribution token:TEC true 0
new-token "Test TEC Reputation" rTEC token-manager:reputation
install token-manager:reputation token:rTEC false 0
)
)
Install the apps and set the permissions
In this transaction we configure the TEC main DAO and the Reputation Sub-DAO.
After this transaction there is no minted TEC tokens and the bonding curve is closed. The Guardians DAO (controlled by the Migration Team) has permissions to mint TEC and open the bonding curve, and it is what they are going to do with the following two votes.
load aragonos as ar
switch optimism
set $token.tokenlist https://token-list.sushi.com
# DAOs
set $guardians sem # tecguardians
set $dao testtec # tec
set $reputationDAO testtecrep #tecrep
# Tokens
set $aggregatedTokenName "TEC Power"
set $aggregatedTokenSymbol TECPOW
set $contributionPower 95 # Reputation power is (100 - $contributionPower)%
set $fundingToken @token(DAI)
# Governance Voting
set $governanceVotingFee 40e18 # DAO tokens
set $governanceVotingTime 5d
set $governanceVotingSupport 85e16
set $governanceVotingQuorum 10e16
set $governanceVotingDelegatedPeriod 3d
set $governanceVotingQuietEndingPeriod 3d
set $governanceVotingQuietEndingExtension 2d
set $governanceVotingDelay 1d
# Budget Voting
set $budgetVotingFee 40e18 # DAO tokens
set $budgetVotingTime 5d
set $budgetVotingSupport 85e16
set $budgetVotingQuorum 10e16
set $budgetVotingDelegatedPeriod 3d
set $budgetVotingQuietEndingPeriod 3d
set $budgetVotingQuietEndingExtension 2d
set $budgetVotingDelay 1d
# Augmented Bonding Curve
set $abcFormula 0x29c7e9fff64bde42faa6e8c0567a15290f7d948b
set $abcEntryTribute 2e16
set $abcExitTribute 12e16
set $abcReserveToken @token(rETH)
set $abcReserveRatio 20e4
# Reputation Board DAO
set $boardSupport 81e16
set $boardQuorum 41e16
set $boardTime 1d
ar:connect $guardians token-manager (
set $guardiansTM token-manager
set $guardiansVoting voting
ar:connect $dao (
# Retreive Contribution-Based Token
set $contributionTM token-manager
set $contributionToken token-manager::token()
# Retreive Reputation-Based Token
set $reputationTM token-manager:1
set $reputationToken token-manager:1::token()
# Install and Configure Voting Aggregator
install vote-token-aggregator.open:new $aggregatedTokenName $aggregatedTokenSymbol 18
set $votingAggregator vote-token-aggregator.open:new
grant $guardiansTM $votingAggregator ADD_POWER_SOURCE_ROLE $guardiansTM
exec $votingAggregator addPowerSource $contributionToken 1 $contributionPower
exec $votingAggregator addPowerSource $reputationToken 1 (100 - $contributionPower)
revoke $guardiansTM $votingAggregator ADD_POWER_SOURCE_ROLE true
# Install Agents
install agent:reserve
install agent:common-pool
set $reserve agent:reserve
set $commonPool agent:common-pool
# Install Tollgates
install tollgate.open:governance $contributionToken $governanceVotingFee $commonPool
install tollgate.open:budget $contributionToken $budgetVotingFee $commonPool
set $tollgateGov tollgate.open:governance
set $tollgateBudget tollgate.open:budget
# Install Tao Votings
install blossom-tao-voting.open:governance $votingAggregator $governanceVotingTime $governanceVotingSupport $governanceVotingQuorum $governanceVotingDelegatedPeriod $governanceVotingQuietEndingPeriod $governanceVotingQuietEndingExtension 0 NO_ENTITY
set $votingGov blossom-tao-voting.open:governance
install blossom-tao-voting.open:budget $votingAggregator $budgetVotingTime $budgetVotingSupport $budgetVotingQuorum $budgetVotingDelegatedPeriod $budgetVotingQuietEndingPeriod $budgetVotingQuietEndingExtension 0 $votingGov
set $votingBudget blossom-tao-voting.open:budget
# Install Delays
install an-delay.open:governance $governanceVotingDelay $fundingToken 0 $commonPool
install an-delay.open:budget $budgetVotingDelay $fundingToken 0 $commonPool
set $delayGov an-delay.open:governance
set $delayBudget an-delay.open:budget
# Install Finance
install finance:new $commonPool 30d
# Install ABC
install augmented-bonding-curve.open:abc $contributionTM $abcFormula $reserve $commonPool $abcEntryTribute $abcExitTribute
set $abc augmented-bonding-curve.open:abc
grant $guardiansTM $abc MANAGE_COLLATERAL_TOKEN_ROLE $guardiansTM
exec $abc addCollateralToken $abcReserveToken 1 1 $abcReserveRatio
revoke $guardiansTM $abc MANAGE_COLLATERAL_TOKEN_ROLE true
# Configure permissions
grant $tollgateGov $votingGov CREATE_VOTES_ROLE $delayGov
grant $tollgateBudget $votingBudget CREATE_VOTES_ROLE $delayGov
grant $votingGov $delayGov DELAY_EXECUTION_ROLE $delayGov
grant $votingBudget $delayBudget DELAY_EXECUTION_ROLE $delayGov
grant $guardiansTM $delayGov CANCEL_EXECUTION_ROLE $delayGov
grant $guardiansTM $delayBudget CANCEL_EXECUTION_ROLE $delayGov
grant $guardiansTM $delayGov PAUSE_EXECUTION_ROLE $delayGov
grant $guardiansTM $delayBudget PAUSE_EXECUTION_ROLE $delayGov
grant $guardiansTM $delayGov RESUME_EXECUTION_ROLE $delayGov
grant $guardiansTM $delayBudget RESUME_EXECUTION_ROLE $delayGov
grant $delayBudget finance:new CREATE_PAYMENTS_ROLE $delayGov
grant finance:new $commonPool TRANSFER_ROLE $delayGov
grant $delayGov $reserve EXECUTE_ROLE $delayGov
grant $delayGov $reserve RUN_SCRIPT_ROLE $delayGov
grant $delayBudget $commonPool EXECUTE_ROLE $delayGov
grant $delayBudget $commonPool RUN_SCRIPT_ROLE $delayGov
grant $delayGov $tollgateGov CHANGE_AMOUNT_ROLE $delayGov
grant $delayGov $tollgateBudget CHANGE_AMOUNT_ROLE $delayGov
grant $delayGov kernel APP_MANAGER_ROLE $delayGov
grant $delayGov acl CREATE_PERMISSIONS_ROLE $delayGov
# Guardians will "open" the ABC in a later step
grant ETH $abc MAKE_BUY_ORDER_ROLE $guardiansVoting
grant ETH $abc MAKE_SELL_ORDER_ROLE $guardiansVoting
grant $abc $contributionTM MINT_ROLE $guardiansVoting
grant $abc $contributionTM BURN_ROLE $guardiansVoting
grant $abc $reserve TRANSFER_ROLE $delayGov
ar:connect $reputationDAO (
install voting:tecrb token-manager::token() $boardSupport $boardQuorum $boardTime
install agent:tecrb
install finance:tecrb agent:tecrb 30d
set $tmTECRB token-manager
set $votingTECRB voting:tecrb
set $agentTECRB agent:tecrb
set $financeTECRB finance:tecrb
grant $delayGov $tmTECRB MINT_ROLE $delayGov
grant $delayGov $tmTECRB BURN_ROLE $guardiansTM
grant $votingTECRB $tmTECRB BURN_ROLE $guardiansTM
exec acl setPermissionManager $delayGov $tmTECRB @id(BURN_ROLE)
grant $tmTECRB $votingTECRB CREATE_VOTES_ROLE $delayGov
grant $votingTECRB $financeTECRB CREATE_PAYMENTS_ROLE $delayGov
grant $financeTECRB $agentTECRB TRANSFER_ROLE $delayGov
exec acl revokePermission $guardiansTM kernel @id(APP_MANAGER_ROLE)
exec acl revokePermission $guardiansTM acl @id(CREATE_PERMISSIONS_ROLE)
exec acl setPermissionManager $delayGov kernel @id(APP_MANAGER_ROLE)
exec acl setPermissionManager $delayGov acl @id(CREATE_PERMISSIONS_ROLE)
)
grant $votingTECRB $reputationTM MINT_ROLE $delayGov
grant $votingTECRB $reputationTM BURN_ROLE $delayGov
exec acl revokePermission $guardiansTM kernel @id(APP_MANAGER_ROLE)
exec acl revokePermission $guardiansTM acl @id(CREATE_PERMISSIONS_ROLE)
exec acl setPermissionManager $delayGov kernel @id(APP_MANAGER_ROLE)
exec acl setPermissionManager $delayGov acl @id(CREATE_PERMISSIONS_ROLE)
)
)
TEC minting vote(s)
The Migration Team will use the Guardians DAO to mint TECs for every frozen TEC on an externally owned addresses on Gnosis. They will also distribute the TEC held by contracts at the moment of migration according to the strategies discussed previously by the community.
They will use this vote structure to mint TEC to the ~700 token holders:
load aragonos as ar
switch optimism
# DAOs
set $guardians sem # tecguardians
set $dao testtec # tec
ar:connect $guardians token-manager voting (
set $guardiansVoting voting
ar:connect $dao (
grant $guardiansVoting token-manager MINT_ROLE $guardiansVoting
# This will be populated by addresses and amounts.
# For the dress rehearsal we only mint for two addresses.
exec token-manager mint 0xf632Ce27Ea72deA30d30C1A9700B6b3bCeAA05cF 1000e18
exec token-manager mint 0xcf79C7EaEC5BDC1A9e32D099C5D6BdF67E4cF6e8 1000e18
# ...
revoke $guardiansVoting token-manager MINT_ROLE false
)
)
Funds transfer and Bonding Curve enabling
After checking that all the tokens have been minted correctly, the migration team will use the Guardians DAO to send the funds to the common pool and the reserve, and open the bonding curve, removing itself as the permission manager for the permissions it holds.
# **Important:** set the amount of transferred funds properly!
load aragonos as ar
switch optimism
set $token.tokenlist https://token-list.sushi.com
# DAOs
set $guardians sem # tecguardians
set $dao testtec # tec
ar:connect $dao (
set $reserve agent
set $commonPool agent:1
)
print "Reserve: " $reserve
print "Common Pool: " $commonPool
ar:connect $guardians token-manager voting (
set $guardiansVoting voting
# transfer funds to the common pool
exec finance newImmediatePayment @token(DAI) $commonPool 0.01e18 "transfer common pool funds"
# transfer funds to the reserve
exec finance newImmediatePayment @token(rETH) $reserve 0.00001e18 "transfer reserve funds"
connect $dao (
set $tm token-manager
set $abc augmented-bonding-curve.open
set $governanceVotingDelay an-delay.open
# allow buy and sell in the bonding curve and transfer their permission manager to the dao
revoke ETH $abc MAKE_SELL_ORDER_ROLE false
revoke ETH $abc MAKE_BUY_ORDER_ROLE false
grant ANY_ENTITY $abc MAKE_SELL_ORDER_ROLE $guardiansVoting
grant ANY_ENTITY $abc MAKE_BUY_ORDER_ROLE $guardiansVoting
exec acl setPermissionManager $governanceVotingDelay $abc @id(MAKE_SELL_ORDER_ROLE)
exec acl setPermissionManager $governanceVotingDelay $abc @id(MAKE_BUY_ORDER_ROLE)
# transfer token manager's MINT and BURN permission manager to the dao
exec acl setPermissionManager $governanceVotingDelay $tm @id(MINT_ROLE)
exec acl setPermissionManager $governanceVotingDelay $tm @id(BURN_ROLE)
)
)
Payment to the Migration Team
We can use this vote to test that the DAO is functional:
# **Important:** Set the payment amount properly!
load aragonos as ar
set $token.tokenlist https://token-list.sushi.com
# DAOs
set $guardians sem # tecguardians
set $dao testtec # tec
ar:connect $guardians (
set $beneficiary agent
)
ar:connect $dao tollgate.open:1 blossom-tao-voting.open:1 (
exec finance newImmediatePayment @token(DAI) $beneficiary 0.01e18 "pay the migration team"
set $voting blossom-tao-voting.open:1
)
We simulated this budget vote (plus a governance one) to check that the votes are executable and can also be cancelled by guardians.
With all these tests, we are consider that we are ready to migrate TEC to Optimism tomorrow.