Closed 4000D closed 6 years ago
We're currently thinking about creating a different type of deposit transaction to avoid having to do this encoding on chain and reduce the gas cost in general. The deposit root would be calculated somewhat like this:
/**
* @dev Calculates the block root for a deposit transaction
* @param depositor Address of the depositor
* @param amount Amount deposited
* @return The root to be used for the deposit block
*/
function calculateDepositRoot(address depositor, uint256 amount)
private
view
returns (bytes32)
{
bytes32 root = keccak256(depositor, amount);
for (uint256 i = 0; i < 16; i++) {
root = keccak256(root, zeroHashes[i]);
}
return root;
}
This means that an exitor just needs to send the amount
when exiting from a deposit.
Closing in favor of #72 which modified deposits so that deposit blocks are represented as keccak256(msg.sender, msg.value)
.
With RLPEncode library, we can make plasma transaction in RootChain contract removing
txBytes
parameter at deposit().