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

Production push #1420

Merged
merged 70 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
0b03759
Implement fetching coin prices from CoinGecko
mudrila Feb 27, 2024
2942280
Leverage useFormatCoins for showing treasury total on DAO dashboard page
mudrila Feb 28, 2024
22b4d13
empty commit
adamgall Feb 28, 2024
324edbe
Merge branch 'develop' into fix/show-token-prices
adamgall Feb 28, 2024
2cd70e5
Merge branch 'release-v0.1.8' into develop
adamgall Mar 1, 2024
3bc074c
The ProposalActions buttons, which show up in Proposal list cards, no…
adamgall Mar 1, 2024
e1f77e1
Add Netlify function tokenPrices, route request to CoinGecko, cache t…
mudrila Mar 4, 2024
2d6de29
Refactor and cleanup of storing/getting prices
mudrila Mar 4, 2024
ea7aa8f
Fix returningprice for ETH
mudrila Mar 4, 2024
c5b477a
Try fixing token fiat balance overflow
mudrila Mar 4, 2024
88f356a
Use ethers.constants.MaxUint256 instead of Number max value
mudrila Mar 4, 2024
3e5f170
Use smaller multiplicator
mudrila Mar 4, 2024
59dd067
Add math.round
mudrila Mar 4, 2024
e5afb36
Merge branch 'develop' into fix/show-token-prices
mudrila Mar 4, 2024
78cf343
Merge pull request #1397 from decent-dao/bug/#1396-nested-anchor-tags
adamgall Mar 4, 2024
969f712
Delete the RELEASES.md doc, it's not relevant any longer
adamgall Mar 6, 2024
b7ef35f
Remove windows specific scripts from package.json
adamgall Mar 6, 2024
4f19bf3
set:env script wasn't working, so inlined into dev, start, start:https
adamgall Mar 6, 2024
8926efb
Use the git shorthash as version identifier in Footer
adamgall Mar 6, 2024
2befe63
Remove version property from package.json
adamgall Mar 6, 2024
49d744b
Remove GENERATE_SOURCEMAP=false from some npm scripts
adamgall Mar 6, 2024
a7b7890
Remove the start and start:https scripts
adamgall Mar 6, 2024
0f31fd6
Build the graphql client when `npm run dev`
adamgall Mar 6, 2024
6781722
Rename netlify function, fix returning response error, better typing …
mudrila Mar 6, 2024
8633535
Handle better CoinGecko requesting error and return cached prices
mudrila Mar 6, 2024
a3783d4
Show cached prices on FE if request to CoinGecko failed
mudrila Mar 6, 2024
effde42
Add start and start:https scripts back
adamgall Mar 6, 2024
e22463e
Remove unused import
adamgall Mar 6, 2024
d25dead
Delete unnecessary commands from start scripts
adamgall Mar 6, 2024
8ad9700
temp - remove start scripts
adamgall Mar 6, 2024
6cfbe66
Adding the `start` script back
adamgall Mar 6, 2024
e229bb0
Merge pull request #1410 from decent-dao/remove-version
adamgall Mar 6, 2024
97930a9
Added some more explicit code and comments
adamgall Mar 6, 2024
9252d6e
Do not execute request to netlify function if tokensAddresses is empt…
mudrila Mar 6, 2024
50e148d
Merge pull request #1415 from decent-dao/fix/show-token-prices-2
mudrila Mar 6, 2024
88899cf
Merge branch 'develop' into fix/show-token-prices
mudrila Mar 6, 2024
2c92f7b
Trying changing possibleCachedTokenPrices filtering null values
mudrila Mar 6, 2024
873df06
Fix filtering logic of uncached token prices
mudrila Mar 6, 2024
15e1564
Use rawTokenAddresses for allUncachedTokenAddresses instead of splitt…
mudrila Mar 6, 2024
7c03888
Handle a lot of cases:
adamgall Mar 7, 2024
b207d66
Refactor to compartmentalize code
adamgall Mar 7, 2024
e70037d
Split stores per network
mudrila Mar 7, 2024
91c0326
Add network param to the tokenPrices function
mudrila Mar 7, 2024
4cdd6f1
Refactor useEthersProvider and useEthersSigner to return singleton in…
mudrila Mar 7, 2024
5213594
Reduce usages of useEthersProvider, fix lint errors, add more conditi…
mudrila Mar 7, 2024
0d5bfe8
Update prettier, make it play nicer with eslint, fix the package.json…
adamgall Mar 7, 2024
b025ac5
Auto fix prettier problems
adamgall Mar 7, 2024
a02fa68
Add github action to lint and pretty
adamgall Mar 7, 2024
ad98cf4
Build grapql client before running jobs
adamgall Mar 7, 2024
d17a103
Fix another batch of TS errors
mudrila Mar 7, 2024
d969571
Moar linting fixes
mudrila Mar 7, 2024
2248280
Fix token address chain namespacing
mudrila Mar 7, 2024
d17ae4e
Move location of a variable in .env
adamgall Mar 7, 2024
0141cce
Update the Sentry imports
adamgall Mar 7, 2024
621771c
Swap expiration with time of fetching
mudrila Mar 7, 2024
96420f8
Cleanup comments
mudrila Mar 7, 2024
dfaa285
Reverse adding cacheTime
mudrila Mar 7, 2024
e629f27
Add env var for Sentry DSN url
adamgall Mar 7, 2024
b5a93f5
Fix cached token addresses filtering
mudrila Mar 7, 2024
d92b932
Clean up area that inits Sentry, we want it running on all deployed s…
adamgall Mar 7, 2024
2f85687
Convert minutes to seconds, specify in variable names that we're deal…
adamgall Mar 7, 2024
11303a7
Merge pull request #1416 from decent-dao/prettier-eslint-cleanup
adamgall Mar 7, 2024
7720d94
Merge commit '11303a767df67e67e8007ca20e07894b268e3269' into fix/show…
adamgall Mar 7, 2024
daf34df
Prettier updates
adamgall Mar 7, 2024
c3dd1c9
Merge commit '11303a767df67e67e8007ca20e07894b268e3269' into refactor…
adamgall Mar 7, 2024
ed46ee2
Pretty fix
adamgall Mar 7, 2024
d4b6591
Merge pull request #1382 from decent-dao/fix/show-token-prices
adamgall Mar 7, 2024
16d38f1
Merge pull request #1417 from decent-dao/refactor/ethers-provider-and…
adamgall Mar 7, 2024
17743aa
Merge commit '16d38f15ff41f0c12548071bb5415cb4a5734e59' into sentry-u…
adamgall Mar 7, 2024
73410e8
Merge pull request #1418 from decent-dao/sentry-updates
adamgall Mar 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# CoinGecko API key
COINGECKO_API_KEY=""
# Alchemy provider API key, used on Mainnet
NEXT_PUBLIC_ALCHEMY_MAINNET_API_KEY=""
# Alchemy provider API key, used on Sepolia
Expand All @@ -10,9 +12,13 @@ NEXT_PUBLIC_ETHERSCAN_API_KEY=""
NEXT_PUBLIC_INFURA_IPFS_API_KEY=""
# IPFS pinning (*)
NEXT_PUBLIC_INFURA_IPFS_API_SECRET=""
# Sentry DSN URL, not used locally
NEXT_PUBLIC_SENTRY_DSN_URL=""
# Shutter Public Key
NEXT_PUBLIC_SHUTTER_EON_PUBKEY=0x0e6493bbb4ee8b19aa9b70367685049ff01dc9382c46aed83f8bc07d2a5ba3e6030bd83b942c1fd3dff5b79bef3b40bf6b666e51e7f0be14ed62daaffad47435265f5c9403b1a801921981f7d8659a9bd91fe92fb1cf9afdb16178a532adfaf51a237103874bb03afafe9cab2118dae1be5f08a0a28bf488c1581e9db4bc23ca
# site preview links
NEXT_PUBLIC_SITE_URL="https://app.dev.fractalframework.xyz/"
# WalletConnect Cloud Project ID
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=""
# Shutter Public Key
NEXT_PUBLIC_SHUTTER_EON_PUBKEY=0x0e6493bbb4ee8b19aa9b70367685049ff01dc9382c46aed83f8bc07d2a5ba3e6030bd83b942c1fd3dff5b79bef3b40bf6b666e51e7f0be14ed62daaffad47435265f5c9403b1a801921981f7d8659a9bd91fe92fb1cf9afdb16178a532adfaf51a237103874bb03afafe9cab2118dae1be5f08a0a28bf488c1581e9db4bc23ca
# Minutes to cache prices for token addresses
TOKEN_PRICE_CACHE_INTERVAL_MINUTES=""
146 changes: 62 additions & 84 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,89 +1,67 @@
{
"env": {
"browser": true,
"es2021": true
"env": {
"browser": true,
"es2021": true
},
"extends": [
"next/core-web-vitals",
"plugin:import/recommended",
"airbnb-typescript/base",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
// required for "type-aware linting"
"project": ["./tsconfig.json"],
"ecmaFeatures": {
"jsx": true
},
"extends": [
"next/core-web-vitals",
"plugin:import/recommended",
"airbnb-typescript/base"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
// required for "type-aware linting"
"project": [
"./tsconfig.json"
],
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["import", "@typescript-eslint"],
"settings": {
// resolves imports without file extensions for listed extensions
"import/resolver": {
"node": {
"extensions": [".ts", ".tsx"]
}
},
"plugins": [
"import",
"@typescript-eslint",
"prettier"
"react": {
"version": "detect"
}
},
"rules": {
// ignores need for "react" import
"react/react-in-jsx-scope": "off",
// rule for function component to be framed as function
"react/function-component-definition": [
2,
{
"namedComponents": "function-declaration"
}
],
"settings": {
// resolves imports without file extensions for listed extensions
"import/resolver": {
"node": {
"extensions": [
".ts",
".tsx"
]
}
},
"react": {
"version": "detect"
"comma-dangle": "off",
"@typescript-eslint/comma-dangle": "off",
"indent": "off",
"@typescript-eslint/indent": "off",
"import/order": [
"error",
{
"alphabetize": {
"order": "asc",
"caseInsensitive": false
}
},
"rules": {
// ignores need for "react" import
"react/react-in-jsx-scope": "off",
// rule for function component to be framed as function
"react/function-component-definition": [
2,
{
"namedComponents": "function-declaration"
}
],
"comma-dangle": "off",
"@typescript-eslint/comma-dangle": "off",
"indent": "off",
"@typescript-eslint/indent": "off",
// prettier config
"prettier/prettier": [
1,
{
"printWidth": 100,
"endOfLine": "auto",
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": true,
"arrowParens": "avoid",
"singleAttributePerLine": true
}
],
"import/order": [
"error",
{
"alphabetize": {
"order": "asc",
"caseInsensitive": false
}
}
],
// react hook rules
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
// var rules
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/no-unused-vars": "warn",
// class rules
"@typescript-eslint/lines-between-class-members": "off"
}
}
}
],
// react hook rules
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
// var rules
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/no-unused-vars": "warn",
// class rules
"@typescript-eslint/lines-between-class-members": "off"
}
}
22 changes: 11 additions & 11 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
2 changes: 0 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@

- If possible, please provide unit or integration tests for your changes. You can see example
automation tests in the [test directory](https://github.com/decent-dao/fractal-interface/tree/HEAD/tests).

- All of your components should be composed of [Chakra UI](https://chakra-ui.com/) base components, using our custom theme.

- A member of the Fractal engineering team will respond with any further discussion or requested changes and once approved
you are free to merge.

- We appreciate the collaboration!

### Submitting Language Translations
Expand Down
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Please include the following information in your email:

If you prefer secure communication, please use the following GPG key:

https://keys.openpgp.org/search?q=security%40decent-dao.org
https://keys.openpgp.org/search?q=security%40decent-dao.org
37 changes: 37 additions & 0 deletions .github/workflows/code-syntax.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Code Syntax
on:
push:
branches:
- develop
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Build GraphQL client
run: npm run graphql:build
- name: Run tests
run: npm run lint
pretty:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Build GraphQL client
run: npm run graphql:build
- name: Run tests
run: npm run pretty:check
1 change: 0 additions & 1 deletion .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,3 @@ jobs:
docker rm webapp
docker stop blockchain
docker rm blockchain

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ yarn-error.log*

# GraphQL generated files
.graphclient/

# Local Netlify folder
.netlify
2 changes: 1 addition & 1 deletion .graphclientrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ sources:
endpoint: https://api.studio.thegraph.com/query/43215/fractal-{context.chainName:sepolia}/version/latest

documents:
- ./src/graphql/DAO.graphql
- ./src/graphql/DAO.graphql
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.12.1
18.14.0
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/assets/typechain-types/
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 100,
"endOfLine": "auto",
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": true,
"arrowParens": "avoid",
"singleAttributePerLine": true
}
10 changes: 0 additions & 10 deletions .prettierrc.json

This file was deleted.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ $ npm run graphql:build # For UNIX
```

Running development environment

```shell
$ npm run dev
```
Expand Down Expand Up @@ -81,8 +82,8 @@ The "dev" environment tracks the `develop` branch, "staging" tracks `staging`, a
So at any given time, there are effectively three builds out there, and they are publicly accessible and privately configurable within Github:

1. dev site
- url: https://app.dev.fractalframework.xyz
- url: https://app.dev.fractalframework.xyz
2. staging site
- url: https://app.staging.fractalframework.xyz
- url: https://app.staging.fractalframework.xyz
3. prod site
- url: https://app.fractalframework.xyz
- url: https://app.fractalframework.xyz
6 changes: 3 additions & 3 deletions app/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export default function DaoCreatePage() {
setRedirectPending(true);
const { getAddress } = ethers.utils;
const daoFound = await requestWithRetries(
() => safeAPI.getSafeCreationInfo(getAddress(daoAddress)),
8
async () => (safeAPI ? safeAPI.getSafeCreationInfo(getAddress(daoAddress)) : undefined),
8,
);
toggleFavorite(daoAddress);
if (daoFound) {
Expand All @@ -45,7 +45,7 @@ export default function DaoCreatePage() {
push(BASE_ROUTES.landing);
}
},
[safeAPI, requestWithRetries, toggleFavorite, push, t]
[safeAPI, requestWithRetries, toggleFavorite, push, t],
);

const [deploy, pending] = useDeployDAO();
Expand Down
2 changes: 1 addition & 1 deletion app/daos/[daoAddress]/edit/governance/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function ModifyGovernancePage() {
deployAzorius(
daoData as AzoriusERC20DAO | AzoriusERC721DAO,
!daoName || createAccountSubstring(daoAddress!) === daoName,
!daoSnapshotURL && !!daoData.snapshotURL
!daoSnapshotURL && !!daoData.snapshotURL,
);
};

Expand Down
6 changes: 3 additions & 3 deletions app/daos/[daoAddress]/proposal-templates/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ export default function CreateProposalTemplatePage() {
const searchParams = useSearchParams();
const defaultProposalTemplatesHash = useMemo(
() => searchParams?.get('templatesHash'),
[searchParams]
[searchParams],
);
const defaultProposalTemplateIndex = useMemo(
() => searchParams?.get('templateIndex'),
[searchParams]
[searchParams],
);

const {
Expand Down Expand Up @@ -141,7 +141,7 @@ export default function CreateProposalTemplatePage() {
push(
daoAddress
? DAO_ROUTES.proposalTemplates.relative(daoAddress)
: BASE_ROUTES.landing
: BASE_ROUTES.landing,
)
}
isButtonDisabled={pendingCreateTx}
Expand Down
Loading