No funded issue found.
Check out the Issue Explorer
Be the OSS Funding you wish to see in the world.
Looking to fund some work? You can submit a new Funded Issue here .
Time left
Opened
Issue Type
Workers Auto Approve
Project Type
Time Commitment
Experience Level
Permissions
Accepted
Reserved For
Upgrade withdrawal functions
gridplus
cryptobridge-contracts, GridPlus, JavaScript, Solidity
This is a bounty associated with the `Relay.sol` contract. Currently, there are three functions that make up a full withdrawal:
1. [prepWithdraw](https://github.com/GridPlus/cryptobridge-contracts/blob/master/contracts/Bridge.sol#L237) makes a Merkle-Patricia proof given transaction data and saves a temporary `Withdrawal` struct to storage. This is the most expensive function because it stores several pieces of data.
2. [proveReceipt](https://github.com/GridPlus/cryptobridge-contracts/blob/master/contracts/Bridge.sol#L303) takes receipt data and forms a Merkle-Patricia proof. If successful, it saves the `receiptsRoot` for the block to storage.
3. [withdraw](https://github.com/GridPlus/cryptobridge-contracts/blob/master/contracts/Bridge.sol#L378) forms a standard Merkle proof given [modified] headers (they are modified by the cryptobridge client to contain a subset of the Ethereum header data). If successful, this triggers an ERC20 transfer and deletes the temporary `Withdrawal` struct associated with the sender.
This process takes about 500,000 gas and requires three transactions on the withdrawal chain. For the next version, I would like to cut that gas usage by as much as possible and reduce it down to one transaction. This is where you come in.
**Requirements:**
A successful proposal will do the following:
1. Reduce the gas consumption by a significant quantity
2. Reduce the number of withdrawal transactions from 3 to 1. If this cannot be done, it must show evidence of that. A reduction from 3 to 2 is also acceptable if there is evidence it cannot be reasonably reduced to 1.
3. Update the test cases in [bridge.js](https://github.com/GridPlus/cryptobridge-contracts/blob/master/test/bridge.js) to call the updated API with new data.
4. Update the [README](https://github.com/GridPlus/cryptobridge-contracts/blob/master/README.md) to reflect API changes
**Hints**
Any method to perform the above requirements is fine, but I would suggest looking at passing larger bytes arrays and slicing them with utility functions, perhaps in an external library. This would require a considerable rewrite of `prepWithdraw`, which has the arguments pre-sliced. For an example of bytes slicing, you can look at the way logs are sliced in `proveReceipt`.
Setup your profile
Tell us a little about you:
Skills
No results found for [[search]] .
Type to search skills..
Bio Required
[[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Next
Setup your profile
Our tools are based on the principles of earn (💰), learn (📖), and meet (💬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Back
Next
Save
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email:
Email
Back
Save