Skip to content

Commit

Permalink
Support escape from smart contract to normal address
Browse files Browse the repository at this point in the history
  • Loading branch information
kikakkz committed Mar 28, 2023
1 parent b48a32d commit ff37d50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contracts/v0.1/OwnerActor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ contract OwnerActor is Controllable {
_miner.exist = true;
}

function escapeMiner(address newOwner) public onlyController {
function escapeMiner(uint64 newOwner) public onlyController {
require(_miner.exist, "Owner: there is no miner custodied");
require(newOwner != address(0), "Owner: new owner must set for the miner");
require(newOwner > 0, "Owner: new owner must set for the miner");
Miner.escape(_miner, newOwner);
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/v0.1/miner/Miner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ library Miner {
MinerAPI.changeOwnerAddress(actorId, ret1.proposed);
}

function escape(_Miner storage miner, address newOwner) public {
function escape(_Miner storage miner, uint64 newOwner) public {
CommonTypes.FilActorId actorId = CommonTypes.FilActorId.wrap(miner.minerId);
CommonTypes.FilAddress memory addr = FilAddresses.fromEthAddress(newOwner);
CommonTypes.FilAddress memory addr = FilAddresses.fromActorID(newOwner);
MinerAPI.changeOwnerAddress(actorId, addr);
}

Expand Down

0 comments on commit ff37d50

Please sign in to comment.