-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More info saved in TaskInfo, change Task_id u64 to string
- Loading branch information
1 parent
5e73c24
commit e109f75
Showing
11 changed files
with
106 additions
and
51 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.23; | ||
|
||
import "forge-std/Test.sol"; | ||
import "forge-std/Vm.sol"; | ||
import "forge-std/console2.sol"; | ||
import "forge-std/Script.sol"; | ||
import {Gateway} from "../src/Gateway.sol"; | ||
import {RandomnessReciever} from "../src/RandomnessReciever.sol"; | ||
import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; | ||
import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; | ||
|
||
|
||
contract DeployScript is Script { | ||
function setUp() public {} | ||
|
||
ProxyAdmin proxyAdmin; | ||
Gateway gatewayLogic; | ||
TransparentUpgradeableProxy gatewayProxy; | ||
RandomnessReciever randomnessAddress; | ||
|
||
function run() public { | ||
vm.startBroadcast(); | ||
|
||
// Deploy Gateway Logic Contract | ||
gatewayLogic = new Gateway(); | ||
|
||
// Prepare initializer data for Gateway | ||
bytes memory initializerData = abi.encodeWithSelector( | ||
Gateway.initialize.selector | ||
); | ||
|
||
// Deploy TransparentUpgradeableProxy | ||
gatewayProxy = new TransparentUpgradeableProxy( | ||
address(gatewayLogic), | ||
address(msg.sender), | ||
initializerData | ||
); | ||
|
||
// Cast the proxy address to the Gateway interface | ||
Gateway gateway = Gateway(address(gatewayProxy)); | ||
|
||
randomnessAddress = new RandomnessReciever(); | ||
console2.logAddress(address(gateway)); | ||
|
||
randomnessAddress.setGatewayAddress(address(gateway)); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.