Skip to content

Commit

Permalink
pcsx
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielZlotin committed Jan 15, 2025
1 parent b99e111 commit a7ca38b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 67 deletions.
54 changes: 27 additions & 27 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AdminAccessTest:test_allow_onlyOwner() (gas: 36167)
AdminAccessTest:test_allowed() (gas: 16798)
AdminAccessTest:test_init() (gas: 7625)
AdminAccessTest:test_owned() (gas: 7618)
AdminAccessTest:test_owned() (gas: 7662)
AdminAccessTest:test_revert_admin_init() (gas: 10555)
AdminAccessTest:test_revert_admin_init_twice() (gas: 14123)
AdminAccessTest:test_revert_allow_onlyOwner() (gas: 11126)
Expand All @@ -12,38 +12,38 @@ AdminWithdrawTest:test_WETH() (gas: 71280)
AdminWithdrawTest:test_empty() (gas: 21526)
AdminWithdrawTest:test_execute() (gas: 876842)
AdminWithdrawTest:test_tokens() (gas: 879919)
LiquidityHubAccessTest:test_revert_execute_onlyAllowed() (gas: 15345)
LiquidityHubAccessTest:test_revert_reactorCallback_onlyReactor() (gas: 10576)
LiquidityHubAccessTest:test_revert_validationCallback_onlySelf() (gas: 11914)
LiquidityHubExecuteTest:test_decayOnNegativeSlippage() (gas: 352300)
LiquidityHubExecuteTest:test_emitEvents() (gas: 365709)
LiquidityHubExecuteTest:test_gas() (gas: 259247)
LiquidityHubExecuteTest:test_gasToAdmin() (gas: 349265)
LiquidityHubExecuteTest:test_inTokenSlippage() (gas: 387624)
LiquidityHubExecuteTest:test_longLimit() (gas: 351803)
LiquidityHubExecuteTest:test_nativeOutput() (gas: 302429)
LiquidityHubExecuteTest:test_nativeOutputSwapperLimit() (gas: 302506)
LiquidityHubExecuteTest:test_nativeSlippageToRef() (gas: 302100)
LiquidityHubExecuteTest:test_optionalRef() (gas: 313209)
LiquidityHubExecuteTest:test_optionalRefshare() (gas: 313425)
LiquidityHubExecuteTest:test_revert_swapperLimit() (gas: 362502)
LiquidityHubExecuteTest:test_slippageToRef() (gas: 351912)
LiquidityHubExecuteTest:test_swapperLimit() (gas: 349794)
LiquidityHubExecuteTest:test_swapperLimitRespectsSurplus() (gas: 354509)
LiquidityHubExecuteTest:test_usdtOutput() (gas: 277)
PartialOrderE2ETest:test_e2e_exactMirrorMatch() (gas: 463135)
PartialOrderE2ETest:test_e2e_multiplePartialInputs() (gas: 635296)
PartialOrderE2ETest:test_e2e_partialInputMatch() (gas: 482991)
LiquidityHubAccessTest:test_revert_execute_onlyAllowed() (gas: 15353)
LiquidityHubAccessTest:test_revert_reactorCallback_onlyReactor() (gas: 10584)
LiquidityHubAccessTest:test_revert_validationCallback_onlySelf() (gas: 11885)
LiquidityHubExecuteTest:test_decayOnNegativeSlippage() (gas: 352318)
LiquidityHubExecuteTest:test_emitEvents() (gas: 365689)
LiquidityHubExecuteTest:test_gas() (gas: 259211)
LiquidityHubExecuteTest:test_gasToAdmin() (gas: 349261)
LiquidityHubExecuteTest:test_inTokenSlippage() (gas: 387576)
LiquidityHubExecuteTest:test_longLimit() (gas: 351754)
LiquidityHubExecuteTest:test_nativeOutput() (gas: 302425)
LiquidityHubExecuteTest:test_nativeOutputSwapperLimit() (gas: 302502)
LiquidityHubExecuteTest:test_nativeSlippageToRef() (gas: 302096)
LiquidityHubExecuteTest:test_optionalRef() (gas: 313171)
LiquidityHubExecuteTest:test_optionalRefshare() (gas: 313440)
LiquidityHubExecuteTest:test_revert_swapperLimit() (gas: 362520)
LiquidityHubExecuteTest:test_slippageToRef() (gas: 351930)
LiquidityHubExecuteTest:test_swapperLimit() (gas: 349812)
LiquidityHubExecuteTest:test_swapperLimitRespectsSurplus() (gas: 354505)
LiquidityHubExecuteTest:test_usdtOutput() (gas: 234)
PartialOrderE2ETest:test_e2e_exactMirrorMatch() (gas: 463106)
PartialOrderE2ETest:test_e2e_multiplePartialInputs() (gas: 635238)
PartialOrderE2ETest:test_e2e_partialInputMatch() (gas: 482962)
PartialOrderReactorTest:test_execute_swapFullAmount() (gas: 199131)
PartialOrderReactorTest:test_execute_swapPartial() (gas: 309736)
PartialOrderReactorTest:test_execute_swapPartialOdd() (gas: 199121)
PartialOrderReactorTest:test_revert_insufficentAlowanceAfterSpending() (gas: 243068)
PartialOrderReactorTest:test_revert_requestGTSigned() (gas: 102056)
PartialOrderReactorTest:test_revert_insufficentAlowanceAfterSpending() (gas: 243039)
PartialOrderReactorTest:test_revert_requestGTSigned() (gas: 102027)
RePermitTest:test_cancel() (gas: 80161)
RePermitTest:test_domainSeparator() (gas: 5613)
RePermitTest:test_nameAndVersion() (gas: 10391)
RePermitTest:test_nameAndVersion() (gas: 10278)
RePermitTest:test_repermitWitnessTransferFrom_partialFill() (gas: 298203)
RePermitTest:test_revert_insufficientAllowance() (gas: 149506)
RePermitTest:test_revert_insufficientAllowance_afterSpending() (gas: 288227)
RePermitTest:test_revert_invalidSignature() (gas: 68186)
RePermitTest:test_revert_invalidSignature() (gas: 68164)
RePermitTest:test_revert_signatureExpired() (gas: 36090)
2 changes: 0 additions & 2 deletions script/03_DeployExecutor.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import {BaseScript, Admin, Consts} from "script/base/BaseScript.sol";
import {LiquidityHub, IReactor, IAllowed} from "src/LiquidityHub.sol";

