Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(contracts-rfq): CI workflows [SLT-245] #3178

Merged
merged 11 commits into from
Sep 24, 2024
2 changes: 1 addition & 1 deletion packages/contracts-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@typechain/ethers-v5": "10.0.0",
"hardhat": "2.22.2",
"rimraf": "3.0.2",
"solhint": "3.3.8",
"solhint": "5.0.3",
"typechain": "8.0.0",
"typescript": "4.7.3"
},
Expand Down
13 changes: 12 additions & 1 deletion packages/contracts-rfq/.solhint.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{
"extends": "solhint:recommended"
"extends": "solhint:recommended",
"rules": {
"code-complexity": ["error"],
"func-name-mixedcase": "error",
"func-visibility": ["error", { "ignoreConstructors": true }],
"gas-custom-errors": "off",
"immutable-vars-naming": ["error", { "immutablesAsConstants": false }],
"max-line-length": ["warn", 120],
"modifier-name-mixedcase": "error",
"ordering": "warn",
"var-name-mixedcase": "error"
}
ChiTimesChi marked this conversation as resolved.
Show resolved Hide resolved
}
5 changes: 5 additions & 0 deletions packages/contracts-rfq/.solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
contracts/FastBridge.sol
contracts/interfaces/IFastBridge.sol
script/FastBridge.s.sol
test/FastBridge.t.sol
test/FastBridgeMock.sol
ChiTimesChi marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions packages/contracts-rfq/contracts/FastBridgeV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
uint256 public nonce;
// @dev the block the contract was deployed at
uint256 public immutable deployBlock;
// TODO: remove this
uint256 public IncorrectlyNamedVariable;
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

constructor(address _owner) Admin(_owner) {
deployBlock = block.number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity ^0.8.20;
import {IFastBridge} from "./IFastBridge.sol";

interface IFastBridgeV2 is IFastBridge {

/// @notice Relays destination side of bridge transaction by off-chain relayer
/// @param request The encoded bridge transaction to relay on destination chain
/// @param relayer The address of the relaying entity which should have control of the origin funds when claimed
Expand All @@ -19,5 +18,4 @@ interface IFastBridgeV2 is IFastBridge {
/// @notice Completes bridge transaction on origin chain by claiming originally deposited capital. Can only send funds to the relayer address on the proof.
/// @param request The encoded bridge transaction to claim on origin chain
function claim(bytes memory request) external;

}
24 changes: 9 additions & 15 deletions packages/contracts-rfq/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
{
"name": "FastBridge",
"license": "UNLICENSED",
"name": "@synapsecns/contracts-rfq",
"license": "MIT",
"version": "0.4.1",
"description": "FastBridge contracts.",
"private": true,
"files": [
"src/*.sol"
"contracts/**/*.sol"
ChiTimesChi marked this conversation as resolved.
Show resolved Hide resolved
],
"dependencies": {
"@openzeppelin/contracts": "5.0.1"
},
"devDependencies": {
"@synapsecns/solidity-devops": "^0.4.5",
"prettier": "^2.5.1",
"prettier-plugin-solidity": "^1.0.0-beta.19",
"solhint": "^3.3.6"
"solhint": "5.0.3"
},
"scripts": {
"build": " ",
"build:contracts": "forge build",
"build:slither": "forge build --out=out --build-info --force",
"test:coverage": "echo 'Please use foundry'",
"test": "forge test",
"lint:contracts:fix": "forge fmt && solhint --fix -c .solhint.json '{contracts,script,test}/**/*.sol'",
"lint": "forge fmt && npm run prettier && npm run solhint",
"ci:lint": "yarn lint",
"lint": "forge fmt && npm run solhint",
"lint:check": "forge fmt --check && npm run solhint:check",
"ci:lint": "npm run lint:check",
"build:go": "./flatten.sh contracts/*.sol test/*.sol",
"prettier": "prettier --write **.sol",
"prettier:list": "prettier --list-different **.sol",
"prettier:check": "prettier --check **.sol",
"solhint": "solhint --config ./.solhint.json 'src/**/*.sol' --fix",
"solhint:check": "solhint --config ./.solhint.json 'src/**/*.sol'",
"lint:check": "npm run prettier:check && npm run solhint:check"
"solhint": "solhint '{contracts,script,test}/**/*.sol' --fix --noPrompt",
"solhint:check": "solhint '{contracts,script,test}/**/*.sol'"
}
}
2 changes: 1 addition & 1 deletion packages/contracts-rfq/test/FastBridgeV2.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"
import {Test} from "forge-std/Test.sol";
import {stdStorage, StdStorage} from "forge-std/Test.sol";

// solhint-disable no-empty-blocks
// solhint-disable no-empty-blocks, ordering
abstract contract FastBridgeV2Test is Test {
using stdStorage for StdStorage;

Expand Down
8 changes: 4 additions & 4 deletions packages/contracts-rfq/test/MockERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ contract MockERC20 is ERC20 {
_decimals = decimals_;
}

function decimals() public view override returns (uint8) {
return _decimals;
}

function burn(address account, uint256 amount) external {
_burn(account, amount);
}

function mint(address account, uint256 amount) external {
_mint(account, amount);
}

function decimals() public view override returns (uint8) {
return _decimals;
}
}
1 change: 1 addition & 0 deletions packages/contracts-rfq/test/UniversalTokenLib.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {MockRevertingRecipient} from "./MockRevertingRecipient.sol";

import {Test} from "forge-std/Test.sol";

// solhint-disable ordering
contract UniversalTokenLibraryTest is Test {
UniversalTokenLibHarness public libHarness;
MockERC20 public token;
Expand Down
1 change: 1 addition & 0 deletions packages/contracts-rfq/test/UniversalTokenLibHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity ^0.8.17;

import {UniversalTokenLib} from "../contracts/libs/UniversalToken.sol";

// solhint-disable ordering
contract UniversalTokenLibHarness {
function universalTransfer(address token, address to, uint256 value) public {
UniversalTokenLib.universalTransfer(token, to, value);
Expand Down
2 changes: 1 addition & 1 deletion packages/solidity-devops/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"vp": "js/verifyProxy.js"
},
"devDependencies": {
"solhint": "^4.5.4"
"solhint": "5.0.3"
}
}
Loading
Loading