Skip to content

Commit

Permalink
Migration to fill in missing but legit AppDataHashes (#2357)
Browse files Browse the repository at this point in the history
# Description
We want to start forbidding orders with unknown app data hashes. Before
we can do this, we want to make sure we have defaults set for most valid
orderflow (to not break integrations).

This PR adds a migration for the missing hashes that were observed in
the past week.

# Changes
- [x] Add migration with missing app data hashes

## How to test
Ran migrations locally
  • Loading branch information
fleupold authored Feb 5, 2024
1 parent 4bb2e59 commit 011c60b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions database/sql/V060__app_data_overrides.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Populates app data table with a set of legacy (ie not well formed) but known to be legitimate app data values.
-- We are assuming no specific metadata semantics (ie empty app data) for these values.
INSERT INTO app_data
(contract_app_data, full_app_data)
VALUES
-- Legit user 0x634b41c246f9afce16de397424704130b588139f
('\x1ba2c7f5680dd17a4d852b9c590afa0969893c2b1052a7f553542697f5668171', decode('{}', 'escape')),
-- Legit use case (lots of users)
('\x8906d5e6f69e3d8133f70c0451990044978ad5ed54be76f6f618b6c5784526c5', decode('{}', 'escape')),
-- Fee withdrawals
('\x2947be33ebfa25686ec204857135dd1c676f35d6c252eb066fffaf9b493a01b4', decode('{}', 'escape')),
-- Example python trading script
('\x0000000000000000000000000000000000000000000000000000000000000ccc', decode('{}', 'escape')),
-- Legit user 0xfcd2f5f382e4b3cd3b67a4e399ada0edf56d0383
('\xd19e76e4a302bc4e0018de6210f5fde3c55e3618a23a261fa94e4d19ceeb039d', decode('{}', 'escape')),
-- Limit order tutorial
('\xf785fae7a7c5abc49f3cd6a61f6df1ff26433392b066ee9ff2240ff1eb7ab6e4', decode('{}', 'escape')),
-- DCA Order (e.g. https://etherscan.io/address/0x224d04a92583936b9dd86c9ee8dd450290eded66#code)
('\x9b5c6dfa0fa4be89e17700f05bee8775b281aa6d2dac7dfbf3945e0f9642d777', decode('{}', 'escape'));

0 comments on commit 011c60b

Please sign in to comment.