contract DeployExecutor is BaseScript {
//executorPCSX = _executor(0x35db01D1425685789dCc9228d47C7A5C049388d8, 0x000066320a467dE62B1548f46465abBB82662331);

function run() public returns (address executor) {
address reactor = vm.envAddress("REACTOR");
address admin = vm.envAddress("ADMIN");
Expand Down
16 changes: 1 addition & 15 deletions script/base/BaseScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,7 @@ struct Config {
abstract contract BaseScript is Script {
Config public config;

function setUp() public virtual {
initProductionConfig();
}

function initProductionConfig() public {
config = abi.decode(
vm.parseJson(vm.readFile(string.concat(vm.projectRoot(), "/script/input/config.json"))), (Config)
);
vm.label(address(config.admin), "admin");
vm.label(address(config.executor), "executor");
vm.label(address(config.reactor), "reactor");
vm.label(address(config.reactor2), "reactor2");
vm.label(address(config.reactorPartial), "reactorPartial");
vm.label(address(config.repermit), "repermit");
}
function setUp() public virtual {}

function signPermit2(uint256 privateKey, bytes32 orderHash) internal view returns (bytes memory sig) {
bytes32 msgHash = ECDSA.toTypedDataHash(IEIP712(Consts.PERMIT2_ADDRESS).DOMAIN_SEPARATOR(), orderHash);
Expand Down
51 changes: 28 additions & 23 deletions script/deployall
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ b=false; [[ " $* " == *" -b "* ]] && b=true
trap chain EXIT

chains=(eth arb bnb matic ftm op linea blast base zkevm manta sei sonic zircuit scroll)
chains=( cronos-zkevm-testnet )

echo $chains | tr ' ' '\n' | parallel --keep-order "
echo \"\nπŸ”—πŸ”—πŸ”—πŸ”—πŸ”—πŸ”—πŸ”—πŸ”—πŸ”—πŸ”—πŸ”—πŸ”— {} πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€\n\";
Expand All @@ -17,44 +18,48 @@ echo $chains | tr ' ' '\n' | parallel --keep-order "
export REACTOR=$(jq -r '."*".reactor' $deployments);
export REPERMIT=$(jq -r '."*".repermit' $deployments);
forge script DeployAdmin ${b:+--broadcast};
echo \"βœ” admin\n\"
export SALT="0x55669ad6a3db66a4a3bbfe640c9faa64095a75a5228cf52464f4a449257ee6c5"
forge script DeployAdmin ${b:+--broadcast};
echo \"βœ” admin fee0\n\"
echo βœ” admin\n
export SALT="0xab1462bd378a47c5676f45ed8b1f1de08ddf212e2525b6c82e7c2c11c41590d2"
forge script DeployAdmin ${b:+--broadcast};
echo \"βœ” admin fee1\n\"
SALT=0x55669ad6a3db66a4a3bbfe640c9faa64095a75a5228cf52464f4a449257ee6c5 forge script DeployAdmin ${b:+--broadcast};
echo βœ” admin fee0\n
export SALT="0x668fa19c8dfec98130ebcc64b727ecf11105987af78936a05550a1f6679b16cc"
forge script DeployAdmin ${b:+--broadcast};
echo \"βœ” admin fee2\n\"
SALT=0xab1462bd378a47c5676f45ed8b1f1de08ddf212e2525b6c82e7c2c11c41590d2 forge script DeployAdmin ${b:+--broadcast};
echo βœ” admin fee1\n
SALT=0x668fa19c8dfec98130ebcc64b727ecf11105987af78936a05550a1f6679b16cc forge script DeployAdmin ${b:+--broadcast};
echo βœ” admin fee2\n
SALT=0x7622f2bb307bda72700fbabe78b8f2bc76c8d4f214e47ca34aa96b4e980947ce forge script DeployAdmin ${b:+--broadcast};
echo βœ” admin fee3\n
SALT=0xb1aac588046056d5c6f36a411101a7a1cb65133199af7f4a67f8b1321cd9443e forge script DeployAdmin ${b:+--broadcast};
echo βœ” admin fee4\n
SALT=0x2e90075fd552fee96f1a8ad975cf9dd850ad7562f1f69c0e4a89ee37759df870 forge script DeployAdmin ${b:+--broadcast};
echo βœ” admin fee4\n
export SALT="0x7622f2bb307bda72700fbabe78b8f2bc76c8d4f214e47ca34aa96b4e980947ce"
forge script DeployAdmin ${b:+--broadcast};
echo \"βœ” admin fee3\n\"
unset SALT
forge script UpdateWhitelist ${b:+--broadcast};
echo \"βœ” whitelist\n\"
echo βœ” whitelist\n
forge script DeployReactor ${b:+--broadcast};
echo \"βœ” reactor\n\"
echo βœ” reactor\n
export SALT="0x0000000000000000000000000000000000000000000000000000000000000001"
forge script DeployReactor ${b:+--broadcast};
echo \"βœ” reactor2\n\"
unset SALT
SALT=0x0000000000000000000000000000000000000000000000000000000000000001 forge script DeployReactor ${b:+--broadcast};
echo βœ” reactor2\n
forge script DeployExecutor ${b:+--broadcast};
echo \"βœ” executor\n\"
echo βœ” executor\n
REACTOR=0x35db01D1425685789dCc9228d47C7A5C049388d8 forge script DeployExecutor ${b:+--broadcast};
echo βœ” executorPCSX\n
# forge script DeployRepermit ${b:+--broadcast};
# echo \"βœ” repermit\n\"
# echo βœ” repermit\n
# forge script DeployPartial ${b:+--broadcast};
# echo \"βœ” partial\n\"
# echo βœ” partial\n
"

0 comments on commit a7ca38b

Please sign in to comment.