 **Each weekday leading up to devcon2, Nexus will highlight a dapp, library, or package (something with a `dappfile`) as a promotion of our toolchain and as case studies for other developers. [Yesterday's Post](https://steemit.com/ethereum/@nikolai/dapp-a-day-5-easy-multisig)** `ds-token` is a framework for writing upgradeable tokens. It depends on [`ds-auth`](https://github.com/nexusdev/ds-auth) and implements [`erc20`](https://github.com/nexusdev/erc20). https://github.com/nexusdev/ds-token It achieves two seemingly opposing goals: * Keep the "interface" address fixed - don't burden consumers with your update logic (e.g. registry lookups or following an update chain). * Allow the behavior to be changed (with the ability to lock down, of course), and make it painless. This is done by splitting the token contract into 3: A "Frontend", a "Controller", and a "Datastore". These are all `DSAuth` (`DSAuthorized`), they look up to a `DSAuthority` for access control. The frontend has `erc20` function definitions as well as `emit*` event callback functions. The controller has implementations of the `erc20` functions extended to also accept the frontend's `msg.sender` as an argument (ERC20 semantics depend on msg.sender). The datastore holds all app state and has only dumb getters and setters and makes logic updates significantly easier. This design is partially an artifact of the days before `DELEGATECALL` and usable libraries, which could arguably reduce this to a 2-contract system. But still, separating the entrypoint and logic controller makes me less nervous about accidentally butchering state. There is a DSToken "installer" (a "smart factory") which instantiates a token that is functionally equivalent to ERC20Base. It installs a token "into" an existing `DSBasicAuthority`. With `ds-token` under our belt, we can explore applications that *use* tokens as well as applications that *are* tokens. Wow, coins!
author | nikolai |
---|---|
permlink | dapp-a-day-6-upgradeable-tokens |
category | ethereum |
json_metadata | {"tags":["ethereum","dapp","blockchain","cryptocurrency"],"image":["https://i.imgur.com/JoJ8cXZ.png"]} |
created | 2016-08-15 14:56:09 |
last_update | 2016-08-15 14:57:42 |
depth | 0 |
children | 3 |
last_payout | 2016-09-15 18:28:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 50.795 HBD |
curator_payout_value | 16.606 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,991 |
author_reputation | 9,571,877,600,096 |
root_title | "Dapp-a-day 6: Upgradeable Tokens" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 817,896 |
net_rshares | 18,974,408,119,279 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
anonymous | 0 | 28,851,404,738 | 1% | ||
summon | 0 | 14,954,015,536,907 | 100% | ||
boy | 0 | 3,084,952,552 | 100% | ||
xeroc | 0 | 1,975,717,284,299 | 100% | ||
bue-witness | 0 | 3,744,099,613 | 100% | ||
bunny | 0 | 708,916,690 | 100% | ||
bue | 0 | 52,162,307,417 | 100% | ||
mini | 0 | 1,653,744,064 | 100% | ||
moon | 0 | 213,265,420 | 100% | ||
cass | 0 | 870,177,921,624 | 100% | ||
healthcare | 0 | 613,500,608 | 100% | ||
daniel.pan | 0 | 883,033,583 | 100% | ||
nexusdev | 0 | 1,459,180,114 | 100% | ||
helen.tan | 0 | 287,496,994 | 100% | ||
nikolai | 0 | 19,475,980,699 | 100% | ||
addisdev | 0 | 530,353,315 | 100% | ||
hipster | 0 | 993,888,901,581 | 100% | ||
murh | 0 | 1,450,594,023 | 33.01% | ||
crypton | 0 | 3,379,051,883 | 100% | ||
dbrock | 0 | 345,816,972 | 100% | ||
ssstand | 0 | 413,169,597 | 100% | ||
ben99 | 0 | 740,833,531 | 100% | ||
t-winters | 0 | 21,587,551,648 | 100% | ||
ryvirath | 0 | 334,524,701 | 100% | ||
perwest | 0 | 6,246,018,209 | 100% | ||
legion | 0 | 395,135,459 | 100% | ||
trytobezen | 0 | 5,794,270,174 | 100% | ||
gagecolton | 0 | 11,048,520,303 | 100% | ||
dob | 0 | 318,575,934 | 100% | ||
rune | 0 | 189,566,376 | 100% | ||
raphma | 0 | 459,383,001 | 100% | ||
jumpman | 0 | 1,047,292,312 | 100% | ||
littlekitty | 0 | 1,246,563,264 | 100% | ||
sunshine | 0 | 10,259,934,868 | 100% | ||
achim86 | 0 | 308,551,544 | 100% | ||
romancs | 0 | 557,773,636 | 100% | ||
stevenh512 | 0 | 94,332,952 | 100% | ||
frankhold | 0 | 58,028,984 | 100% | ||
zandy | 0 | 57,951,851 | 100% | ||
funkywanderer | 0 | 497,671,741 | 100% | ||
wereyeji | 0 | 54,087,652 | 100% | ||
isafuchs | 0 | 55,038,446 | 100% | ||
hilalh | 0 | 0 | 100% |
http://www.mikrocontroller.net/attachment/68905/thanks-for-the-info.jpg
author | achim86 |
---|---|
permlink | re-nikolai-dapp-a-day-6-upgradeable-tokens-20160815t150150349z |
category | ethereum |
json_metadata | {"tags":["ethereum"],"image":["http://www.mikrocontroller.net/attachment/68905/thanks-for-the-info.jpg"]} |
created | 2016-08-15 15:00:54 |
last_update | 2016-08-15 15:00:54 |
depth | 1 |
children | 0 |
last_payout | 2016-09-15 18:28:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 71 |
author_reputation | 46,760,156,630,779 |
root_title | "Dapp-a-day 6: Upgradeable Tokens" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 817,969 |
net_rshares | 308,551,544 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
achim86 | 0 | 308,551,544 | 100% |
Thanks, this will help to understand more about the "token" concept and how to achieve some bindings to a "Mothercoin"
author | bitcoinsulting |
---|---|
permlink | re-nikolai-dapp-a-day-6-upgradeable-tokens-20160816t150733226z |
category | ethereum |
json_metadata | {"tags":["ethereum"]} |
created | 2016-08-16 15:07:33 |
last_update | 2016-08-16 15:07:33 |
depth | 1 |
children | 0 |
last_payout | 2016-09-15 18:28:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 118 |
author_reputation | 619,517,583,858 |
root_title | "Dapp-a-day 6: Upgradeable Tokens" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 835,450 |
net_rshares | 0 |
<div> <p> This post has been linked to from another place on Steem. </p> <ul> <li> <a href="https://steemit.com/ethereum/@nexusdev/dapp-a-day-16-ds-burner"> Dapp-a-day 16: DS-burner </a> by <a href="https://steemit.com/@nexusdev"> @nexusdev </a> </li> <li> <a href="https://steemit.com/ethereum/@dbrock/dapp-a-day-16"> Dapp-a-day 16 </a> by <a href="https://steemit.com/@dbrock"> @dbrock </a> </li> <li> <a href="https://steemit.com/ethereum/@nexusdev/dapp-a-day-13-solidity-quirks"> Dapp-a-day 13: Solidity Quirks </a> by <a href="https://steemit.com/@nexusdev"> @nexusdev </a> </li> <li> <a href="https://steemit.com/ethereum/@nexusdev/dapp-a-day-12-ds-base"> Dapp-a-day 12: DSBase – a reasonable base class </a> by <a href="https://steemit.com/@nexusdev"> @nexusdev </a> </li> <li> <a href="https://steemit.com/ethereum/@nexusdev/dapp-a-day-11-whitelist-boring"> Dapp-a-day 11: Whitelist (Boring!) </a> by <a href="https://steemit.com/@nexusdev"> @nexusdev </a> </li> </ul> <p> Learn more about <a href="https://steemit.com/steem/@ontofractal/steem-linkback-bot-v0-3-released"> linkback bot v0.3</a> </p> <p>Upvote if you want the bot to continue posting linkbacks for your posts. Flag if otherwise. Built by @ontofractal</p></div>
author | linkback-bot-v0 |
---|---|
permlink | re-nikolai-dapp-a-day-6-upgradeable-tokens-linkbacks |
category | ethereum |
json_metadata | {} |
created | 2016-09-10 19:45:57 |
last_update | 2016-09-10 19:45:57 |
depth | 1 |
children | 0 |
last_payout | 2016-09-15 18:28:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,389 |
author_reputation | 1,915,954,976,722 |
root_title | "Dapp-a-day 6: Upgradeable Tokens" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,199,947 |
net_rshares | 0 |