Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
noahlitvin committed Jul 30, 2024
1 parent e2ed4fd commit a6ff592
Show file tree
Hide file tree
Showing 6 changed files with 1,236 additions and 799 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
simulate-deploy:
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install
working-directory: packages/protocol

- name: Simulate deploy on Sepolia
run: pnpm run simulate-deploy:sepolia
working-directory: packages/protocol
38 changes: 19 additions & 19 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,42 @@
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/next-js": "^2.2.0",
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@rainbow-me/rainbowkit": "^2.0.5",
"@tanstack/react-query": "^5.29.2",
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@rainbow-me/rainbowkit": "^2.1.3",
"@tanstack/react-query": "^5.51.15",
"@uniswap/sdk-core": "^5.3.1",
"@uniswap/v3-core": "^1.0.1",
"@uniswap/v3-sdk": "^3.13.1",
"date-fns": "^3.6.0",
"framer-motion": "^10.17.9",
"framer-motion": "^10.18.0",
"lodash": "^4.17.21",
"next": "^14.0.4",
"next": "^14.2.5",
"next-pwa": "^5.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.52.1",
"react-icons": "^4.12.0",
"recharts": "^2.12.7",
"viem": "~2.9.20",
"wagmi": "^2.5.20"
"viem": "~2.9.32",
"wagmi": "^2.12.2"
},
"devDependencies": {
"@commitlint/cli": "^18.4.4",
"@commitlint/config-conventional": "^18.4.4",
"@commitlint/cz-commitlint": "^18.4.4",
"@playwright/test": "^1.40.1",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.3",
"@commitlint/cz-commitlint": "^18.6.1",
"@playwright/test": "^1.45.3",
"@types/lodash": "^4.17.7",
"@types/react": "^18.3.3",
"commitizen": "^4.3.0",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"eslint-config-next": "^14.0.4",
"eslint-config-sznm": "^2.0.2",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.5",
"eslint-config-sznm": "^2.0.3",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"lint-staged": "^15.2.7",
"next-sitemap": "^4.2.3",
"prettier": "^3.1.1",
"prettier": "^3.3.3",
"standard-version": "^9.5.0",
"typescript": "^5.5.4"
},
Expand Down
30 changes: 14 additions & 16 deletions packages/app/src/lib/components/foil/positionSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from 'react';
import type React from 'react';
import type { AbiFunction } from 'viem';
import { useAccount, useReadContract } from 'wagmi';
import { useAccount, useReadContract, useReadContracts } from 'wagmi';

import useFoilDeployment from './useFoilDeployment';
import { MarketContext } from '~/lib/context/MarketProvider';
Expand All @@ -39,32 +39,30 @@ const useTokenIdsOfOwner = (ownerAddress: `0x${string}`) => {
const [tokenIds, setTokenIds] = useState<number[]>([]);

useEffect(() => {
if (balanceResult.data) {
const balance = parseInt(balanceResult.data.toString(), 10);
const tokenContracts = times(balance, (index) => ({
abi: foilData.abi as AbiFunction[],
address: foilData.address as `0x${string}`,
functionName: 'tokenOfOwnerByIndex',
args: [ownerAddress, index],
}));
/*
const fetchTokenIds = async () => {
const fetchTokenIds = async () => {
if (balanceResult.data) {
const balance = parseInt(balanceResult.data.toString(), 10);
const tokenContracts = times(balance, (index) => ({
abi: foilData.abi,
address: foilData.address as `0x${string}`,
functionName: 'tokenOfOwnerByIndex',
args: [ownerAddress, index],
}));
const tokensInfo = await useReadContracts({
contracts: tokenContracts,
});

if (tokensInfo.data?.length) {
// Extract token IDs from the responses
const ids = tokensInfo.data.map((resp) =>
parseInt(resp.data.toString(), 10)
parseInt(resp.toString(), 10)
);
setTokenIds(ids);
}
};
}
};

fetchTokenIds();
*/
}
fetchTokenIds();
}, [balanceResult.data, foilData.abi, foilData.address, ownerAddress]);

return tokenIds;
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/lib/components/foil/traderPosition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ export default function TraderPosition({}) {

const handleSlippageChange = (newSlippage: number) => {
setSlippage(newSlippage);
console.log(`Slippage tolerance updated to: ${newSlippage}%`);
};

return (
Expand Down
9 changes: 4 additions & 5 deletions packages/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
"version": "0.1.0",
"scripts": {
"test": "",
"dev": "cannon build --wipe --keep-alive --port 8545 --no-cors",
"update-abis:local": "cannon build --wipe && cannon inspect foil --write-deployments ../app/deployments && cannon inspect foil --write-deployments ../data/deployments && cannon inspect foil --write-deployments ./deployments/test/",
"update-abis": "cannon build --wipe && cannon inspect foil --write-deployments ../app/deployments/13370 && cannon inspect foil --write-deployments ../data/deployments/13370 && cannon inspect foil --write-deployments ./deployments/13370/test/",
"simulate-deploy:sepolia": "cannon build cannonfile.sepolia.toml --chain-id 11155111 --dry-run",
"update-run": "cannon build && cannon inspect foil --write-deployments ./deployments/13370 && cannon build --keep-alive --port 8545 --no-cors"
"dev": "cannon build --keep-alive --port 8545 --no-cors --write-deployments ./deployments/13370",
"update-abis:local": "cannon build --write-deployments ../app/deployments && cannon inspect foil --write-deployments ../data/deployments && cannon inspect foil --write-deployments ./deployments/test/",
"update-abis": "cannon build && cannon inspect foil --write-deployments ../app/deployments/13370 && cannon inspect foil --write-deployments ../data/deployments/13370 && cannon inspect foil --write-deployments ./deployments/13370/test/",
"simulate-deploy:sepolia": "cannon build cannonfile.sepolia.toml --chain-id 11155111 --dry-run"
},
"devDependencies": {
"@types/chai": "^4.3.16",
Expand Down
Loading

0 comments on commit a6ff592

Please sign in to comment.