- Review clippy warnings; most of the time these are benign or irrelevant, but they can help spotting red flags.
- Build and run all the unit tests, assess the code coverage and keep note of the un(der)tested component.
- Review the dependencies listed in Cargo.toml and Cargo.lock: Will the latest version be used? (preferable but not always the right choice) Are these established, trustworthy packages? You may use the subcommand cargo-audit (thanks @dues__ for the pointer).
- Look for unsafe code blocks, and evaluate the risk (can an attacker control the input used in these blocks? etc.)
- Look for risky uses of unwrap(), which can cause panics, as opposed to pattern-matched error
Start with these resources
- https://ethresear.ch/t/on-chain-scaling-to-potentially-500-tx-sec-through-mass-tx-validation/3477 - Vitalik
- Despite this being a ZK focused approach, and only supporting deposit/withdraw/send/receive, it’s nicely laidout as a starting point
- https://ethresear.ch/t/minimal-viable-merged-consensus/5617 - John Adler
- I think this is the first description of the optimistic model
- https://medium.com/@adlerjohn/the-why-s-of-optimistic-rollup-7c6a22cbb61a - John Adler
- This article focuses a bit less on the mechanics, and more on the beneficial properties.
To help us get the most from the call, could you please include a point form agenda on the invite:
- The main topic
- Objective/desired outcome
Please also include following items if they feel relevant:
- Context
- Why now? What is the impetus for this meeting?
- What information or orther background will help us achieve the outcome?
pragma solidity ^0.5.0; | |
contract Foo { | |
ERC20 e20; | |
ERC20NoReturn e20NoReturn; | |
constructor() public { | |
// deploy both tokens | |
e20 = new ERC20(); |
The following is an informal compendium of ways you can screw up when mixing and matching smart contracts:
- Be aware of front running on changes to the
allowed
value. - Be aware that some tokens don't return a boolean on success or failure.
- Some token balances change overtime, even without a transfer.
- Use
balanceOf(addr)
over internal accounting. (https://medium.com/trustless-fund/atoken-withdrawal-vulnerability-disclosure-5d8eadc64539)
pragma solidity ^0.6.0; | |
contract Test { | |
uint public immutable something = 20; | |
constructor() public { | |
something = block.timestamp; | |
// TypeError: Immutable state variable already initialized. | |
// something = block.timestamp; | |
// ^-------^ |
Not sure which Gitcoin grants you want to support? We've curated a list of great projects to make it easy for you to decide AND make your donations go even further.
The Hashing it Out podcast, with support from Status.im and ConsenSys Diligence has organized a Staking Cluster, giving us access to a whole bunch of the PAN tokens allocated to this round of Gitcoin Grants. In total the HiO community has 29% of a pool of 1,424,551 PAN tokens (worth ~$50,000). (Learn more in episode 83 with Panvala Founder Niran Babalola)
When you donate with PAN tokens to any of the grants we've selected, your donation will receiving matching funds from the new Panvala issuance. The current multiplier is over 5x!
Token | Feature | Known Vulnerabilities | Resources | Examples |
---|---|---|---|---|
ERC20 | Allowance | Double withdrawal (front-running) |
Starting on L2:
- Any account on L2 may call
OVM_L2CrossDomainMessenger.sendMessage()
with the information for the L1 message (akaxDomainCalldata
)- (ie.
_target
,msg.sender
,_message
) - This data is hashed with the
messageNonce
storage variable, and the hash is store in thesentMessages
mapping (this is not actually used AFAIK) - The
messageNonce
is then incremented.
- (ie.
- The
OVM_L2CrossDomainMessenger
then passes thexDomainCalldata
toOVM_L2ToL1MessagePasser.passMessageToL1()
- the
xDomainCalldata
is hashed withmsg.sender
(ie.ovmCaller
), and written to thesentMessages
mapping.
✅