关灯

OpenZeppelin crowdsale token ownership

  [复制链接]
区块链技术 发表于 2019-1-1 11:51:16 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x

Using the non-modified OpenZeppelin code to create a mintable and burnable ERC20 token and a crowdsale contract, once ownership of the token is transferred to the crowdsale contract, is it possible to transfer ownership of the token again? If not, will it be possible to ever mint new tokens in the future? I want to ensure that once token ownership is transferred to the crowdsale contract and the crowdsale ends, it will never be possible to mint new tokens. I looked through the related questions, but could not find a definite answer relating to a non-modified implementation of the OpenZeppelin code.




上一篇:Stream ethereum (ERC20) transactions (node.js)
下一篇:ERC-20 Token Transfer Error : Bad jump destination
版权申明:此文如未标注转载均为本站原创,自由转载请注明 本贴地址:https://xuesq.cn/thread-109453-1-1.html 上篇帖子: 《时间的朋友》金句记录 下篇帖子: 加密货币2018清零2019继续追梦 token ownership
回复

使用道具 举报

 

精彩评论2

正序浏览
区块链技术 发表于 2019-1-1 12:05:46 | 显示全部楼层
 

Once ownership of the token is transferred to the crowdsale contract, is it possible to transfer ownership of the token again?

Depends on how you code your crowdsale contract. If there is no such function defined to change ownership back a contract or any EOAs, you can not change ownership.

If not, will it be possible to ever mint new tokens in the future?

Since you are transferring ownership to the crowdsale contract. Only that contract should be able to mint tokens. You can impose a condition on when you want to stop minting.

I want to ensure that once token ownership is transferred to the crowdsale contract and the crowdsale ends, it will never be possible to mint new tokens.

You can have modiefied conditions as per you requirement. OpenZepplin is a standard implement, if you want to have custom features, you can alway modify the smart contracts to fullfill your need. For eg, in you case you can have a function that mints token to users account

bool isICOClosed; // can be when hard cap is reached or ICO end time is over

function mintTokenToUser(address user, uint value) internal {
  // add a condition that mint in not possible if ICO is conpleted
  require( !isICOClosed);
  _token.mint(user, value);
}
回复

使用道具 举报

 
 楼主| 区块链技术 发表于 2019-1-1 12:12:39 | 显示全部楼层
 

In Mintable.sol - 外链无效

contract ERC20Mintable is ERC20, MinterRole

In MinterRole.sol - 外链无效

near line 30, function renounceMinter() public {

You can pursue that further. You will see that Role.sol only allows a Minter to renounce it's own Minter role.

Using the "unmodified" CrowdSale, you would deploy a token and the Minter role would be assigned to the address that deployed the contract. Then, you would mint some tokens to yourself, deploy a CrowdSale and transfer some of your tokens to the CrowdSale. There is initially nothing stopping you from creating more tokens (and everyone can see that).

When the sale is over or your finished Minting and you want to demonstrate that you can no longer issue new tokens, you would sign a transaction to the renounceMinter() function in the Mintable token.

Hope it helps.

回复

使用道具 举报

 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

排行榜

关注我们:微信订阅号

官方微信

APP下载

全国服务邮箱:

admin@xuesq.cn

公司地址:重庆南岸区学府大道

运营中心:重庆微生派网络工作室

邮编:610066 Email:1401171837#qq.com

Copyright   ©2017-2018  中比特Powered by©xuesq.cn!技术支持:中比特    ( 蜀ICP备16009247号-1 )