B008: A Map to the Dark Forest

Uniswap V2: Liquidity Provision

With the increase in forks, we have seen multiple projects utilize Uniswap as a means to introduce novel liquidity-based tokens and systems that attempt to incentivize or disincentivize users in the liquid market dynamics. A prime example of this are SafeMoon forks that provide a way for their smart contract to re-circulate accumulated fees as liquidity provided within the Uniswap pool.

SafeMoon: Offending Code
Fixed SafeMoon Code

Chainlink: Latest Price Retrieval

One other relatively unknown integration instruction that is supplied slightly obscurely in the Chainlink documentation is validating a reported price’s stale-ness, which may be unsuitable depending on the type of smart contract application one is building.

Chainlink: Example Integration w/ Potentially Stale Data
Example of Validating Data Staleness

Conclusion

The Ethereum network has been oft parallelized to a dark forest; if one is careful enough it is, however, relatively easy to traverse. The code execution paths a smart contract’s code accepts as “sane” are entirely defined by it regardless of the external interactions it performs.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store