更新令牌智能合约

问题描述 投票:0回答:1

我想更新我的代币智能合约,并希望将新代币发送给实际持有者。有关如何执行此操作的任何代码或想法?已部署合同,但我不知道如何将令牌发送给实际持有人。另外,我该如何将那些从新令牌中获得我们令牌的骗子列入黑名单?

ethereum solidity smartcontracts
1个回答
0
投票

一旦部署了合同,除非有某种机制可以执行,否则您将无法更改它。如果您当前的合同没有此内容,那么您将无能为力。但是,为了将来参考,您可以尝试执行以下操作:

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


© www.soinside.com 2019 - 2024. All rights reserved.