-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtodo.txt
75 lines (63 loc) · 3.38 KB
/
todo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
how to deploy:
target a create2?
look at test/TestBase
swapLayer = SwapLayer(payable(address(new Proxy(
address(new SwapLayer(
IPermit2(vm.envAddress("TEST_PERMIT2_ADDRESS")),
ISwapRouter(vm.envAddress("TEST_UNISWAP_V3_ROUTER_ADDRESS")),
liquidityLayer
)),
abi.encodePacked(
owner,
assistant,
feeRecipient,
foreignChainId,
FOREIGN_SWAP_LAYER,
feeParams
)
))));
deploy a swap layer via the normal constructor,
but then deploy a Proxy.sol with the address of the first one (the real implementation), but with
all the contructor params packed as the second arg, which will get passed to the implementation's
proxyConstructor when called via the ProxyBase.sol when it invokes upgradeChecked()
there also is a payload item on the layout
https://github.com/wormhole-foundation/connect-sdk/blob/main/core/base/__tests__/layout.ts
https://docs.uniswap.org/contracts/v3/reference/deployments
MatchingEngine
6=0xdf5af760f3093034C7A6580FBd4CE66A8bEDd90A
TokenRouter
5=0x3Ce8a3aC230Eb4bCE3688f2A1ab21d986a0A0B06
6=0x7353B29FDc79435dcC7ECc9Ac9F9b61d83B4E0F4
10002=0x603541d1Cf7178C407aA7369b67CB7e0274952e2
10003=0xc1Cf3501ef0b26c8A47759F738832563C7cB014A
10004=0x4452B708C01d6aD7058a7541A3A82f0aD0A1abB1
10005=0xc1Cf3501ef0b26c8A47759F738832563C7cB014A
---- Contract TODOs ----
* trustless/limited trust gas price updates:
For relayed transfers, include the current gas price of the current chain along with the current
block timestamp in the payload. On the target chain, compare if the timestamp is more recent
than the last recorded timestamp for that chain, and if so, check if the change in the gas price
is more than the gas price update threshold percentage (to avoid unnecessary storage writes for
small changes).
Potentially allow a relayer to also add an additional adjustment to the gas price when actually
submitting the redeem transaction. Since relays are ultimately permissionless (though funds
always go to the fee recipient, so attacks through this mechanism are not free), care must be
taken that a malicious relayer cannot perturb the gas price too much (this should probably
be coupled to the gas price margin).
Check that this mechanism makes sense for all EVM chains or restrict it to only those that
actually profit from this approach.
* trustless gas token (=native) price updates
Similar to gas price updates, but instead of fetching the gas price information from the current
block, on oracle could be used to determine the cost of the native token in usdc terms.
This is trickier than and lower payoff than gas price updates (since gas prices tend to be a lot
more volatile than native token prices) but it would further reduce the need for external
updates.
!! Both of these mechanisms require bi-directional traffic to keep the respective foreign chain
appraised. An off-chain updater will be necessary to update fee params regardless to prevent
params to go to far out of whack during extended periods of no transactions between two chain
pairs !!
* should the contract be pausable?
Pausability for individual endpoints could be implemented via a second special endpoint value
(besides 0 which means not registered) + a proposal which a 0 lock period that allows reinstating
the old endpoint address. (This is purely to save gas from a separate, necessarily cold storage
slot)