ethereum - 更新代币智能合约
问题描述
我想更新我的代币智能合约,并将新代币发送给实际持有者。关于如何做到这一点的任何代码或想法?合约已部署,但我不知道如何将代币发送给实际持有者。另外,我如何才能将那些从新令牌中获取我们令牌的诈骗者列入黑名单?
解决方案
部署合同后,除非您有某种机制来执行此操作,否则您将无法更改它。如果您当前的合同没有此条款,您将无能为力。但是,为了将来参考,您可以尝试这样的事情:
contract SomeContract {
address public owner;
address public currentContract;
function SomeContract(address initContract){
currentVersion = initContract;
owner = msg.sender;
}
function update(address newAddress){
if(msg.sender != owner) throw;
currentVersion = newAddress;
}
function myFunction(){
currentContract.delegatecall(msg.data)
}
}
推荐阅读
- pytest - 如何根据每个测试将pytest的结果记录到多个日志文件中
- c++ - 如何将unicode字符串转换为cpp中的相应语言环境字符串
- javascript - 当我的元素到达屏幕底部时,如何停止 setInterval 函数?
- java - NoSuchBeanDefinitionException:没有“org.springframework.mail.MailSender”类型的合格bean
- php - 自动从 href 下载生成的 pdf
- arrays - Build 500 数组包含静态文本和变量
- html - 垂直对齐 2 列部分中的文本/按钮
- python-3.x - “系列的真值不明确” Python 3.X /Panda 中的错误
- android - 包含更多信息的 ADB 软件包列表
- html - Bootstrap 导航栏切换按钮无响应