Skip to content

Commit

Permalink
BIP-433: Maxi Funding Proposal Q4-2023 (#516)
Browse files Browse the repository at this point in the history
* 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

* Reformatted JSON files

* Don't try checksumming a non address.

* continue if no civ_parsed

* fix to handle wETH deposits which have null ad ContractInputValues

* Reformatted JSON files

* add handling for dst and wad in recipient reports.

* Reformatted JSON files

* add Recipient for BAL transfers

* Reformatted JSON files

* Reformatted JSON files

---------

Co-authored-by: Xeonus <[email protected]>
Co-authored-by: Tritium <[email protected]>
Co-authored-by: Tritium-VLK <[email protected]>
Co-authored-by: Tritium <[email protected]>
  • Loading branch information
5 people authored Sep 23, 2023
1 parent 8b934c2 commit d7f8037
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 1 deletion.
99 changes: 99 additions & 0 deletions BIPs/2023-W38/BIP-433.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
}
24 changes: 24 additions & 0 deletions BIPs/2023-W38/BIP-433.report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
File name: BIPs/2023-W38/BIP-433.json
COMMIT: `025df92fbcd20bab449a51d9a907393dbb6a2869`
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 | 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: `025df92fbcd20bab449a51d9a907393dbb6a2869`
CHAIN(S): `1`
```
+-----------+----------------------------------------------------------+----------------------+----------+--------------+------------+
| fx_name | to | value | inputs | bip_number | tx_index |
+===========+==========================================================+======================+==========+==============+============+
| deposit | 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 (tokens/WETH) | 20000000000000000000 | "N/A" | BIP-433 | N/A |
+-----------+----------------------------------------------------------+----------------------+----------+--------------+------------+
```
12 changes: 11 additions & 1 deletion action-scripts/brownie/scripts/report_gauges.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,20 @@ 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")
or transaction["contractInputsValues"].get("recipient")
)
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()
Expand Down Expand Up @@ -384,6 +392,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:
civ_parsed = "N/A"
no_reports.append({
"fx_name": transaction["contractMethod"]["name"],
"to": f"{to} ({addr.reversebook.get(to, 'Not Found')})",
Expand Down

0 comments on commit d7f8037

Please sign in to comment.