Token Wrapper
This app will enable you to convert a regular ERC20 token into a checkpointed ERC20 token, thus making it compatible with the Voting App, Disputable Voting App, and Vote Aggregator App.
The Token Wrapper was built by Aragon One and is used by DAOs as important as Decentraland or Aragon itself.
Installing the Appβ
The syntax is as follows to install this app:
install token-wrapper.open:new <depositToken> <tokenName> <tokenSymbol>
You'll need the following parameters to install a new Token Wrapper to your DAO:
depositToken
- The address of the ERC20 token that will be "wrapped" into a checkpointed ERC20 token.
tokenName
- The name of the token you wish to create.
tokenSymbol
- The symbol you wish to set for the token.
Common Usage Exampleβ
An example of how to install this app is as follows:
load aragonos as ar
ar:connect exampleDAO token-manager voting (
install blossom-token-wrapper.open:new @token(HNY) "Wrapped Honey Token" "wHNY"
)
This command will install a new instance of the Token Wrapper app into the specified Aragon DAO. It will only accept deposits of HNY tokens and will return Wrapped Honey Tokens with a token symbol of WHNY.
tip
Tokens generated by the new-token
command are MiniMe Tokens that are already checkpointing every transfer, so they do not need to be wrapped, as they have the functions required to be used as Voting app tokens.
Installing Different App Versions
install <appName> [parameters...] --version <versionNumber>
For example:
install voting:new @token(HNY) 90e16 20e16 3d --version 1.0.0
It would install a new Voting app, using version 1.0.0, with HNY as the voting token, 90% support required, 20% quorum, and three days vote duration.
Permissionsβ
The Token Wrapper app has no permissions; however, if you want to see the frontend in the Aragon Client, you need to set at least one permission. You can create a DUMMY_ROLE using the following command:
exec acl createPermission ANY_ENTITY blossom-token-wrapper.open @id(DUMMY_ROLE) voting
Internal Actionsβ
Using the exec
command, we can create internal actions that will modify the settings of our app.
Below is an exhaustive list of all possible internal actions you can perform with the Token Wrapper app. In addition, we will identify the function in the contract and outline any parameters and permissions you need and the expected syntax to run them.
deposit
Parametersβ
amount
- The number of tokens you wish to deposit into the Token Wrapper. (uint256)
Syntaxβ
exec blossom-token-wrapper.open deposit <amount>
Usage Exampleβ
load aragonos as ar
ar:connect exampleDAO (
exec blossom-token-wrapper.open::depositedToken() approve(address,uint256) blossom-token-wrapper.open 100e18
exec blossom-token-wrapper.open deposit 100e18
)
This script will wrap 100 of the deposit tokens into the Token Wrapper. It will only work if the token has already been approved.
withdraw
Parametersβ
amount
- The number of tokens you wish to withdraw from the Token Wrapper. (uint256)
Syntaxβ
exec blossom-token-wrapper.open withdraw <amount>
Usage Exampleβ
load aragonos as ar
ar:connect exampleDAO (
exec blossom-token-wrapper.open withdraw 100e18
)
This script will withdraw 100 deposit tokens from the Token Wrapper and burn their wrapped tokens counterpart.