From bf60642db8c936267813ccc0ede3e689dd40e555 Mon Sep 17 00:00:00 2001 From: Xeonus Date: Wed, 20 Sep 2023 19:07:45 +0200 Subject: [PATCH 01/11] BIP-433: Maxi Funding Proposal Q4-2023 - Send 168,770 USDC and 31,695 BAL and 20 WETH to Maxi Multi-sig for Q4 funding - Tenderly-sim: https://dashboard.tenderly.co/public/safe/safe-apps/simulator/07e1688b-1e4d-4025-9c17-b23b52507cbf --- BIPs/2023-W38/BIP-433.json | 99 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 BIPs/2023-W38/BIP-433.json diff --git a/BIPs/2023-W38/BIP-433.json b/BIPs/2023-W38/BIP-433.json new file mode 100644 index 000000000..1cd7fbc4c --- /dev/null +++ b/BIPs/2023-W38/BIP-433.json @@ -0,0 +1,99 @@ +{ + "version": "1.0", + "chainId": "1", + "createdAt": 1695229450551, + "meta": { + "name": "Transactions Batch", + "description": "", + "txBuilderVersion": "1.16.2", + "createdFromSafeAddress": "0x10A19e7eE7d7F8a52822f6817de8ea18204F2e4f", + "createdFromOwnerAddress": "", + "checksum": "0x7f1ffb3aab169083c8160173973fcb29c13ebb0dd47b6ee3eb046a3fd449b3cd" + }, + "transactions": [ + { + "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "value": "0", + "data": null, + "contractMethod": { + "inputs": [ + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "name": "transfer", + "payable": false + }, + "contractInputsValues": { + "to": "0x166f54F44F271407f24AA1BE415a730035637325", + "value": "168770000000" + } + }, + { + "to": "0xba100000625a3754423978a60c9317c58a424e3D", + "value": "0", + "data": null, + "contractMethod": { + "inputs": [ + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } + ], + "name": "transfer", + "payable": false + }, + "contractInputsValues": { + "recipient": "0x166f54F44F271407f24AA1BE415a730035637325", + "amount": "31695000000000000000000" + } + }, + { + "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "value": "20000000000000000000", + "data": null, + "contractMethod": { + "inputs": [], + "name": "deposit", + "payable": true + }, + "contractInputsValues": null + }, + { + "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "value": "0", + "data": null, + "contractMethod": { + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "payable": false + }, + "contractInputsValues": { + "dst": "0x166f54F44F271407f24AA1BE415a730035637325", + "wad": "20000000000000000000" + } + } + ] +} \ No newline at end of file From 780b7de221f7e6d3157bd65580d39bb0bbc9482d Mon Sep 17 00:00:00 2001 From: Xeonus Date: Wed, 20 Sep 2023 17:10:07 +0000 Subject: [PATCH 02/11] Reformatted JSON files --- BIPs/2023-W38/BIP-433.json | 194 ++++++++++++++++++------------------- 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/BIPs/2023-W38/BIP-433.json b/BIPs/2023-W38/BIP-433.json index 1cd7fbc4c..79a061055 100644 --- a/BIPs/2023-W38/BIP-433.json +++ b/BIPs/2023-W38/BIP-433.json @@ -1,99 +1,99 @@ { - "version": "1.0", - "chainId": "1", - "createdAt": 1695229450551, - "meta": { - "name": "Transactions Batch", - "description": "", - "txBuilderVersion": "1.16.2", - "createdFromSafeAddress": "0x10A19e7eE7d7F8a52822f6817de8ea18204F2e4f", - "createdFromOwnerAddress": "", - "checksum": "0x7f1ffb3aab169083c8160173973fcb29c13ebb0dd47b6ee3eb046a3fd449b3cd" + "version": "1.0", + "chainId": "1", + "createdAt": 1695229450551, + "meta": { + "name": "Transactions Batch", + "description": "", + "txBuilderVersion": "1.16.2", + "createdFromSafeAddress": "0x10A19e7eE7d7F8a52822f6817de8ea18204F2e4f", + "createdFromOwnerAddress": "", + "checksum": "0x7f1ffb3aab169083c8160173973fcb29c13ebb0dd47b6ee3eb046a3fd449b3cd" + }, + "transactions": [ + { + "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "value": "0", + "data": null, + "contractMethod": { + "inputs": [ + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ], + "name": "transfer", + "payable": false + }, + "contractInputsValues": { + "to": "0x166f54F44F271407f24AA1BE415a730035637325", + "value": "168770000000" + } }, - "transactions": [ - { - "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "value": "0", - "data": null, - "contractMethod": { - "inputs": [ - { - "name": "to", - "type": "address", - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - } - ], - "name": "transfer", - "payable": false - }, - "contractInputsValues": { - "to": "0x166f54F44F271407f24AA1BE415a730035637325", - "value": "168770000000" - } - }, - { - "to": "0xba100000625a3754423978a60c9317c58a424e3D", - "value": "0", - "data": null, - "contractMethod": { - "inputs": [ - { - "name": "recipient", - "type": "address", - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - } - ], - "name": "transfer", - "payable": false - }, - "contractInputsValues": { - "recipient": "0x166f54F44F271407f24AA1BE415a730035637325", - "amount": "31695000000000000000000" - } - }, - { - "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - "value": "20000000000000000000", - "data": null, - "contractMethod": { - "inputs": [], - "name": "deposit", - "payable": true - }, - "contractInputsValues": null - }, - { - "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - "value": "0", - "data": null, - "contractMethod": { - "inputs": [ - { - "name": "dst", - "type": "address" - }, - { - "name": "wad", - "type": "uint256" - } - ], - "name": "transfer", - "payable": false - }, - "contractInputsValues": { - "dst": "0x166f54F44F271407f24AA1BE415a730035637325", - "wad": "20000000000000000000" - } - } - ] -} \ No newline at end of file + { + "to": "0xba100000625a3754423978a60c9317c58a424e3D", + "value": "0", + "data": null, + "contractMethod": { + "inputs": [ + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } + ], + "name": "transfer", + "payable": false + }, + "contractInputsValues": { + "recipient": "0x166f54F44F271407f24AA1BE415a730035637325", + "amount": "31695000000000000000000" + } + }, + { + "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "value": "20000000000000000000", + "data": null, + "contractMethod": { + "inputs": [], + "name": "deposit", + "payable": true + }, + "contractInputsValues": null + }, + { + "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "value": "0", + "data": null, + "contractMethod": { + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "payable": false + }, + "contractInputsValues": { + "dst": "0x166f54F44F271407f24AA1BE415a730035637325", + "wad": "20000000000000000000" + } + } + ] +} From 19d45d5364e90195006fd2e8dfe0f90ede4498b2 Mon Sep 17 00:00:00 2001 From: Tritium Date: Sat, 23 Sep 2023 23:57:47 +0200 Subject: [PATCH 03/11] Don't try checksumming a non address. --- action-scripts/brownie/scripts/report_gauges.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/action-scripts/brownie/scripts/report_gauges.py b/action-scripts/brownie/scripts/report_gauges.py index d14eacb00..016cc8299 100644 --- a/action-scripts/brownie/scripts/report_gauges.py +++ b/action-scripts/brownie/scripts/report_gauges.py @@ -314,13 +314,15 @@ def _parse_transfer(transaction: dict, **kwargs) -> Optional[dict]: # Get input values token = Contract(transaction["to"]) recipient_address = transaction["contractInputsValues"].get("to") + if Web3.isAddress(recipient_address): + recipient_address = Web3.toChecksumAddress(recipient_address) raw_amount = ( transaction["contractInputsValues"].get("amount") or transaction["contractInputsValues"].get("value") ) amount = int(raw_amount) / 10 ** token.decimals() if raw_amount else "N/A" symbol = token.symbol() - recipient_name = ADDR_BOOK.reversebook.get(Web3.toChecksumAddress(recipient_address), "N/A") + recipient_name = ADDR_BOOK.reversebook.get(recipient_address, "N/A") return { "function": "transfer", "chain": chain_name.replace("-main", "") if chain_name else "mainnet", From 4f4586032798a900f466168dc624adc522964ec1 Mon Sep 17 00:00:00 2001 From: Tritium Date: Sun, 24 Sep 2023 00:05:15 +0200 Subject: [PATCH 04/11] continue if no civ_parsed --- action-scripts/brownie/scripts/report_gauges.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action-scripts/brownie/scripts/report_gauges.py b/action-scripts/brownie/scripts/report_gauges.py index 016cc8299..b6e3be50b 100644 --- a/action-scripts/brownie/scripts/report_gauges.py +++ b/action-scripts/brownie/scripts/report_gauges.py @@ -384,6 +384,8 @@ def parse_no_reports_report(all_reports: list[dict[str, dict]], files: list[dict civ_parsed = prettify_contract_inputs_values(chain_name, transaction["contractInputsValues"]) elif transaction.get("data"): civ_parsed = transaction["data"] + else: + continue no_reports.append({ "fx_name": transaction["contractMethod"]["name"], "to": f"{to} ({addr.reversebook.get(to, 'Not Found')})", From 5f1721aaacbb22a1b0e425e3191ac0e0d7169dae Mon Sep 17 00:00:00 2001 From: Tritium Date: Sun, 24 Sep 2023 00:20:13 +0200 Subject: [PATCH 05/11] fix to handle wETH deposits which have null ad ContractInputValues --- action-scripts/brownie/scripts/report_gauges.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action-scripts/brownie/scripts/report_gauges.py b/action-scripts/brownie/scripts/report_gauges.py index b6e3be50b..389d768b6 100644 --- a/action-scripts/brownie/scripts/report_gauges.py +++ b/action-scripts/brownie/scripts/report_gauges.py @@ -385,7 +385,7 @@ def parse_no_reports_report(all_reports: list[dict[str, dict]], files: list[dict elif transaction.get("data"): civ_parsed = transaction["data"] else: - continue + civ_parsed = "N/A" no_reports.append({ "fx_name": transaction["contractMethod"]["name"], "to": f"{to} ({addr.reversebook.get(to, 'Not Found')})", From 93dca0cd39b50c1e903ae4cb50121a877dc56495 Mon Sep 17 00:00:00 2001 From: Tritium-VLK Date: Sat, 23 Sep 2023 22:22:07 +0000 Subject: [PATCH 06/11] Reformatted JSON files --- BIPs/2023-W38/BIP-433.report.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 BIPs/2023-W38/BIP-433.report.txt diff --git a/BIPs/2023-W38/BIP-433.report.txt b/BIPs/2023-W38/BIP-433.report.txt new file mode 100644 index 000000000..06df230e9 --- /dev/null +++ b/BIPs/2023-W38/BIP-433.report.txt @@ -0,0 +1,24 @@ +File name: BIPs/2023-W38/BIP-433.json +COMMIT: `5f1721aaacbb22a1b0e425e3191ac0e0d7169dae` +CHAIN(S): `mainnet` +``` ++------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ +| function | token_symbol | recipient | amount | bip | tx_index | ++============+=================================================+===============================================================+========================================+=========+============+ +| transfer | USDC:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 | multisigs/maxi_ops:0x166f54F44F271407f24AA1BE415a730035637325 | 168770.0 (RAW: 168770000000) | BIP-433 | 0 | ++------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ +| transfer | BAL:0xba100000625a3754423978a60c9317c58a424e3D | N/A:None | 31695.0 (RAW: 31695000000000000000000) | BIP-433 | 1 | ++------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ +| transfer | WETH:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 | N/A:None | N/A (RAW: None) | BIP-433 | 3 | ++------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ +``` +File name: BIPs/2023-W38/BIP-433.json +COMMIT: `5f1721aaacbb22a1b0e425e3191ac0e0d7169dae` +CHAIN(S): `1` +``` ++-----------+----------------------------------------------------------+----------------------+----------+--------------+------------+ +| fx_name | to | value | inputs | bip_number | tx_index | ++===========+==========================================================+======================+==========+==============+============+ +| deposit | 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 (tokens/WETH) | 20000000000000000000 | "N/A" | BIP-433 | N/A | ++-----------+----------------------------------------------------------+----------------------+----------+--------------+------------+ +``` From 972f233a4c6153332bc178660ea9ad97311afc00 Mon Sep 17 00:00:00 2001 From: Tritium Date: Sun, 24 Sep 2023 00:29:04 +0200 Subject: [PATCH 07/11] add handling for dst and wad in recipient reports. --- action-scripts/brownie/scripts/report_gauges.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/action-scripts/brownie/scripts/report_gauges.py b/action-scripts/brownie/scripts/report_gauges.py index 389d768b6..cb5d680a4 100644 --- a/action-scripts/brownie/scripts/report_gauges.py +++ b/action-scripts/brownie/scripts/report_gauges.py @@ -313,12 +313,19 @@ def _parse_transfer(transaction: dict, **kwargs) -> Optional[dict]: network.connect(chain_name) # Get input values token = Contract(transaction["to"]) - recipient_address = transaction["contractInputsValues"].get("to") + recipient_address = ( + transaction["contractInputsValues"].get("to") + or transaction["contractInputsValues"].get("dst") + ) if Web3.isAddress(recipient_address): recipient_address = Web3.toChecksumAddress(recipient_address) + else: + print("ERROR: can't find recipient address") + recipient_address = None raw_amount = ( transaction["contractInputsValues"].get("amount") or transaction["contractInputsValues"].get("value") + or transaction["contractInputsValues"].get("wad") ) amount = int(raw_amount) / 10 ** token.decimals() if raw_amount else "N/A" symbol = token.symbol() From 59c476534ca5368af8113a7f1d1bd736c6c4dc41 Mon Sep 17 00:00:00 2001 From: Tritium-VLK Date: Sat, 23 Sep 2023 22:32:08 +0000 Subject: [PATCH 08/11] Reformatted JSON files --- BIPs/2023-W38/BIP-433.report.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BIPs/2023-W38/BIP-433.report.txt b/BIPs/2023-W38/BIP-433.report.txt index 06df230e9..26244b788 100644 --- a/BIPs/2023-W38/BIP-433.report.txt +++ b/BIPs/2023-W38/BIP-433.report.txt @@ -1,5 +1,5 @@ File name: BIPs/2023-W38/BIP-433.json -COMMIT: `5f1721aaacbb22a1b0e425e3191ac0e0d7169dae` +COMMIT: `9934c176f3eabafe46a36a60404f21927d828588` CHAIN(S): `mainnet` ``` +------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ @@ -9,11 +9,11 @@ CHAIN(S): `mainnet` +------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ | transfer | BAL:0xba100000625a3754423978a60c9317c58a424e3D | N/A:None | 31695.0 (RAW: 31695000000000000000000) | BIP-433 | 1 | +------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ -| transfer | WETH:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 | N/A:None | N/A (RAW: None) | BIP-433 | 3 | +| transfer | WETH:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 | multisigs/maxi_ops:0x166f54F44F271407f24AA1BE415a730035637325 | 20.0 (RAW: 20000000000000000000) | BIP-433 | 3 | +------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ ``` File name: BIPs/2023-W38/BIP-433.json -COMMIT: `5f1721aaacbb22a1b0e425e3191ac0e0d7169dae` +COMMIT: `9934c176f3eabafe46a36a60404f21927d828588` CHAIN(S): `1` ``` +-----------+----------------------------------------------------------+----------------------+----------+--------------+------------+ From bb56fb516920df9523f726a1bd570ace8280f7d6 Mon Sep 17 00:00:00 2001 From: Tritium Date: Sun, 24 Sep 2023 00:35:39 +0200 Subject: [PATCH 09/11] add Recipient for BAL transfers --- action-scripts/brownie/scripts/report_gauges.py | 1 + 1 file changed, 1 insertion(+) diff --git a/action-scripts/brownie/scripts/report_gauges.py b/action-scripts/brownie/scripts/report_gauges.py index cb5d680a4..9cd63bace 100644 --- a/action-scripts/brownie/scripts/report_gauges.py +++ b/action-scripts/brownie/scripts/report_gauges.py @@ -316,6 +316,7 @@ def _parse_transfer(transaction: dict, **kwargs) -> Optional[dict]: recipient_address = ( transaction["contractInputsValues"].get("to") or transaction["contractInputsValues"].get("dst") + or transaction["contractInputsValues"].get("recipient") ) if Web3.isAddress(recipient_address): recipient_address = Web3.toChecksumAddress(recipient_address) From 50008e0b027914755e887d2535afb6256cfc6588 Mon Sep 17 00:00:00 2001 From: Tritium-VLK Date: Sat, 23 Sep 2023 22:38:00 +0000 Subject: [PATCH 10/11] Reformatted JSON files --- BIPs/2023-W38/BIP-433.report.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BIPs/2023-W38/BIP-433.report.txt b/BIPs/2023-W38/BIP-433.report.txt index 26244b788..0a77cbdec 100644 --- a/BIPs/2023-W38/BIP-433.report.txt +++ b/BIPs/2023-W38/BIP-433.report.txt @@ -1,5 +1,5 @@ File name: BIPs/2023-W38/BIP-433.json -COMMIT: `9934c176f3eabafe46a36a60404f21927d828588` +COMMIT: `23884d541e44cc1bd3486c8f84d0b5e7c9322d7f` CHAIN(S): `mainnet` ``` +------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ @@ -7,13 +7,13 @@ CHAIN(S): `mainnet` +============+=================================================+===============================================================+========================================+=========+============+ | transfer | USDC:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 | multisigs/maxi_ops:0x166f54F44F271407f24AA1BE415a730035637325 | 168770.0 (RAW: 168770000000) | BIP-433 | 0 | +------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ -| transfer | BAL:0xba100000625a3754423978a60c9317c58a424e3D | N/A:None | 31695.0 (RAW: 31695000000000000000000) | BIP-433 | 1 | +| transfer | BAL:0xba100000625a3754423978a60c9317c58a424e3D | multisigs/maxi_ops:0x166f54F44F271407f24AA1BE415a730035637325 | 31695.0 (RAW: 31695000000000000000000) | BIP-433 | 1 | +------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ | transfer | WETH:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 | multisigs/maxi_ops:0x166f54F44F271407f24AA1BE415a730035637325 | 20.0 (RAW: 20000000000000000000) | BIP-433 | 3 | +------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ ``` File name: BIPs/2023-W38/BIP-433.json -COMMIT: `9934c176f3eabafe46a36a60404f21927d828588` +COMMIT: `23884d541e44cc1bd3486c8f84d0b5e7c9322d7f` CHAIN(S): `1` ``` +-----------+----------------------------------------------------------+----------------------+----------+--------------+------------+ From bf6e839cd7b274369eee9d952ebea92ba72927ad Mon Sep 17 00:00:00 2001 From: Tritium-VLK Date: Sat, 23 Sep 2023 22:43:05 +0000 Subject: [PATCH 11/11] Reformatted JSON files --- BIPs/2023-W38/BIP-433.report.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BIPs/2023-W38/BIP-433.report.txt b/BIPs/2023-W38/BIP-433.report.txt index 0a77cbdec..04d9ff3b8 100644 --- a/BIPs/2023-W38/BIP-433.report.txt +++ b/BIPs/2023-W38/BIP-433.report.txt @@ -1,5 +1,5 @@ File name: BIPs/2023-W38/BIP-433.json -COMMIT: `23884d541e44cc1bd3486c8f84d0b5e7c9322d7f` +COMMIT: `025df92fbcd20bab449a51d9a907393dbb6a2869` CHAIN(S): `mainnet` ``` +------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ @@ -13,7 +13,7 @@ CHAIN(S): `mainnet` +------------+-------------------------------------------------+---------------------------------------------------------------+----------------------------------------+---------+------------+ ``` File name: BIPs/2023-W38/BIP-433.json -COMMIT: `23884d541e44cc1bd3486c8f84d0b5e7c9322d7f` +COMMIT: `025df92fbcd20bab449a51d9a907393dbb6a2869` CHAIN(S): `1` ``` +-----------+----------------------------------------------------------+----------------------+----------+--------------+------------+