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

8 deploy safes gelato #10

Merged
merged 11 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
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
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.*
__tests__
coverage
jest.config.js
node_modules
build
*.md
Dockerfile
.git
Expand Down
9 changes: 1 addition & 8 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,5 @@ NODE_ENV=development
PORT=3002
CORS_REGEX=http[s]?:\/\/.*\.circles\.garden.*
FUNDER_ACCOUNT_PRIVATE_KEY=0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d
GELATO_RELAY_API_KEY=
RPC_URL=http://127.0.0.1:8545
CHAIN_ID=1337
FASTIFY_LOG_LEVEL=info
SAFE_MASTER_COPY_ADDRESS=0x2612Af3A521c2df9EAF28422Ca335b04AdF3ac66
SAFE_PROXY_FACTORY_ADDRESS=0x9b1f7F645351AF3631a656421eD2e40f2802E6c0
FALLBACK_HANDLER_ADDRESS=0x67B5656d60a809915323Bf2C40A8bEF15A152e3e
MULTI_SENT_ADDRESS=0xe982E462b094850F12AF94d21D470e21bE9D0E9C
MULTI_SEND_CALL_ONLY_ADDRESS=0x0290FB167208Af455bB137780163b7B7a9a10C16
FASTIFY_LOG_LEVEL=info
juanenrisley marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion .env.staging.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
NODE_ENV=production
PORT=3002
CORS_REGEX=http[s]?:\/\/.*\.circles\.garden.*
FUNDER_ACCOUNT_PRIVATE_KEY=
GELATO_RELAY_API_KEY=
RPC_URL=https://rpc.chiadochain.net
CHAIN_ID=10200
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ jobs:
tests:
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
DOCKER_COMPOSE: docker-compose -f docker-compose.yml -p circles
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"

steps:
- name: Add hosts to /etc/hosts
Expand All @@ -28,8 +27,8 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: 'service/.nvmrc'
cache: 'npm'
node-version-file: "service/.nvmrc"
cache: "npm"
cache-dependency-path: service/package-lock.json

- name: Checkout circles-docker repository
Expand All @@ -45,15 +44,15 @@ jobs:

- name: Container setup via docker-compose without pathfinder
working-directory: circles-docker
run: docker compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -p circles up --detach --remove-orphans --build
run: docker compose -f docker-compose.yml -p circles up --detach --remove-orphans --build

- name: Download and migrate contracts
working-directory: circles-docker
run: ./scripts/migrate-contracts.sh

- name: Try starting failed services
working-directory: circles-docker
run: docker compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -p circles up --detach --remove-orphans --build
run: docker compose -f docker-compose.yml -p circles up --detach --remove-orphans --build

- name: Install dependencies
working-directory: service
Expand Down
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,19 @@ For staging environment:
cp .env.staging.example .env
```

Required env variables to run:
Required env variables to run in Ganache:

```
FUNDER_ACCOUNT_PRIVATE_KEY=
GELATO_RELAY_API_KEY=
RPC_URL=
CHAIN_ID=
NODE_ENV=development
FUNDER_ACCOUNT_PRIVATE_KEY=<funder-private-key>
```

In some networks, as development, you must specify the deployed Safe contract addresses with the following env vars:
Required env variables to run in real networks:

```
SAFE_MASTER_COPY_ADDRESS=
SAFE_PROXY_FACTORY_ADDRESS=
FALLBACK_HANDLER_ADDRESS=
MULTI_SENT_ADDRESS=
MULTI_SEND_CALL_ONLY_ADDRESS=
NODE_ENV=production
GELATO_RELAY_API_KEY=<gelato-api-key>
CHAIN_ID=<chain-id>
```

### Run
Expand Down
77 changes: 0 additions & 77 deletions __tests__/safes.js

This file was deleted.

26 changes: 23 additions & 3 deletions __tests__/transactions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const { build } = require('fastify-cli/helper');

const { generateSaltNonce } = require('./utils');

describe('Transactions features:', () => {
const url = '/transactions';
let app;
Expand All @@ -17,7 +15,6 @@ describe('Transactions features:', () => {
url,
method: 'POST',
payload: {
nonce: generateSaltNonce(),
target: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0',
data: '0x6a761202000000000000000000000000cfeb869f69431e42cdb54a4f4f105c19c080a6010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000449951d62f00000000000000000000000090f8bf6a479f320ead074411a4b0e7944ea8c9c1000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041eb667a968b979d8406df46c7fedbc2cd6e9046a10f379baa27ddecf560b233261aba9bdc6aa8f391e45156bdac5165f12b1c1ceae2729353ebf12810302dacbc1c00000000000000000000000000000000000000000000000000000000000000',
},
Expand All @@ -27,6 +24,29 @@ describe('Transactions features:', () => {
expect(typeof response.json().taskId).toBe('string');
}));

it('Should Fund several transactions', () => {
const numberOfTxs = 3;

return Promise.all(
Array.from(Array(numberOfTxs).keys()).map(() =>
app.inject({
url,
method: 'POST',
payload: {
target: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0',
data: '0x6a761202000000000000000000000000cfeb869f69431e42cdb54a4f4f105c19c080a6010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000449951d62f00000000000000000000000090f8bf6a479f320ead074411a4b0e7944ea8c9c1000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041eb667a968b979d8406df46c7fedbc2cd6e9046a10f379baa27ddecf560b233261aba9bdc6aa8f391e45156bdac5165f12b1c1ceae2729353ebf12810302dacbc1c00000000000000000000000000000000000000000000000000000000000000',
juanenrisley marked this conversation as resolved.
Show resolved Hide resolved
},
}),
),
).then((responses) => {
expect(responses.length).toBe(numberOfTxs);
responses.forEach((response) => {
expect(response.statusCode).toBe(200);
expect(typeof response.json().taskId).toBe('string');
});
});
});

it('Should fail on incorrect transaction', () =>
app
.inject({
Expand Down
3 changes: 0 additions & 3 deletions __tests__/utils/generateSaltNonce.js

This file was deleted.

5 changes: 0 additions & 5 deletions __tests__/utils/index.js

This file was deleted.

Loading