Skip to content

Commit a9185a5

Browse files
authored
ci: Fix main coverage report on Codecov (#111)
1 parent c246169 commit a9185a5

19 files changed

+106
-80
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Default
22

33
on:
4+
push:
5+
branches:
6+
- main # To trigger coverage updates of `main` on Codecov
47
pull_request:
58
workflow_call:
69
inputs:
@@ -48,7 +51,7 @@ jobs:
4851
SEPOLIA_RPC_URL: ${{ inputs.SEPOLIA_RPC_URL || vars.SEPOLIA_RPC_URL }}
4952
ARBITRUM_SEPOLIA_RPC_URL: ${{ inputs.ARBITRUM_SEPOLIA_RPC_URL || vars.ARBITRUM_SEPOLIA_RPC_URL }}
5053
run: make generate-coverage
51-
54+
5255
- name: Upload coverage reports to Codecov
5356
uses: codecov/codecov-action@v5
5457
with:

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,13 @@ The scripts automatically calculate these fees and include them in the transacti
339339
340340
## How to release:
341341
342-
<!-- TODO use main branch and create PR for artifacts -->
343-
* First, deploy on Testnets and make sure all tests are ok.
344-
* Create a release branch `release/X.X.X` that starts from the `main` branch.
345-
- Note that GitHub environments `arbitrum` and `ethereum` can only be used with `release/*` branches. The `main` branch cannot be used as the CI will not be able to commit deployment artifacts.
346-
* Commit required changes (salt, ...)
347-
* Go to "Actions" section on GitHub
348-
* Trigger `Deploy contracts` job and choose the correct release branch and the target Github environment.
342+
> **Note**:<br>
343+
> Always deploy and validate on the Testnet first!
344+
345+
* Go to "Actions" section on GitHub.
346+
* Trigger the `Deploy contracts` job then choose the correct deployment branch and the target GitHub environment.
347+
348+
Note that production GitHub environments `arbitrum` and `ethereum` can only be used with the `main` branch.
349349
350350
## TODO
351351

docs/soldoc/src/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,13 @@ The scripts automatically calculate these fees and include them in the transacti
339339
340340
## How to release:
341341
342-
<!-- TODO use main branch and create PR for artifacts -->
343-
* First, deploy on Testnets and make sure all tests are ok.
344-
* Create a release branch `release/X.X.X` that starts from the `main` branch.
345-
- Note that GitHub environments `arbitrum` and `ethereum` can only be used with `release/*` branches. The `main` branch cannot be used as the CI will not be able to commit deployment artifacts.
346-
* Commit required changes (salt, ...)
347-
* Go to "Actions" section on GitHub
348-
* Trigger `Deploy contracts` job and choose the correct release branch and the target Github environment.
342+
> **Note**:<br>
343+
> Always deploy and validate on the Testnet first!
344+
345+
* Go to "Actions" section on GitHub.
346+
* Trigger the `Deploy contracts` job then choose the correct deployment branch and the target GitHub environment.
347+
348+
Note that production GitHub environments `arbitrum` and `ethereum` can only be used with the `main` branch.
349349
350350
## TODO
351351

script/RLCCrosschainToken.s.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ contract Deploy is Script {
5656
address createxFactory,
5757
bytes32 createxSalt
5858
) public returns (address) {
59-
bytes memory initData =
60-
abi.encodeWithSelector(RLCCrosschainToken.initialize.selector, name, symbol, initialAdmin, initialUpgrader);
59+
bytes memory initData = abi.encodeWithSelector(
60+
RLCCrosschainToken.initialize.selector, name, symbol, initialAdmin, initialUpgrader
61+
);
6162
return UUPSProxyDeployer.deployUsingCreateX("RLCCrosschainToken", "", initData, createxFactory, createxSalt);
6263
}
6364
}

script/TransferAdminRole.s.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ pragma solidity ^0.8.22;
55

66
import {Script} from "forge-std/Script.sol";
77
import {console} from "forge-std/console.sol";
8-
import {IAccessControlDefaultAdminRules} from
9-
"@openzeppelin/contracts/access/extensions/IAccessControlDefaultAdminRules.sol";
8+
import {
9+
IAccessControlDefaultAdminRules
10+
} from "@openzeppelin/contracts/access/extensions/IAccessControlDefaultAdminRules.sol";
1011
import {ConfigLib} from "./lib/ConfigLib.sol";
1112
import {RLCLiquidityUnifier} from "../src/RLCLiquidityUnifier.sol";
1213
import {RLCCrosschainToken} from "../src/RLCCrosschainToken.sol";

