Skip to content

Commit

Permalink
Merge pull request #7 from bobanetwork/wsdt/general-cleanup
Browse files Browse the repository at this point in the history
chore: Frontend deployed
  • Loading branch information
wsdt authored Jul 30, 2024
2 parents e7f968c + c8e2622 commit a2734d3
Show file tree
Hide file tree
Showing 65 changed files with 4,233 additions and 6,710 deletions.
9 changes: 4 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "openzeppelin-contracts"]
path = openzeppelin-contracts
[submodule "contracts/lib/openzeppelin-contracts"]
path = contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
branch = release-v4.8
4 changes: 2 additions & 2 deletions backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ services:
context: ./offchain
dockerfile: ../Dockerfile
ports:
- "${OC_LISTEN_PORT:-3000}:${OC_LISTEN_PORT:-3000}"
- "${OC_LISTEN_PORT:-1234}:${OC_LISTEN_PORT:-1234}"
env_file: .env
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${OC_LISTEN_PORT:-3000}/hc"]
test: ["CMD", "curl", "-f", "http://localhost:${OC_LISTEN_PORT:-1234}/hc"]
interval: 30s
timeout: 10s
retries: 3
Expand Down
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "aa-hc-backend",
"name": "aa-hc-example-backend",
"version": "1.0.0",
"main": "index.js",
"scripts": {
Expand Down
45 changes: 45 additions & 0 deletions contracts/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Show Forge version
run: |
forge --version
- name: Run Forge fmt
run: |
forge fmt --check
id: fmt

- name: Run Forge build
run: |
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
14 changes: 14 additions & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Compiler files
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/

# Docs
docs/

# Dotenv file
.env
7 changes: 4 additions & 3 deletions contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[profile.default]
src = 'contracts'
out = 'out'
src = "src"
out = "out"
libs = ['node_modules', 'lib']
test = 'test'
cache_path = 'cache_forge'
Expand All @@ -10,4 +10,5 @@ remappings = [
"@openzeppelin/=node_modules/@openzeppelin/",
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
"hardhat/=node_modules/hardhat/"
]
]

6 changes: 2 additions & 4 deletions contracts/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
// testEnvironment: "node",
// moduleNameMapper: {
// '^@/(.*)$': '<rootDir>/src/$1'
// }
testMatch: ["<rootDir>/test/**/*.test.{js,jsx,ts,tsx}"],
testEnvironment: "node",
}
1 change: 1 addition & 0 deletions contracts/lib/forge-std
Submodule forge-std added at 07263d
1 change: 1 addition & 0 deletions contracts/lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at dbb610
8 changes: 4 additions & 4 deletions contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "aa-hc",
"name": "aa-hc-example-contracts",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "ts-node src/backend/server.ts",
"test": "jest"
"build": "forge build",
"test": "forge test && jest"
},
"license": "MIT",
"devDependencies": {
Expand All @@ -28,7 +28,7 @@
"@types/supertest": "^6.0.2",
"axios-mock-adapter": "^1.22.0",
"chai": "4",
"ethers": "5",
"ethers": "^6.13.2",
"hardhat": "^2.22.6",
"hardhat-gas-reporter": "^2.2.0",
"jest": "^29.7.0",
Expand Down
62 changes: 31 additions & 31 deletions contracts/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions contracts/scripts/deploy.s.sol → contracts/script/deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
pragma solidity ^0.8.13;

import "forge-std/Script.sol";
import "../contracts/core/EntryPoint.sol";
import "../contracts/core/HCHelper.sol";
import "../contracts/samples/HybridAccountFactory.sol";
import "../contracts/samples/SimpleAccountFactory.sol";
import "../contracts/TokenPrice.sol";
import "../src/core/EntryPoint.sol";
import "../src/core/HCHelper.sol";
import "../src/samples/HybridAccountFactory.sol";
import "../src/samples/SimpleAccountFactory.sol";
import "../src/TokenPrice.sol";
//import "openzeppelin-contracts/contracts/mocks/InitializableMock.sol";
// forge script scripts/deploy.sol:DeployExample --rpc-url http://localhost:9545 --broadcast

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ contract TokenPrice {
helperAddr = _helperAddr;
}

function getTest(string calldata token) public {
tokenPrices[token] = TokenPriceStruct({
price: "10",
timestamp: block.timestamp
});
}

function fetchPrice(string calldata token) public {
HybridAccount ha = HybridAccount(payable(helperAddr));
string memory price;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit a2734d3

Please sign in to comment.