Closed smartcontracts closed 6 years ago
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
This issue now has a funding of 500.0 DAI (500.0 USD @ $1.0/DAI) attached to it.
@blocksoft-technologies Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
I'm still working...
After 7 days with no comment / WIP PR, this issue has returned to an open status on Gitcoin.
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
Work has been started.
These users each claimed they can complete the work by 3 months, 3 weeks from now. Please review their action plans below:
1) bakaoh has been approved to start work.
I think it's rather simple to implement as definition at https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-RLP , (port code from python to solidity) I will try to optimize the code using https://github.com/omisego/plasma-mvp/blob/master/plasma/root_chain/contracts/RLP.sol as reference. If everything go well, i may finish this issue this week.
Learn more on the Gitcoin Issue Details page.
Please take a look at my first version https://gist.github.com/bakaoh/0746cdbd749439798217b5b022faf906
I didn't test encodeList
function cause i don't know how to pass a bytes[] from web3.
Also mergeBytes
may need some optimize
@bakaoh This is awesome. I think some minor code cleanup/standardization and it's perfect!
@kfichter -- where should i put the contract? In https://github.com/omisego/plasma-mvp/tree/master/plasma/root_chain/contracts or a seperate repo?
Right in there is perfect, thank you!
@bakaoh Excited to see you here! I've approved you on Gitcoin. Good luck with it 😄
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
Work for 500.0 DAI (500.0 USD @ $1.0/DAI) has been submitted by:
@ceresstation please take a look at the submitted work:
Awesome job @bakaoh, the bounty has been paid out!
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
The funding of 500.0 DAI (500.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @bakaoh.
Issue Type
Current Behavior
We currently differ from the Plasma MVP spec by creating a simplified
deposit
function at the cost of a more complicatedwithdrawDeposit
addition. This should be removed, but requires that we be able to encode transactions on-chain.Suggested Fix
Solidity RLP Encoding Library
Description
RLP (Recursive Length Prefix) is a method for encoding arbitrarily nested arrays of binary data. You can learn more about RLP encoding here.
We’re using RLP to decode transactions for our Plasma MVP implementation. However, we’re also maintaining a simplified Plasma contract (as a learning resource) that could be made even simpler with an RLP encoding library written in Solidity.
Requirements
We’re looking for a relatively simple RLP encoding library. It doesn’t need to be hyper-optimized, but optimizations are always appreciated! You should look to the Ethereum RLP wiki page for a detailed spec of how RLP works.
RLP operates on arbitrary binary data. However, we’d like to be able to RLP encode typed objects in Solidity. Therefore, the contract should expose a few key functions:
encodeBytes(bytes memory self) internal pure returns (bytes)
encodeAddress(address self) internal pure returns (bytes)
encodeUint(uint self) internal pure returns (bytes)
encodeInt(int self) internal pure returns (bytes)
encodeBool(bool self) internal pure returns (bytes)
encodeList(bytes[] memory self) internal pure returns (bytes)
Note that
encodeList
does not need to recursively encode the contents of the list (you can assume they’re already encoded).Motivation for Change
We want to match the original Plasma MVP specification, and therefore need to remove
withdrawDeposit
.