Skip to content

Commit 07144df

Browse files
committed
style: Clean up whitespace in multiple Solidity scripts for consistency
1 parent b3c2972 commit 07144df

File tree

7 files changed

+38
-38
lines changed

7 files changed

+38
-38
lines changed

script/ConfigureRLCAdapter.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ contract Configure is Script {
1515

1616
// RLCOFT on Arbitrum Sepolia
1717
address oftAddress = vm.envAddress("ARBITRUM_SEPOLIA_RLC_OFT_ADDRESS");
18-
uint16 arbitrumSepoliaChainId = uint16(vm.envUint("LAYER_ZERO_ARBITRUM_SEPOLIA_CHAIN_ID"));
18+
uint16 arbitrumSepoliaChainId = uint16(vm.envUint("LAYER_ZERO_ARBITRUM_SEPOLIA_CHAIN_ID"));
1919

2020
// Set trusted remote
2121
adapter.setPeer(arbitrumSepoliaChainId, bytes32(uint256(uint160(oftAddress))));

script/ConfigureRLCOFT.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ contract Configure is Script {
1414
RLCOFT oft = RLCOFT(oftAddress);
1515

1616
// RLCAdapter on Ethereum Sepolia
17-
address adapterAddress = vm.envAddress("RLC_SEPOLIA_ADAPTER_ADDRESS");// Add your RLCAdapter address here
17+
address adapterAddress = vm.envAddress("RLC_SEPOLIA_ADAPTER_ADDRESS"); // Add your RLCAdapter address here
1818
uint16 ethereumSepoliaChainId = uint16(vm.envUint("LAYER_ZERO_SEPOLIA_CHAIN_ID")); // LayerZero chain ID for Ethereum Sepolia
1919

2020
// Set trusted remote

script/RLCAdapter.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ contract Deploy is Script {
2020
console.log("RLCAdapter deployed at:", address(rlcAdapter));
2121

2222
vm.stopBroadcast();
23-
23+
2424
EnvUtils.updateEnvVariable("RLC_SEPOLIA_ADAPTER_ADDRESS", address(rlcAdapter));
2525
}
2626
}

script/RLCOFT.s.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ contract Deploy is Script {
1616
string memory symbol = vm.envString("RLC_TOKEN_SYMBOL");
1717
address lzEndpoint = vm.envAddress("LAYER_ZERO_ARBITRUM_SEPOLIA_ENDPOINT_ADDRESS");
1818
address delegate = vm.envAddress("SENDER_ADDRESS");
19-
19+
2020
RLCOFT rlcOFT = new RLCOFT(name, symbol, lzEndpoint, delegate);
2121
console.log("rlcOFT deployed at:", address(rlcOFT));
2222

2323
vm.stopBroadcast();
24-
24+
2525
EnvUtils.updateEnvVariable("ARBITRUM_SEPOLIA_RLC_OFT_ADDRESS", address(rlcOFT));
2626
}
2727
}

