首页 > 解决方案 > 更新代币智能合约

问题描述

我想更新我的代币智能合约,并将新代币发送给实际持有者。关于如何做到这一点的任何代码或想法?合约已部署,但我不知道如何将代币发送给实际持有者。另外,我如何才能将那些从新令牌中获取我们令牌的诈骗者列入黑名单?

标签: ethereumsoliditysmartcontracts

解决方案


部署合同后,除非您有某种机制来执行此操作,否则您将无法更改它。如果您当前的合同没有此条款,您将无能为力。但是,为了将来参考,您可以尝试这样的事情:

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)
    }
}



推荐阅读