Skip to content

Commit

Permalink
fix: deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
Attens1423 committed Nov 4, 2024
1 parent efe94a5 commit 1007ab5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/DODOApproveProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface IDODOApproveProxy {
contract DODOApproveProxy is InitializableOwnable {

// ============ Storage ============
uint256 private constant _TIMELOCK_DURATION_ = 3 days;
uint256 private constant _TIMELOCK_DURATION_ = 3;
mapping (address => bool) public _IS_ALLOWED_PROXY_;
uint256 public _TIMELOCK_;
address public _PENDING_ADD_DODO_PROXY_;
Expand Down
20 changes: 16 additions & 4 deletions scripts/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import "forge-std/Script.sol";
import "../contracts/SmartRoute/DODOGasProxy.sol";
import "../contracts/DODOApprove.sol";
import "../contracts/DODOApproveProxy.sol";
import "../contracts/SmartRoute/DOODGasDistributor.sol";

contract DeployScript is Script {
function run() external {
// Get deployer private key from env
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
address deployer = vm.addr(deployerPrivateKey);
address approveOwner = 0x...;
address gasOwner = 0x...;
vm.startBroadcast(deployerPrivateKey);

// Deploy DODOApprove
Expand All @@ -22,27 +25,36 @@ contract DeployScript is Script {
);

// Initialize DODOApprove with owner and proxy
dodoApprove.init(deployer, address(dodoApproveProxy));
dodoApprove.init(approveOwner, address(dodoApproveProxy));

// Set bot address for DODOGasProxy
address bot = 0x1Dc662D3D7De14a57CD369e3a9E774f8F80d4214;
address bot = 0x...;

// Deploy DODOGasProxy
DODOGasProxy gasProxy = new DODOGasProxy(
deployer,
gasOwner,
bot,
address(dodoApproveProxy)
);

// Deploy DOODGasDistributor
uint256 maxAmount = 0.03 ether; // Set initial max amount to 0.01 ETH
DOODGasDistributor distributor = new DOODGasDistributor(
gasOwner,
bot,
maxAmount
);

// Initialize DODOApproveProxy with owner and initial proxies
address[] memory initialProxies = new address[](1);
initialProxies[0] = address(gasProxy);
dodoApproveProxy.init(deployer, initialProxies);
dodoApproveProxy.init(approveOwner, initialProxies);


console.log("DODOApprove deployed to:", address(dodoApprove));
console.log("DODOApproveProxy deployed to:", address(dodoApproveProxy));
console.log("DODOGasProxy deployed to:", address(gasProxy));
console.log("DOODGasDistributor deployed to:", address(distributor));

vm.stopBroadcast();
}
Expand Down

0 comments on commit 1007ab5

Please sign in to comment.