Pickle in a Pickle: A Post-Mortem

Technical Context

Source: PickleJar.sol (Lines 910 to 927)
Source: PickleJar.sol (Lines 840 to 845)
Source: ControllerV3.sol (Lines 1043 to 1045)

Background

The overall “balance” of a PickleJar is actually located across two separate contracts: the PickleJar contract and the Strategy contract.

A simplified diagram of PickleJar architecture

The Great Migration

  1. Deploy new Strategy and new Controller contracts;
  2. Approve and set new Strategy contracts with the new Controller;
  3. Call withdrawAll() on the old Strategy contract to migrate its funds to the PickleJar contract;
  4. Since all funds are now within the PickleJar contract, we can safely call setController to migrate to the new Controller contract.

Where Things Went Wrong

Imperfect Communication

  1. First upload a new Controller pointing towards the same old Strategy;
  2. Call setController to the PickleJar to point it towards the new Controller;
  3. Upload and approve the new Strategy;
  4. Call withdrawAll() on the old Strategy;
  5. Call setStrategy() on the new Controller to point to the new Strategy.

The Pickle Response

The Great Rescue

Timelock transactions queued up for the rescue operation

PickleJar Farms

Interest Earned

Mitigation

Timelock Transaction Discord Channel

  • The context of why the transaction is being executed;
  • If there are any pre-requisites that must be done before the transaction is to be executed, and finally;
  • The specific personnel expected to execute the transaction.

Conclusion

More Questions?

Disclaimer

--

--

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