Skip to content

Commit

Permalink
feat: ci to zetachain repo (#137)
Browse files Browse the repository at this point in the history
* feat: ci to zetachain repo

* remove unsed code

* update test

* remove old code

* update yaml

* remove unused code
  • Loading branch information
andresaiello authored Dec 12, 2023
1 parent 2f39eff commit 86eb10e
Show file tree
Hide file tree
Showing 47 changed files with 3,412 additions and 3,055 deletions.
11 changes: 0 additions & 11 deletions .changeset/config.json

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require("path");

const OFF = 0;

/**
* @type {import("eslint").Linter.Config}
*/
Expand All @@ -19,6 +21,7 @@ module.exports = {
rules: {
"@typescript-eslint/sort-type-union-intersection-members": "error",
camelcase: "off",
"no-console": OFF,
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",
"sort-keys-fix/sort-keys-fix": "error",
Expand Down
47 changes: 0 additions & 47 deletions .github/actions/build-docker-images/action.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/actions/set-branch-name/action.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/build.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint TS/JS

on:
pull_request:
branches:
- "*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: yarn install

- name: Lint
run: yarn lint
42 changes: 0 additions & 42 deletions .github/workflows/release.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/semantic-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Semantic PR"
on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test

on:
pull_request:
branches:
- "*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: yarn install

- name: Test
run: yarn test
working-directory: packages/zeta-app-contracts

- name: Test
run: yarn test
working-directory: packages/zevm-app-contracts

3 changes: 0 additions & 3 deletions packages/zeta-app-contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import type { HardhatUserConfig } from "hardhat/types";

dotenv.config();

const PRIVATE_KEYS = process.env.PRIVATE_KEY !== undefined ? [`0x${process.env.PRIVATE_KEY}`] : [];

const config: HardhatUserConfig = {
//@ts-ignore
etherscan: {
Expand All @@ -37,7 +35,6 @@ const config: HardhatUserConfig = {
{ version: "0.6.6" /** For uniswap v2 */ },
{ version: "0.8.7" },
{ version: "0.4.18" /** For WETH / WZETA */ },

],
settings: {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
MultiChainValueMock,
MultiChainValueMock__factory as MultiChainValueMockFactory,
ZetaConnectorMockValue,
ZetaConnectorMockValue__factory as ZetaConnectorMockValueFactory
ZetaConnectorMockValue__factory as ZetaConnectorMockValueFactory,
} from "../../typechain-types";

const networkName = network.name;
Expand All @@ -19,7 +19,7 @@ const networkName = network.name;
*/
export const deployMultiChainValueMock = async ({
zetaConnectorMockAddress,
zetaTokenMockAddress
zetaTokenMockAddress,
}: {
zetaConnectorMockAddress: string;
zetaTokenMockAddress: string;
Expand Down Expand Up @@ -47,7 +47,7 @@ export const getMultiChainValue = (existingContractAddress?: string) => {
contractName: "MultiChainValue",
...(existingContractAddress
? { existingContractAddress }
: { deployParams: [getAddress("connector", networkName), getAddress("zetaToken", networkName)] })
: { deployParams: [getAddress("connector", networkName), getAddress("zetaToken", networkName)] }),
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const buildBytecode = (constructorTypes: any[], constructorArgs: any[], c

export const buildCreate2Address = (saltHex: string, byteCode: string, factoryAddress: string) => {
const payload = ethers.utils.keccak256(
`0x${["ff", factoryAddress, saltHex, ethers.utils.keccak256(byteCode)].map(x => x.replace(/0x/, "")).join("")}`
`0x${["ff", factoryAddress, saltHex, ethers.utils.keccak256(byteCode)].map((x) => x.replace(/0x/, "")).join("")}`
);

return `0x${payload.slice(-40)}`.toLowerCase();
Expand Down Expand Up @@ -39,7 +39,7 @@ export async function deployContractToAddress({
contractBytecode,
constructorTypes = [] as string[],
constructorArgs = [] as any[],
signer
signer,
}: {
constructorArgs?: any[];
constructorTypes?: string[];
Expand All @@ -55,14 +55,14 @@ export async function deployContractToAddress({
const computedAddr = await factory.findCreate2Address(salt, bytecode);

const tx = await factory.safeCreate2(salt, bytecode, {
gasLimit: 6000000
gasLimit: 6000000,
});
const result = await tx.wait();

return {
address: computedAddr as string,
receipt: result as TransactionReceipt,
txHash: result.transactionHash as string
txHash: result.transactionHash as string,
};
}

Expand Down
4 changes: 2 additions & 2 deletions packages/zeta-app-contracts/lib/shared/deploy.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type GetContractParams<Factory extends ContractFactory> =
export const getContract = async <Factory extends ContractFactory, Contract extends BaseContract>({
contractName,
deployParams,
existingContractAddress
existingContractAddress,
}: GetContractParams<Factory> & { contractName: string }): Promise<Contract> => {
const ContractFactory = (await ethers.getContractFactory(contractName)) as Factory;

Expand All @@ -35,5 +35,5 @@ export const getContract = async <Factory extends ContractFactory, Contract exte
export const getErc20 = async (existingContractAddress?: string) =>
getContract<ERC20Factory, ERC20>({
contractName: "ERC20",
...(existingContractAddress ? { existingContractAddress } : { deployParams: ["ERC20Mock", "ERC20Mock"] })
...(existingContractAddress ? { existingContractAddress } : { deployParams: ["ERC20Mock", "ERC20Mock"] }),
});
Loading

0 comments on commit 86eb10e

Please sign in to comment.