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

Create a deploy script in foundry script. #417

Merged
merged 215 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from 191 commits
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
e6cea0b
Create slither.yml
0xcodercrane Oct 25, 2022
294b747
move abdk to lib
0xcodercrane Oct 25, 2022
e187a79
upgrade solidity version
0xcodercrane Oct 25, 2022
acff758
update slither config
0xcodercrane Oct 25, 2022
c5259b1
add detectors to exclude list
0xcodercrane Oct 25, 2022
07139ae
Fix filter_path
0xcodercrane Oct 25, 2022
e95b4a8
wrong path
0xcodercrane Oct 25, 2022
29300d8
finalize
0xcodercrane Oct 25, 2022
ba490aa
delete out directory
0xcodercrane Oct 31, 2022
cac403e
Merge branch 'development' into integrate-slither
0xcodercrane Oct 31, 2022
1572a97
Merge branch 'development' into integrate-slither
0xcodercrane Nov 1, 2022
47a80d3
Remove unnecessary files
0xcodercrane Nov 7, 2022
9cbac83
remove dependencies for non-existing contracts
0xcodercrane Nov 8, 2022
5bca191
Revert due to dapp changes
0xcodercrane Nov 8, 2022
946a3ff
update slither config
0xcodercrane Nov 8, 2022
3d97e7c
fix unchecked-transfer issue
0xcodercrane Nov 8, 2022
1c23700
performs a multiplication on the result of division
0xcodercrane Nov 9, 2022
3e80a1a
fix too many digits and constant
0xcodercrane Nov 9, 2022
2863521
Update slither.config.json
0xcodercrane Nov 9, 2022
3578638
missing inheritance
0xcodercrane Nov 9, 2022
4bc145b
slither issues
hashedMae Dec 6, 2022
fe1631f
up to slither 204
hashedMae Dec 7, 2022
5883631
recheck slither
hashedMae Dec 7, 2022
91d5ebc
Merge branch 'development' into integrate-slither
0xcodercrane Dec 7, 2022
8a73a35
Merge branch 'Issue-284' of into integrate-slither
hashedMae Dec 7, 2022
5b26aca
Cleanup Slither Flags
hashedMae Dec 9, 2022
9645f0b
complilation errors
hashedMae Dec 9, 2022
c635e28
rentrancy, unitialized variables, return values
hashedMae Dec 9, 2022
28dbc7f
rentrancy in addLiquidity()
hashedMae Dec 9, 2022
fadfc84
gas savings in MCV2, reentrancy in CollectableDust
hashedMae Dec 10, 2022
d31f21e
gas optimization MCV2
hashedMae Dec 10, 2022
bc2a9e5
_updatePool outside loop
hashedMae Dec 10, 2022
22c0d85
Revert "_updatePool outside loop"
hashedMae Dec 10, 2022
5d004fa
fix tests
hashedMae Dec 10, 2022
a5e8435
Change Contract names to reflect Refactor
hashedMae Dec 13, 2022
5d4813f
Revert "Change Contract names to reflect Refactor"
hashedMae Dec 13, 2022
c3a1eb7
Revert "Revert "Change Contract names to reflect Refactor""
hashedMae Dec 13, 2022
536358c
Renamings
hashedMae Dec 13, 2022
a8a1248
renaming
hashedMae Dec 13, 2022
9aa94bd
Create slither.yml
0xcodercrane Oct 25, 2022
38fd06c
move abdk to lib
0xcodercrane Oct 25, 2022
96557c5
upgrade solidity version
0xcodercrane Oct 25, 2022
a356e3a
update slither config
0xcodercrane Oct 25, 2022
b57a421
add detectors to exclude list
0xcodercrane Oct 25, 2022
63bfc2a
Fix filter_path
0xcodercrane Oct 25, 2022
1ddc2ca
wrong path
0xcodercrane Oct 25, 2022
5274157
finalize
0xcodercrane Oct 25, 2022
583d094
Remove unnecessary files
0xcodercrane Nov 7, 2022
242f281
remove dependencies for non-existing contracts
0xcodercrane Nov 8, 2022
16f827a
Revert due to dapp changes
0xcodercrane Nov 8, 2022
5591034
update slither config
0xcodercrane Nov 8, 2022
70e5280
fix unchecked-transfer issue
0xcodercrane Nov 8, 2022
e01d5d8
performs a multiplication on the result of division
0xcodercrane Nov 9, 2022
c8f031b
Update slither.config.json
0xcodercrane Nov 9, 2022
c2cadd8
missing inheritance
0xcodercrane Nov 9, 2022
74de025
slither issues
hashedMae Dec 6, 2022
c8b41c4
up to slither 204
hashedMae Dec 7, 2022
54124d2
recheck slither
hashedMae Dec 7, 2022
6afff4d
Cleanup Slither Flags
hashedMae Dec 9, 2022
d763bd1
complilation errors
hashedMae Dec 9, 2022
518bcf4
rentrancy, unitialized variables, return values
hashedMae Dec 9, 2022
465df7b
gas savings in MCV2, reentrancy in CollectableDust
hashedMae Dec 10, 2022
d645dce
fix tests
hashedMae Dec 10, 2022
8fe382e
Change Contract names to reflect Refactor
hashedMae Dec 13, 2022
60a1e44
Revert "Change Contract names to reflect Refactor"
hashedMae Dec 13, 2022
f391de7
Revert "Revert "Change Contract names to reflect Refactor""
hashedMae Dec 13, 2022
851fdac
Renamings
hashedMae Dec 13, 2022
53a64db
renaming
hashedMae Dec 13, 2022
9212ca2
Merge branch 'integrate-slither' of https://github.com/ubiquity/ubiqu…
hashedMae Dec 13, 2022
7c2770f
rename refactor in progress
hashedMae Dec 13, 2022
00b0c65
finish name refactor
hashedMae Dec 15, 2022
d3137a9
json error
hashedMae Dec 15, 2022
1ce81bc
gas optimization contstructor
hashedMae Dec 15, 2022
3e235e9
bug fix
hashedMae Dec 15, 2022
683dabd
Slither ignore payable.call in CollectableDust
hashedMae Dec 15, 2022
8cdec03
slither-disable-next-line low-level-calls
hashedMae Dec 15, 2022
c02a7f5
solidity version, remove empty file
hashedMae Dec 15, 2022
e9ff916
fixed bug deploy scripts
hashedMae Dec 15, 2022
fba6bf1
same
hashedMae Dec 15, 2022
f859d04
again
hashedMae Dec 15, 2022
9fee120
build-test flow bugs
hashedMae Dec 15, 2022
90475df
build-test scripts bug
hashedMae Dec 15, 2022
68a5cdf
testFixes
hashedMae Dec 15, 2022
83557ae
Merge branch 'feat/406-protocol-deploy-script' into integrate-slither
0xcodercrane Dec 21, 2022
7251532
fix: resolve conflicts
0xcodercrane Dec 21, 2022
a317586
fix: slither issues
0xcodercrane Dec 21, 2022
2945297
fix: remove unused return
0xcodercrane Dec 21, 2022
3eb4ea3
fix: loop
0xcodercrane Dec 21, 2022
244f1aa
fix: uninitialized local
0xcodercrane Dec 21, 2022
030a7a3
fix: MUST revert
0xcodercrane Dec 21, 2022
87ad72f
Merge pull request #302 from ubiquity/integrate-slither
0xcodercrane Dec 21, 2022
0d6e022
fix: pr review easy adjustments
0x4007 Dec 22, 2022
5275c55
fix: "smart contract" is two words!
0x4007 Dec 22, 2022
9cfb1b1
fix(contracts): spelling
hashedMae Dec 22, 2022
b7e9a60
fix(dapp): deploy scripts contract name
hashedMae Dec 22, 2022
a7abdb7
fix(contracts): error capitalization
hashedMae Dec 22, 2022
93efb44
Merge pull request #424 from ubiquity/pr-302-follow-up
0x4007 Dec 22, 2022
6c22ab7
feat: solidity deployment script
hashedMae Jan 5, 2023
a54d804
feat: solidity scripting devlopment deploy
hashedMae Jan 6, 2023
584ff3f
feat: devlopment deploy twap fix
hashedMae Jan 9, 2023
53b4010
feat: deploy script
hashedMae Jan 9, 2023
a025238
Create slither.yml
0xcodercrane Oct 25, 2022
199a04d
move abdk to lib
0xcodercrane Oct 25, 2022
f1ecfce
upgrade solidity version
0xcodercrane Oct 25, 2022
a000f7f
update slither config
0xcodercrane Oct 25, 2022
152b80f
add detectors to exclude list
0xcodercrane Oct 25, 2022
b670d4a
Fix filter_path
0xcodercrane Oct 25, 2022
4c32cd8
wrong path
0xcodercrane Oct 25, 2022
ce9e3ad
finalize
0xcodercrane Oct 25, 2022
fafeb6f
Remove unnecessary files
0xcodercrane Nov 7, 2022
d429770
remove dependencies for non-existing contracts
0xcodercrane Nov 8, 2022
99075b9
Revert due to dapp changes
0xcodercrane Nov 8, 2022
ecaa922
update slither config
0xcodercrane Nov 8, 2022
e71aa79
fix unchecked-transfer issue
0xcodercrane Nov 8, 2022
182aafa
performs a multiplication on the result of division
0xcodercrane Nov 9, 2022
41cf8c8
Update slither.config.json
0xcodercrane Nov 9, 2022
3512536
missing inheritance
0xcodercrane Nov 9, 2022
ebf25bc
slither issues
hashedMae Dec 6, 2022
3787dcc
up to slither 204
hashedMae Dec 7, 2022
8886272
recheck slither
hashedMae Dec 7, 2022
c765817
Cleanup Slither Flags
hashedMae Dec 9, 2022
06dc9f8
complilation errors
hashedMae Dec 9, 2022
30ec3fd
rentrancy, unitialized variables, return values
hashedMae Dec 9, 2022
020981b
gas savings in MCV2, reentrancy in CollectableDust
hashedMae Dec 10, 2022
bf2551a
fix tests
hashedMae Dec 10, 2022
1831fb4
Change Contract names to reflect Refactor
hashedMae Dec 13, 2022
075871c
Renamings
hashedMae Dec 13, 2022
1c09d8c
renaming
hashedMae Dec 13, 2022
cb0f0f4
move abdk to lib
0xcodercrane Oct 25, 2022
2fb7eb1
upgrade solidity version
0xcodercrane Oct 25, 2022
1c23e87
update slither config
0xcodercrane Oct 25, 2022
a76d050
add detectors to exclude list
0xcodercrane Oct 25, 2022
696cc6f
Fix filter_path
0xcodercrane Oct 25, 2022
3584e8d
wrong path
0xcodercrane Oct 25, 2022
d64301c
finalize
0xcodercrane Oct 25, 2022
67198ab
delete out directory
0xcodercrane Oct 31, 2022
79739c5
Remove unnecessary files
0xcodercrane Nov 7, 2022
b9f456e
remove dependencies for non-existing contracts
0xcodercrane Nov 8, 2022
63026ad
Revert due to dapp changes
0xcodercrane Nov 8, 2022
f41a3c9
update slither config
0xcodercrane Nov 8, 2022
bd43429
fix unchecked-transfer issue
0xcodercrane Nov 8, 2022
2735174
Update slither.config.json
0xcodercrane Nov 9, 2022
24e6f4c
missing inheritance
0xcodercrane Nov 9, 2022
8af4e30
slither issues
hashedMae Dec 6, 2022
81d26da
fix tests
hashedMae Dec 10, 2022
2effa32
Change Contract names to reflect Refactor
hashedMae Dec 13, 2022
c6d24a6
Renamings
hashedMae Dec 13, 2022
f751a13
renaming
hashedMae Dec 13, 2022
71bb410
rename refactor in progress
hashedMae Dec 13, 2022
8f7b89f
finish name refactor
hashedMae Dec 15, 2022
29035c5
gas optimization contstructor
hashedMae Dec 15, 2022
13f4a93
bug fix
hashedMae Dec 15, 2022
17708f5
Slither ignore payable.call in CollectableDust
hashedMae Dec 15, 2022
774da10
slither-disable-next-line low-level-calls
hashedMae Dec 15, 2022
bfda33e
solidity version, remove empty file
hashedMae Dec 15, 2022
18bc02d
fixed bug deploy scripts
hashedMae Dec 15, 2022
466200c
same
hashedMae Dec 15, 2022
8ad5bdf
again
hashedMae Dec 15, 2022
4efce14
build-test flow bugs
hashedMae Dec 15, 2022
5d2b4ee
build-test scripts bug
hashedMae Dec 15, 2022
2a8ca19
testFixes
hashedMae Dec 15, 2022
236af92
fix: resolve conflicts
0xcodercrane Dec 21, 2022
a69f6e0
fix: slither issues
0xcodercrane Dec 21, 2022
b957217
fix: remove unused return
0xcodercrane Dec 21, 2022
65b6c1a
fix: loop
0xcodercrane Dec 21, 2022
8f6d541
fix: uninitialized local
0xcodercrane Dec 21, 2022
1c472ac
fix: MUST revert
0xcodercrane Dec 21, 2022
a78ec9f
fix: pr review easy adjustments
0x4007 Dec 22, 2022
95fe05c
fix: "smart contract" is two words!
0x4007 Dec 22, 2022
91a2dc5
fix(contracts): spelling
hashedMae Dec 22, 2022
035347f
fix(dapp): deploy scripts contract name
hashedMae Dec 22, 2022
1f9c525
fix(contracts): error capitalization
hashedMae Dec 22, 2022
86fb7b2
feat: solidity deployment script
hashedMae Jan 5, 2023
49f792f
feat: solidity scripting devlopment deploy
hashedMae Jan 6, 2023
986b3a1
feat: devlopment deploy twap fix
hashedMae Jan 9, 2023
25f7f40
feat: deploy script
hashedMae Jan 9, 2023
95d3e58
Merge branch 'feat/406-protocol-deploy-script' of https://github.com/…
hashedMae Jan 11, 2023
39d0e62
fix: rebase
hashedMae Jan 11, 2023
60af560
fix(UbiquityChef): slither
hashedMae Jan 11, 2023
a375900
fix(slither): constructors
hashedMae Jan 11, 2023
8d0ac5b
Update packages/contracts/src/dollar/core/CreditNFTManager.sol
hashedMae Jan 12, 2023
6d4d2bc
fix: variable name
hashedMae Jan 12, 2023
7a94780
fix(slither): immutable values
hashedMae Jan 12, 2023
dbddb32
Merge branch 'feat/406-protocol-deploy-script' of https://github.com/…
hashedMae Jan 12, 2023
6fc145f
fix: PR review changes
hashedMae Jan 12, 2023
bca8894
fix: bash and solidity script bugs
hashedMae Jan 12, 2023
767151f
feat: yarn workspace commands
hashedMae Jan 12, 2023
39e2d04
Update packages/contracts/src/dollar/core/TWAPOracleDollar3pool.sol
hashedMae Jan 16, 2023
65b03dd
feat: PR comments
hashedMae Jan 16, 2023
9fcec89
Merge branch 'feat/406-protocol-deploy-script' of https://github.com/…
hashedMae Jan 16, 2023
5285033
fix: natSpec comment typo
hashedMae Jan 16, 2023
df7f1b6
feat: remove bash script from package.json
hashedMae Jan 19, 2023
45e1701
Update package.json
hashedMae Jan 23, 2023
5215f31
Update packages/contracts/src/dollar/utils/SafeAddArray.sol
hashedMae Jan 23, 2023
66b6033
feat(deploy script): PR reccomendations
hashedMae Jan 23, 2023
03467be
Merge branch 'feat/406-protocol-deploy-script' of https://github.com/…
hashedMae Jan 23, 2023
7300928
feat(deployment script): change readme and anvil.ts
hashedMae Jan 23, 2023
754a657
fix(slither): error in SafeAddArrray.sol
hashedMae Jan 23, 2023
1e64040
fix(slither): error in SafeAddArrray.sol
hashedMae Jan 23, 2023
4569b88
fix(solidity scripts): review comments
hashedMae Jan 24, 2023
09cef80
fix(solidity scripting): pr comments
hashedMae Jan 24, 2023
2eb2153
fix(solidity scripting): pr comments
hashedMae Jan 24, 2023
c8f9b38
Merge https://github.com/ubiquity/ubiquity-dollar into feat/406-proto…
hashedMae Jan 24, 2023
fae018d
merge development into 406
hashedMae Jan 24, 2023
1b59552
Merge branch 'feat/406-protocol-deploy-script' of https://github.com/…
hashedMae Jan 24, 2023
7beb1a9
fix: contract dependency conflict
hashedMae Jan 25, 2023
9093296
fix: contract dependency conflict
hashedMae Jan 25, 2023
e46b26c
fix:broken tests
hashedMae Jan 25, 2023
cdffbf2
fix: failing tests
hashedMae Jan 25, 2023
4acace3
feat(solidity scripting): anvil use rpc list
hashedMae Jan 26, 2023
16ebb36
fix(slither): unchecked transfer
hashedMae Jan 27, 2023
4bc71b0
fix(slither): multiplication on result of division
hashedMae Jan 27, 2023
e351bab
fix(slither): multiplication on result of division
hashedMae Jan 27, 2023
3174952
fix: redundant code
hashedMae Jan 27, 2023
5291674
fix: staking
hashedMae Jan 31, 2023
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
38 changes: 38 additions & 0 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Static Anaysis with Slither

