diff --git a/dir-ethereum/directory.sol b/dir-ethereum/directory.sol index c3adebddd..da32b773c 100644 --- a/dir-ethereum/directory.sol +++ b/dir-ethereum/directory.sol @@ -85,6 +85,7 @@ contract OrchidDirectory is IOrchidDirectory { uint128 delay_; address stakee_; + bytes data_; bytes32 parent_; Primary left_; @@ -103,7 +104,7 @@ contract OrchidDirectory is IOrchidDirectory { return stake.before_ + stake.after_ + stake.amount_; } - function scan(uint128 percent) public view returns (bytes32, address, uint128) { + function scan(uint128 percent) public view returns (bytes32, address, uint128, bytes memory) { require(!nope(root_)); uint128 point = uint128(have() * uint256(percent) / 2**128); @@ -121,7 +122,7 @@ contract OrchidDirectory is IOrchidDirectory { point -= stake.before_; if (point < stake.amount_) - return (key, stake.stakee_, stake.delay_); + return (key, stake.stakee_, stake.delay_, stake.data_); point -= stake.amount_; @@ -213,6 +214,16 @@ contract OrchidDirectory is IOrchidDirectory { } + function move(address stakee, bytes memory data) public { + address staker = msg.sender; + bytes32 key = name(staker, stakee); + Stake storage stake = stakes_[key]; + require(stake.amount_ != 0); + + stake.data_ = data; + } + + struct Pending { uint256 expire_; address stakee_;