迁移代码移除

迁移代码已经从MasterBreeder合约中移除。

// Set the migrator contract. Can only be called by the owner.
function setMigrator(IMigratorChef _migrator) public onlyOwner {
    migrator = _migrator;
}

// Migrate lp token to another lp contract. Can be called by anyone. We trust that migrator contract is good.
function migrate(uint256 _pid) public {
    require(address(migrator) != address(0), "migrate: no migrator");
    PoolInfo storage pool = poolInfo[_pid];
    BEP20 lpToken = pool.lpToken;
    uint256 bal = lpToken.balanceOf(address(this));
    lpToken.safeApprove(address(migrator), bal);
    IBEP20 newLpToken = migrator.migrate(lpToken);
    require(bal == newLpToken.balanceOf(address(this)), "migrate: bad");
    pool.lpToken = newLpToken;
}

在GitHub上面查看MasterBreeder合约:https://github.com/BenTokenFinance/benswapbch-contracts/blob/master/Contracts/MasterBreeder.sol

以及在Smartscout上面查看:https://www.smartscout.cash/address/0xDEa721EFe7cBC0fCAb7C8d65c598b21B6373A2b6

Last updated