From 718e3f3a36bff940cdc6cd7a6058e7b34d8f0c74 Mon Sep 17 00:00:00 2001 From: Tim Olson <> Date: Thu, 19 Oct 2023 17:33:15 -0400 Subject: [PATCH] complete checkin for juan; config tweaks & mock tweaks --- .gitignore | 1 + bin/mock.sh | 2 +- bin/test.sh | 2 +- docs/solidity.md | 4 ++-- foundry.toml => foundry-default.toml | 7 ++----- script/Deploy.sol | 2 +- src/Constants.sol | 4 +--- 7 files changed, 9 insertions(+), 13 deletions(-) rename foundry.toml => foundry-default.toml (58%) diff --git a/.gitignore b/.gitignore index cb2a76a..ab70163 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /.env /gen /lib +/foundry.toml diff --git a/bin/mock.sh b/bin/mock.sh index 88f3810..cbf1d9a 100755 --- a/bin/mock.sh +++ b/bin/mock.sh @@ -6,7 +6,7 @@ #cd ../contract #./bin/build.sh -anvil -f arbitrum_ankr --chain-id 1338 & +anvil -f arbitrum_mock --chain-id 1338 & # todo check anvil result ANVIL_PID=$! sleep 2 diff --git a/bin/test.sh b/bin/test.sh index 5032d2a..e1f5583 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -1,3 +1,3 @@ #!/bin/bash #./bin/build.sh -forge test -vvvv --fork-url arbitrum_ankr "$@" +forge test -vvvv --fork-url arbitrum_test "$@" diff --git a/docs/solidity.md b/docs/solidity.md index 03b8f56..5794a58 100644 --- a/docs/solidity.md +++ b/docs/solidity.md @@ -8,9 +8,9 @@ * similarly to `uint?` types, there are value types `bytes1`, `bytes2`, ..., `bytes32` which is 256 bits. `bytes` by itself is an alias for the dynamic array `byte[]` * do not use `string` type. use `bytes` instead. for reasons. * arrays have three types: dynamic storage array, dynamic memory array, and static array. - * all arrays in storage (contract or struct members) start as 0-length and may only be extended by `contractArray.push(item)` one at a time. remove with `pop()`. a storage array referenced inside a function as `Foo[] storage myArray = contractArray;` results in a reference to the storage area. + * all arrays in storage (contract members) start as 0-length and may only be extended by `contractArray.push(item)` one at a time. remove with `pop()`. a storage array referenced inside a function as `Foo[] storage myArray = contractArray;` results in a reference to the storage area. * dynamic memory arrays `Foo[] memory myArray = new Foo[](length);` only this c++ style allocation is available for dynamic memory arrays, and the length must be known at creation time. you must then set each member of the array separately, in a loop. - * static memory arrays `Foo[4] memory myArray = [foo1, foo2, foo3, foo4];` the length of the array is part of the type information, and it is not possible to cast a dynamic array to a static one or vice-versa. + * static arrays `Foo[4] memory myArray = [foo1, foo2, foo3, foo4];` the length of the array is part of the type information, and it is not possible to cast a dynamic array to a static one or vice-versa. * functions have two different types: views and transactions. * a view is read-only and may be completed instantly off-chain. its return values are immediately available to whatever client invoked the call. * transactions make changes to chain data. the return values from a transaction function are not written to chain, but they are immediately useable by other code that calls into that function from the same transaction. diff --git a/foundry.toml b/foundry-default.toml similarity index 58% rename from foundry.toml rename to foundry-default.toml index fc1de4c..ffa1eaf 100644 --- a/foundry.toml +++ b/foundry-default.toml @@ -23,8 +23,5 @@ stackAllocation = true optimizerSteps = 'dhfoD[xarrscLMcCTU]uljmul' [profile.default.rpc_endpoints] -# todo put these into a secrets file -arbitrum_alchemy='https://arb-mainnet.g.alchemy.com/v2/L0eaUwWEoWzszCK9EhqHdl_p7VHStkaC' -arbitrum_ankr='https://rpc.ankr.com/arbitrum/056ed471570655a3bb77cf31b9e3576658d63d2acb88911f84e7acaf211b55ac' -arbitrum_publicnode='https://arbitrum-one.publicnode.com' -arbitrum_quicknode='https://muddy-methodical-sheet.arbitrum-mainnet.discover.quiknode.pro/9e24248720b067953db96d462c8dd131a0a234b0/' +arbitrum_mock='...' +arbitrum_test='...' diff --git a/script/Deploy.sol b/script/Deploy.sol index d3014ae..922508e 100644 --- a/script/Deploy.sol +++ b/script/Deploy.sol @@ -17,7 +17,7 @@ contract Deploy is Script { Dexorder dexorder = new Dexorder(); MockEnv mock = new MockEnv(); vm.stopBroadcast(); - console2.log('VaultDeployer'); + console2.log('Factory'); console2.log(address(deployer)); console2.log('QueryHelper'); console2.log(address(query)); diff --git a/src/Constants.sol b/src/Constants.sol index 2af5841..7fea2db 100644 --- a/src/Constants.sol +++ b/src/Constants.sol @@ -16,7 +16,5 @@ library Constants { = ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564); - // Swap statuses - bytes32 internal constant SWAP_OK = ''; // fastest comparison - // other errors may be passed through from Uniswap + bytes32 internal constant SWAP_OK = ''; }