Skip to content

Commit

Permalink
Merge pull request #34 from decaswap-labs/feat/swapLimitUpdate
Browse files Browse the repository at this point in the history
Feat/swap limit update
  • Loading branch information
immaxkent authored Dec 27, 2024
2 parents e004b75 + 42e7ba3 commit 6e61b69
Show file tree
Hide file tree
Showing 36 changed files with 1,779 additions and 1,199 deletions.
16 changes: 14 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
[profile.default]
src = "src"
test = "test"
out = "out"
libs = ["lib"]
solc_version = "0.8.28"
via-ir = true
optimizer = true
optimizer_runs = 1000

[profile.test]
via-ir = false

[fmt]
bracket_spacing = true
int_types = "long"
line_length = 120
multiline_func_header = "all"
number_underscore = "thousands"
quote_style = "double"
tab_width = 4
wrap_comments = true


[invariant]
runs = 4
runs = 200
depth = 256
fail_on_revert = true
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options

[rpc_endpoints]
sepolia = "${RPC_URL}"
sepolia = "${RPC_URL}"
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts-upgradeable
98 changes: 49 additions & 49 deletions script/DeployAllContract.s.sol
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "forge-std/Script.sol";
import "../src/Router.sol";
import "../src/Pool.sol";
import "../src/PoolLogic.sol";

contract DeployAllContract is Script {
function run() external {
address ZERO_ADDRESS = address(0);
// Fetch the OWNER_ADDRESS from the environment variables
address ownerAddress = vm.envAddress("OWNER_ADDRESS");
console.log("Owner address:", ownerAddress);

// Fetch the VAULT_ADDRESS from the environment variables
address vaultAddress = vm.envAddress("VAULT_ADDRESS");
console.log("Vault address:", vaultAddress);

// Fetch the PRIVATE_KEY from the environment variables
uint256 privateKey = vm.envUint("PRIVATE_KEY");

// Start broadcasting transactions
vm.startBroadcast(privateKey);

// Step 1: Deploy Pool contract
Pool pool = new Pool(vaultAddress, ZERO_ADDRESS, ZERO_ADDRESS);
console.log("Pool deployed to:", address(pool));

// Step 2: Deploy PoolLogic contract with Pool address
PoolLogic poolLogic = new PoolLogic(ownerAddress, address(pool));
console.log("PoolLogic deployed to:", address(poolLogic));

// Step 3: Deploy Router contract with Pool address
Router router = new Router(ownerAddress, address(pool));
console.log("Router deployed to:", address(router));

// Step 4: Update Pool contract with Router address
pool.updateRouterAddress(address(router));
console.log("Router address updated in Pool:", address(router));

// Step 5: Update Pool contract with PoolLogic address
pool.updatePoolLogicAddress(address(poolLogic));
console.log("PoolLogic address updated in Pool:", address(poolLogic));

// Stop broadcasting transactions
vm.stopBroadcast();
}
}
// // SPDX-License-Identifier: MIT
// pragma solidity ^0.8.0;

// import "forge-std/Script.sol";
// import "../src/Router.sol";
// import "../src/Pool.sol";
// import "../src/PoolLogic.sol";

// contract DeployAllContract is Script {
// function run() external {
// address ZERO_ADDRESS = address(0);
// // Fetch the OWNER_ADDRESS from the environment variables
// address ownerAddress = vm.envAddress("OWNER_ADDRESS");
// console.log("Owner address:", ownerAddress);

// // Fetch the VAULT_ADDRESS from the environment variables
// address vaultAddress = vm.envAddress("VAULT_ADDRESS");
// console.log("Vault address:", vaultAddress);

// // Fetch the PRIVATE_KEY from the environment variables
// uint256 privateKey = vm.envUint("PRIVATE_KEY");

// // Start broadcasting transactions
// vm.startBroadcast(privateKey);

// // Step 1: Deploy Pool contract
// Pool pool = new Pool(vaultAddress, ZERO_ADDRESS, ZERO_ADDRESS);
// console.log("Pool deployed to:", address(pool));

// // Step 2: Deploy PoolLogic contract with Pool address
// PoolLogic poolLogic = new PoolLogic(ownerAddress, address(pool));
// console.log("PoolLogic deployed to:", address(poolLogic));

// // Step 3: Deploy Router contract with Pool address
// Router router = new Router(ownerAddress, address(pool));
// console.log("Router deployed to:", address(router));

// // Step 4: Update Pool contract with Router address
// pool.updateRouterAddress(address(router));
// console.log("Router address updated in Pool:", address(router));

// // Step 5: Update Pool contract with PoolLogic address
// pool.updatePoolLogicAddress(address(poolLogic));
// console.log("PoolLogic address updated in Pool:", address(poolLogic));

// // Stop broadcasting transactions
// vm.stopBroadcast();
// }
// }
Loading

0 comments on commit 6e61b69

Please sign in to comment.