script/SendArbitrumToEthereum.s.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ contract SendArbitrumToEthereum is Script {
2222

2323
// Contract addresses
2424
address oftAddress = vm.envAddress("ARBITRUM_SEPOLIA_RLC_OFT_ADDRESS"); // Your RLCOFT address on Arbitrum Sepolia
25-
25+
2626
// Transfer parameters
27-
uint16 destinationChainId = uint16(vm.envUint("LAYER_ZERO_SEPOLIA_CHAIN_ID")); // LayerZero chain ID for Ethereum Sepolia
27+
uint16 destinationChainId = uint16(vm.envUint("LAYER_ZERO_SEPOLIA_CHAIN_ID")); // LayerZero chain ID for Ethereum Sepolia
2828
address recipientAddress = vm.envAddress("SENDER_ADDRESS"); // Recipient on Ethereum Sepolia
2929
console.log("Recipient: %s", recipientAddress);
3030

@@ -37,7 +37,7 @@ contract SendArbitrumToEthereum is Script {
3737
// Estimate gas for the OFT endpoint
3838
bytes memory _extraOptions =
3939
abi.encodePacked(uint16(3), uint8(1), uint16(33), uint8(1), uint128(65000), uint128(0));
40-
40+
4141
SendParam memory sendParam = SendParam(
4242
destinationChainId,
4343
addressToBytes32(recipientAddress),

script/SendEthereumToArbitrum.s.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ contract SendEthereumToArbitrum is Script {
2323
vm.startBroadcast();
2424

2525
// Contract addresses
26-
address adapterAddress = vm.envAddress("RLC_SEPOLIA_ADAPTER_ADDRESS");// Your RLCAdapter address
26+
address adapterAddress = vm.envAddress("RLC_SEPOLIA_ADAPTER_ADDRESS"); // Your RLCAdapter address
2727
address rlcTokenAddress = vm.envAddress("RLC_SEPOLIA_ADDRESS"); // RLC token address on sepolia testnet
2828

2929
// Transfer parameters
30-
uint16 destinationChainId = uint16(vm.envUint("LAYER_ZERO_ARBITRUM_SEPOLIA_CHAIN_ID")); // LayerZero chain ID for Arbitrum Sepolia
30+
uint16 destinationChainId = uint16(vm.envUint("LAYER_ZERO_ARBITRUM_SEPOLIA_CHAIN_ID")); // LayerZero chain ID for Arbitrum Sepolia
3131
address recipientAddress = vm.envAddress("SENDER_ADDRESS"); // Recipient on Arbitrum (your address)
3232
uint256 amount = 5 * 10 ** 9; // RLC tokens (adjust the amount as needed)
3333

script/UpdateEnvUtils.sol

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,101 +12,101 @@ library EnvUtils {
1212
string memory envPath = ".env";
1313
string memory addressString = vm.toString(value);
1414
string memory targetVar = string.concat(variableName, "=");
15-
15+
1616
// Check if file exists
1717
if (!vm.exists(envPath)) {
1818
console.log(".env file not found");
1919
return;
2020
}
21-
21+
2222
// Read the entire file
2323
string memory content = vm.readFile(envPath);
2424
string[] memory lines = splitLines(content);
25-
25+
2626
// Process lines and make updates
2727
string memory newContent = "";
2828
bool found = false;
29-
30-
for (uint i = 0; i < lines.length; i++) {
29+
30+
for (uint256 i = 0; i < lines.length; i++) {
3131
string memory currentLine = lines[i];
32-
32+
3333
// Check if this is the line we want to replace
3434
if (startsWith(currentLine, targetVar)) {
3535
currentLine = string.concat(targetVar, addressString);
3636
found = true;
3737
}
38-
38+
3939
// Add line to new content
4040
if (i > 0) {
4141
newContent = string.concat(newContent, "\n");
4242
}
4343
newContent = string.concat(newContent, currentLine);
4444
}
45-
45+
4646
// If not found, append it
4747
if (!found) {
4848
newContent = string.concat(newContent, "\n", targetVar, addressString);
4949
}
50-
50+
5151
// Write back to file
5252
vm.writeFile(envPath, newContent);
5353
console.log("Updated .env file with new", variableName, ":", addressString);
5454
}
55-
55+
5656
// Helper function to split a string by newlines
5757
function splitLines(string memory _content) internal pure returns (string[] memory) {
5858
bytes memory content = bytes(_content);
59-
59+
6060
// Count the number of lines
61-
uint lineCount = 1;
62-
for (uint i = 0; i < content.length; i++) {
61+
uint256 lineCount = 1;
62+
for (uint256 i = 0; i < content.length; i++) {
6363
if (content[i] == bytes1("\n")) {
6464
lineCount++;
6565
}
6666
}
67-
67+
6868
// Split the content
6969
string[] memory lines = new string[](lineCount);
70-
uint lineStart = 0;
71-
uint currentLine = 0;
72-
73-
for (uint i = 0; i < content.length; i++) {
70+
uint256 lineStart = 0;
71+
uint256 currentLine = 0;
72+
73+
for (uint256 i = 0; i < content.length; i++) {
7474
if (content[i] == bytes1("\n") || i == content.length - 1) {
75-
uint lineEnd = i;
75+
uint256 lineEnd = i;
7676
if (i == content.length - 1 && content[i] != bytes1("\n")) {
7777
lineEnd = i + 1;
7878
}
79-
79+
8080
// Extract line
8181
bytes memory line = new bytes(lineEnd - lineStart);
82-
for (uint j = lineStart; j < lineEnd; j++) {
82+
for (uint256 j = lineStart; j < lineEnd; j++) {
8383
line[j - lineStart] = content[j];
8484
}
85-
85+
8686
lines[currentLine] = string(line);
8787
currentLine++;
8888
lineStart = i + 1;
8989
}
9090
}
91-
91+
9292
return lines;
9393
}
94-
94+
9595
// Helper function to check if a string starts with a prefix
9696
function startsWith(string memory _str, string memory _prefix) internal pure returns (bool) {
9797
bytes memory str = bytes(_str);
9898
bytes memory prefix = bytes(_prefix);
99-
99+
100100
if (str.length < prefix.length) {
101101
return false;
102102
}
103-
104-
for (uint i = 0; i < prefix.length; i++) {
103+
104+
for (uint256 i = 0; i < prefix.length; i++) {
105105
if (str[i] != prefix[i]) {
106106
return false;
107107
}
108108
}
109-
109+
110110
return true;
111111
}
112112
}

0 commit comments

Comments
 (0)