script/lib/ConfigLib.sol

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ library ConfigLib {
109109
params.createxFactory = config.readAddress(".createxFactory");
110110
params.rlcToken = getRLCTokenAddress(config, prefix);
111111
(
112-
params.rlcCrosschainTokenCreatexSalt,
113-
params.rlcLiquidityUnifierCreatexSalt,
114-
params.iexecLayerZeroBridgeCreatexSalt
115-
) = getAllCreatexParams(config, prefix);
112+
params.rlcCrosschainTokenCreatexSalt,
113+
params.rlcLiquidityUnifierCreatexSalt,
114+
params.iexecLayerZeroBridgeCreatexSalt
115+
) = getAllCreatexParams(config, prefix);
116116
params.rlcCrosschainTokenAddress = getRLCCrosschainTokenAddress(config, prefix);
117117
params.rlcLiquidityUnifierAddress = getLiquidityUnifierAddress(config, prefix);
118118
params.approvalRequired = config.readBool(string.concat(prefix, ".approvalRequired"));
@@ -161,8 +161,9 @@ library ConfigLib {
161161
*/
162162
function _validateJsonContent(string memory content) private pure {
163163
try vm.parseJson(content) {
164-
// JSON is valid, proceed
165-
} catch {
164+
// JSON is valid, proceed
165+
}
166+
catch {
166167
console.log("Invalid JSON in config file");
167168
revert("Invalid JSON format");
168169
}

script/lib/UUPSProxyDeployer.sol

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ library UUPSProxyDeployer {
3232
address createxFactory,
3333
bytes32 createxSalt
3434
) internal returns (address) {
35-
address implementation =
36-
deployImplementationUsingCreateX(contractName, constructorData, createxFactory, createxSalt);
37-
address proxy = ICreateX(createxFactory).deployCreate2AndInit(
38-
createxSalt,
39-
abi.encodePacked(type(ERC1967Proxy).creationCode, abi.encode(implementation, "")), // initCode
40-
initializeData,
41-
ICreateX.Values({constructorAmount: 0, initCallAmount: 0}) // values for CreateX
35+
address implementation = deployImplementationUsingCreateX(
36+
contractName, constructorData, createxFactory, createxSalt
4237
);
38+
address proxy = ICreateX(createxFactory)
39+
.deployCreate2AndInit(
40+
createxSalt,
41+
abi.encodePacked(type(ERC1967Proxy).creationCode, abi.encode(implementation, "")), // initCode
42+
initializeData,
43+
ICreateX.Values({constructorAmount: 0, initCallAmount: 0}) // values for CreateX
44+
);
4345
console.log("UUPS Proxy deployed at:", proxy);
4446
return proxy;
4547
}

src/RLCCrosschainToken.sol

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
pragma solidity ^0.8.22;
55

66
import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
7-
import {AccessControlDefaultAdminRulesUpgradeable} from
8-
"@openzeppelin/contracts-upgradeable/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol";
7+
import {
8+
AccessControlDefaultAdminRulesUpgradeable
9+
} from "@openzeppelin/contracts-upgradeable/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol";
910
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
10-
import {ERC20PermitUpgradeable} from
11-
"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol";
12-
import {ERC20BridgeableUpgradeable} from
13-
"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20BridgeableUpgradeable.sol";
11+
import {
12+
ERC20PermitUpgradeable
13+
} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol";
14+
import {
15+
ERC20BridgeableUpgradeable
16+
} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20BridgeableUpgradeable.sol";
1417
import {ITokenSpender} from "./interfaces/ITokenSpender.sol";
1518

1619
/**
@@ -101,13 +104,26 @@ contract RLCCrosschainToken is
101104
* @dev Authorizes upgrades of the proxy. It can only be called by
102105
* an account with the UPGRADER_ROLE.
103106
*/
104-
function _authorizeUpgrade(address /*newImplementation*/ ) internal override onlyRole(UPGRADER_ROLE) {}
107+
function _authorizeUpgrade(
108+
address /*newImplementation*/
109+
)
110+
internal
111+
override
112+
onlyRole(UPGRADER_ROLE)
113+
{}
105114

106115
/**
107116
* Checks if the caller is a trusted token bridge that is allowed by iExec to call
108117
* `crosschainMint` or `crosschainBurn` functions.
109118
* @dev This function is called by the modifier `onlyTokenBridge` in the
110119
* `ERC20BridgeableUpgradeable` contract.
111120
*/
112-
function _checkTokenBridge(address /*caller*/ ) internal view override onlyRole(TOKEN_BRIDGE_ROLE) {}
121+
function _checkTokenBridge(
122+
address /*caller*/
123+
)
124+
internal
125+
view
126+
override
127+
onlyRole(TOKEN_BRIDGE_ROLE)
128+
{}
113129
}

src/RLCLiquidityUnifier.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ pragma solidity ^0.8.22;
55

66
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
77
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
8-
import {AccessControlDefaultAdminRulesUpgradeable} from
9-
"@openzeppelin/contracts-upgradeable/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol";
8+
import {
9+
AccessControlDefaultAdminRulesUpgradeable
10+
} from "@openzeppelin/contracts-upgradeable/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol";
1011
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
1112
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
1213
import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol";

src/bridges/layerZero/IexecLayerZeroBridge.sol

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import {OFTCoreUpgradeable} from "@layerzerolabs/oft-evm-upgradeable/contracts/o
77
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
88
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
99
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
10-
import {AccessControlDefaultAdminRulesUpgradeable} from
11-
"@openzeppelin/contracts-upgradeable/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol";
10+
import {
11+
AccessControlDefaultAdminRulesUpgradeable
12+
} from "@openzeppelin/contracts-upgradeable/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol";
1213
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
1314
import {DualPausableUpgradeable} from "../utils/DualPausableUpgradeable.sol";
1415
import {IIexecLayerZeroBridge} from "../../interfaces/IIexecLayerZeroBridge.sol";
@@ -312,7 +313,11 @@ contract IexecLayerZeroBridge is
312313
* @param amountLD The amount of tokens to mint (in local decimals)
313314
* @return amountReceivedLD The amount of tokens actually minted
314315
*/
315-
function _credit(address to, uint256 amountLD, uint32 /*_srcEid*/ )
316+
function _credit(
317+
address to,
318+
uint256 amountLD,
319+
uint32 /*_srcEid*/
320+
)
316321
internal
317322
override
318323
whenNotPaused

0 commit comments

Comments
 (0)