Skip to content

Commit 1105856

Browse files
committed
feat: update deployment script to return proxy address and use environment variable for RPC URL in tests
1 parent 463175b commit 1105856

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

script/RLCOFT.s.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {EnvUtils} from "./UpdateEnvUtils.sol";
99
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
1010

1111
contract Deploy is Script {
12-
function run() external {
12+
function run() external returns (address) {
1313
vm.startBroadcast();
1414

1515
string memory name = vm.envString("RLC_OFT_TOKEN_NAME");
@@ -31,6 +31,7 @@ contract Deploy is Script {
3131
vm.stopBroadcast();
3232

3333
EnvUtils.updateEnvVariable("RLC_ARBITRUM_SEPOLIA_OFT_ADDRESS", address(rlcOFTProxy));
34+
return address(rlcOFTProxy);
3435
}
3536
}
3637

test/RLCOFT.t.sol

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ contract RLCOFTTest is Test {
2020
event Transfer(address indexed from, address indexed to, uint256 value);
2121

2222
function setUp() public {
23-
vm.createSelectFork("https://arbitrum-sepolia.gateway.tenderly.com");
23+
vm.createSelectFork(vm.envString("ARBITRUM_SEPOLIA_RPC_URL"));
2424

2525
// Create addresses using makeAddr
2626
owner = makeAddr("owner");
@@ -32,14 +32,12 @@ contract RLCOFTTest is Test {
3232
// Set up environment variables for the deployment
3333
vm.setEnv("RLC_OFT_TOKEN_NAME", "RLC OFT Test");
3434
vm.setEnv("RLC_TOKEN_SYMBOL", "RLCT");
35-
vm.setEnv("LAYER_ZERO_ARBITRUM_SEPOLIA_ENDPOINT_ADDRESS", vm.toString('LAYER_ZERO_ARBITRUM_SEPOLIA_ENDPOINT_ADDRESS'));
35+
vm.setEnv("LAYER_ZERO_ARBITRUM_SEPOLIA_ENDPOINT_ADDRESS", "0x6EDCE65403992e310A62460808c4b910D972f10f");
3636
vm.setEnv("OWNER_ADDRESS", vm.toString(owner));
3737
vm.setEnv("PAUSER_ADDRESS", vm.toString(pauser));
3838

3939
// Deploy the contract using the deployment script
40-
RLCOFTDeploy deployer = new RLCOFTDeploy();
41-
address deployedAddress = deployer.run();
42-
rlcOft = RLCOFT(deployedAddress);
40+
rlcOft = RLCOFT(new RLCOFTDeploy().run());
4341

4442
// Mint some tokens for testing
4543
vm.prank(owner);

0 commit comments

Comments
 (0)