Replace require functions with custom errors
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- solidity
- Domain
- blockchain
Research direction
Start with the require check and error string shown in contracts/Manager.sol, then inspect the surrounding protocol contracts for similar checks. Review Solidity custom errors introduced in v0.8.4 and identify applicable replacements; done means preserving the existing failure behavior while reducing the gas cost of error handling.
Written by the indexing model from the issue text.
Description
Context
The protocol code-base is currently using require paired with fairly lengthy error strings, which end up being quite expensive from a gas perspective.
Proposal
Solidity has introduced custom errors since v0.8.4, which provide a cheaper alternative to throw exceptions. We can consider using them as a replacement to the current require checks.
- Dominant language
- JavaScript
- Stars
- 155
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from livepeer/protocol
-
known-issue
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Winning tickets can settle for less than their face value once the recipient’s reserve is exhausted Openknown-issue
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
blockchain enhancement pm
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
known-issue
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
known-issue
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in livepeer/protocol
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
curation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#186 ·
-
light
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aemdemos/patients-stryker#253 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
clerk/javascript#9852 ·