on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

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

- name: Install solc-select
run: pip3 install solc-select

- name: Install solc 0.8.16
run: |
solc-select install 0.8.16
solc-select use 0.8.16

- name: Install Slither
run: pip3 install slither-analyzer

- name: Install dependencies
run: |
yarn install
yarn workspace @ubiquity/contracts forge install

- name: Test with Slither
run: yarn workspace @ubiquity/contracts run slither:run
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ fixtures/contracts-addresses/*
cache
build
out
packages/contracts/broadcast/*
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
[submodule "packages/contracts/lib/forge-std"]
path = packages/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "packages/contracts/lib/abdk-libraries-solidity"]
hashedMae marked this conversation as resolved.
Show resolved Hide resolved
path = packages/contracts/lib/abdk-libraries-solidity
url = https://github.com/abdk-consulting/abdk-libraries-solidity
[submodule "packages/contracts/lib/operator-filter-registry"]
path = packages/contracts/lib/operator-filter-registry
url = https://github.com/ProjectOpenSea/operator-filter-registry
url = https://github.com/ProjectOpenSea/operator-filter-registry
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"postinstall": "husky install"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,sol}": [
"*.{js,jsx,ts,tsx,json, sol}": [
hashedMae marked this conversation as resolved.
Show resolved Hide resolved
"prettier --write",
"eslint --fix",
"cspell --no-must-find-files"
Expand Down
5 changes: 4 additions & 1 deletion packages/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ tab_width = 2
line_length = 80
tab_width = 4
bracket_spacing = false
quote_style = 'double'
quote_style = 'double'

[rpc_endpoints]
mainnet = "${RPC_URL}"
1 change: 1 addition & 0 deletions packages/contracts/lib/abdk-libraries-solidity
9 changes: 7 additions & 2 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@
"forge": "forge",
"build": "forge build",
"test": "ts-node ./scripts/runner/runner.ts",
"slither:run": "slither . --compile-force-framework foundry",
"slither:run": "slither . --compile-force-framework foundry --config-file slither.config.json",
"echidna": "echidna-test . --config echidna.config.yml",
"prettier": "forge fmt",
hashedMae marked this conversation as resolved.
Show resolved Hide resolved
"deploy": "ts-node ./scripts/deploy/deploy.ts",
"deploy:diamond": "ts-node ./scripts/deploy/manager/DiamondInAll.ts",
"task": "ts-node ./scripts/task/task.ts",
"clean": "forge clean",
"purge": "yarn clean"
"purge": "yarn clean",
"anvil": "ts-node ./scripts/anvil/anvil.ts",
hashedMae marked this conversation as resolved.
Show resolved Hide resolved
"run deploy:development": "bash ./scripts/bash/2_DevelopmentDeploy.sh"
hashedMae marked this conversation as resolved.
Show resolved Hide resolved
},
"keywords": [
"stablecoin",
Expand All @@ -57,5 +59,8 @@
"postinstall-postinstall": false,
"husky": false
}
},
"devDependencies": {
"cspell": "latest"
}
}
1 change: 1 addition & 0 deletions packages/contracts/remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ ds-test/=lib/forge-std/lib/ds-test/src/
solidity-linked-list/=lib/solidity-linked-list
@uniswap/v2-core/contracts/=lib/Uniswap/v2-core/contracts
@uniswap/v2-periphery/contracts/=lib/Uniswap/v2-periphery/contracts
abdk/=lib/abdk-libraries-solidity/
35 changes: 35 additions & 0 deletions packages/contracts/scripts/anvil/anvil.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import axios from "axios";
import { spawn } from "child_process";
import { RPC_LIST, RPC_DELAY, REQ_BODY, RESP_STATUS } from "./conf";

const getRandom = async (array: string[]) => {
const length = array == null ? 0 : array.length;
return length ? array[Math.floor(Math.random() * length)] : undefined;
};

const getUrl = async () => {
let isRPC = false;

while (!isRPC) {
try {
const rpcUrl = await getRandom(RPC_LIST);
const resp = await axios.post(rpcUrl as string, REQ_BODY);

if (resp.status === RESP_STATUS) {
isRPC = true;
return rpcUrl;
}
} catch (error) {
await setTimeout(() => ({}), RPC_DELAY);
}
}
};

(async () => {
const currentRPC = await getUrl();
console.log(`using ${currentRPC} for anvil...`);
const command = spawn("anvil", ["-f", currentRPC as string, "-m", "test test test test test test test test test test test junk", "--chain-id", "31337"]);
command.stdout.on("data", (output: any) => {
console.log(output.toString());
});
})();
20 changes: 20 additions & 0 deletions packages/contracts/scripts/anvil/conf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const RPC_DELAY = 300;

export const RPC_LIST: string[] = [
"https://ethereum.publicnode.com",
"https://cloudflare-eth.com",
"https://rpc.ankr.com/eth",
"https://eth-mainnet.public.blastapi.io",
"https://eth-mainnet-public.unifra.io",
"https://nodes.mewapi.io/rpc/eth",
"https://rpc.flashbots.net",
];

export const REQ_BODY = {
method: "eth_blockNumber",
params: [],
id: "1",
jsonrpc: "2.0",
};

export const RESP_STATUS = 200;
15 changes: 15 additions & 0 deletions packages/contracts/scripts/bash/2_DevelopmentDeploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

source .env

# Impersonates an account with high 3crv token balance
cast rpc anvil_impersonateAccount 0x72A916702BD97923E55D78ea5A3F413dEC7F7F85 -r http://localhost:8545

# Transfers tokens to default first account for Anvil
cast send 0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490 0xa9059cbb000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000021e19e0c9bab2400000 --from 0x72A916702BD97923E55D78ea5A3F413dEC7F7F85

# Ends account impersonation
cast rpc anvil_stopImpersonatingAccount 0x72A916702BD97923E55D78ea5A3F413dEC7F7F85 -r http://localhost:8545

# Deploys Protocol to Anvil Localchain
forge script scripts/deploy/dollar/solidityScripting/08_DevelopmentDeploy.s.sol:DevelopmentDeploy --fork-url http://localhost:8545 --broadcast
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import "src/dollar/core/CreditNFT.sol";
import "src/dollar/core/CreditNFTManager.sol";
import "src/dollar/core/CreditNFTRedemptionCalculator.sol";
import "src/dollar/core/CreditRedemptionCalculator.sol";
import "src/dollar/core/DollarMintCalculator.sol";
import "src/dollar/core/DollarMintExcess.sol";
import "src/dollar/core/TWAPOracleDollar3pool.sol";
import "src/dollar/core/UbiquityCreditToken.sol";
import "src/dollar/core/UbiquityDollarManager.sol";
import "src/dollar/core/UbiquityDollarToken.sol";
import "src/dollar/core/UbiquityGovernanceToken.sol";
import "src/dollar/interfaces/IMetaPool.sol";

import "src/dollar/DirectGovernanceFarmer.sol";
import "src/dollar/Staking.sol";
import "src/dollar/StakingFormulas.sol";
import "src/dollar/StakingShare.sol";
import "src/dollar/UbiquityChef.sol";
import "src/dollar/UbiquityFormulas.sol";

import "../../../../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";

import "forge-std/Script.sol";


contract Constants is Script {

address[] originals;
uint256[] lpAmounts;
uint256[] terms;
uint256[] shareAmounts;
uint256[] ids;

string uri;
address admin = 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266;
address curveWhale = 0x72A916702BD97923E55D78ea5A3F413dEC7F7F85;
address USDCrvToken = 0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490;
address basepool = 0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7;
address curveFactory = 0xB9fC157394Af804a3578134A6585C0dc9cc990d4;

uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");

address[36] public users_ = [
0x89eae71B865A2A39cBa62060aB1b40bbFFaE5b0D,
0xefC0e701A824943b469a694aC564Aa1efF7Ab7dd,
0xa53A6fE2d8Ad977aD926C485343Ba39f32D3A3F6,
0x7c76f4DB70b7E2177de10DE3e2f668daDcd11108,
0x4007CE2083c7F3E18097aeB3A39bb8eC149a341d,
0xf6501068a54f3EAb46C1F145CB9d3fb91658B220,
0x10693e86f2e7151B3010469E33b6C1C2dA8887d6,
0xCEFD0E73cC48B0b9d4C8683E52B7d7396600AbB2,
0xD028BaBBdC15949aAA35587f95F9E96c7d49417D,
0x9968eFe1424D802e1f79FD8aF8dA67b0f08C814d,
0xd3BC13258e685df436715104882888d087f87ED8,
0x0709B103d46d71458a71e5d81230DD688809A53D,
0xE3E39161d35E9A81edEc667a5387bfAE85752854,
0x7c361828849293684DdF7212Fd1d2Cb5f0aADe70,
0x9d3F4EEB533B8e3C8f50dbbD2E351D1BF2987908,
0x865Dc9A621B50534BA3d17e0Ea8447C315E31886,
0x324E0b53CefA84CF970833939249880f814557c6,
0xcE156D5d62a8F82326dA8d808D0f3F76360036D0,
0x26bdDe6506bd32bD7B5Cc5C73cd252807fF18568,
0xD6EfC21d8c941AA06F90075dE1588ac7E912Fec6,
0xe0D62CC9233C7E2F1f23fE8C77D6b4D1a265D7Cd,
0x0B54B916E90b8f28ad21dA40638E0724132C9c93,
0x629cd43eAF443e66A9a69ED246728E1001289EAC,
0x0709e442A5469B88bB090dD285b1B3a63fb0c226,
0x94A2fFDbDbD84984AC7967878C5C397126E7BBBe,
0x51EC66e63199176f59C80268e0Be6fFa91Fab220,
0x0a71e650F70B35fca8b70e71E4441df8D44E01e9,
0xC1b6052E707dfF9017DEAb13ae9B89008FC1Fc5d,
0x9be95ef84676393588e49Ad8B99c9d4CdFdAA631,
0xFFFFF6E70842330948Ca47254F2bE673B1cb0dB7,
0x0000CE08fa224696A819877070BF378e8B131ACF,
0xC2cb4B1bCAEbAa78c8004e394CF90BA07A61C8f7,
0xB2812370f17465AE096Ced55679428786734a678,
0x3eb851c3959F0d37E15C2d9476C4ADb46d5231D1,
0xad286cF287b91719eE85d3ba5cF3DA483D631Dba,
0xbD37A957773D883186B989f6b21c209459022252
];

uint256[36] public amounts_ = [
1301000000000000000,
3500000000000000000000,
9351040526163838324896,
44739174270101943975392,
74603879373206500005186,
2483850000000000000000,
1878674425540571814543,
8991650309086743220575,
1111050988607803612915,
4459109737462155546375,
21723000000000000000000,
38555895255762442000000,
5919236274824521937931,
1569191092350025897388,
10201450658519659933880,
890339946944155414434,
5021119790948940093253,
761000000000000000000,
49172294677407855270013,
25055256356185888278372,
1576757078627228869179,
3664000000000000000000,
1902189597146391302863,
34959771702943278635904,
9380006436252701023610,
6266995559166564365470,
100000000000000000000,
3696476262155265118082,
740480000000000000000,
2266000000000000000000,
1480607760433248019987,
24702171480214199310951,
605000000000000000000,
1694766661387270251234,
14857000000000000000000,
26000000000000000000
];

uint256[36] public lockups_ = [
176,
30,
208,
208,
208,
32,
208,
208,
4,
1,
67,
208,
208,
109,
12,
29,
1,
1,
3,
4,
7,
1,
128,
2,
4,
3,
208,
6,
1,
208,
2,
1,
12,
208,
4,
208
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import "./00_Constants.sol";

contract ManagerScript is Constants {
UbiquityDollarManager manager;
function run() public virtual {

uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
hashedMae marked this conversation as resolved.
Show resolved Hide resolved
vm.startBroadcast(deployerPrivateKey);

manager = new UbiquityDollarManager(admin);
manager.setTreasuryAddress(admin);
manager.grantRole(manager.GOVERNANCE_TOKEN_MANAGER_ROLE(), admin);
IERC20(USDCrvToken).transfer(address(manager), 10000e18);

vm.stopBroadcast();
}
}
Loading