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

Frax.mainh #232

Open
wants to merge 51 commits into
base: FortisFortuna-patch-FraxUnifiedFarm_ERC20_V2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
67fe28c
prep for crosschain frxETH
FortisFortuna Jan 7, 2023
eda9388
minor fix
FortisFortuna Jan 7, 2023
0a157a4
compile fix
FortisFortuna Jan 7, 2023
fc4e427
frxETH ferry stuff
FortisFortuna Jan 12, 2023
b119318
Merge branch 'master' into travis
FortisFortuna Jan 12, 2023
81bb542
periodic update
FortisFortuna Jan 24, 2023
54e5ddb
Periodic update. Old contract cleanup + FXS Fraxferry prep (#189)
FortisFortuna Jan 24, 2023
19a3f68
Update FraxUnifiedFarm_ERC20_V2.sol (#186)
FortisFortuna Jan 24, 2023
bdc4480
From ZrowGz
FortisFortuna Jan 24, 2023
189e536
From ZrowGz
FortisFortuna Jan 24, 2023
f37eba4
logic checks (#183)
ZrowGz Jan 24, 2023
5eecfc3
Add address code length check to onLockRecieved (#190)
ZrowGz Jan 26, 2023
84cd6d2
Update FraxUnifiedFarm_ERC20_V2.sol (#191)
ZrowGz Feb 2, 2023
c70515f
Add 2 step ownership transfer to veFPIS
FortisFortuna Feb 3, 2023
50cab69
Correct event emission in `_stakeLocked` (#194)
ZrowGz Feb 13, 2023
f6ebf2a
bug fixes (#195)
ZrowGz Feb 13, 2023
833b8d4
Fixes for issues found by Macro, part 1 (#197)
ZrowGz Feb 23, 2023
7e1b1e9
periodic update
FortisFortuna Feb 23, 2023
cfd4eec
periodic pre-merge
FortisFortuna Feb 23, 2023
58970f5
C2tP + ZrowGz additions
FortisFortuna Mar 14, 2023
0e36c9f
Update FraxUnifiedFarmTemplate_V2.sol
FortisFortuna Mar 14, 2023
952dc17
zksync stuff and farms
FortisFortuna Apr 3, 2023
b409981
Merge branch 'master' into travis
FortisFortuna Apr 3, 2023
806991d
Merge pull request #208 from FraxFinance/travis
FortisFortuna Apr 3, 2023
dee120c
Create binance-fxs.txt
FortisFortuna Apr 11, 2023
214de07
Delete binance-fxs.txt
FortisFortuna Apr 11, 2023
6a8e238
Create binance-fxs.md
FortisFortuna Apr 11, 2023
d80df6a
Update binance-fxs.md
FortisFortuna Apr 11, 2023
2a9e538
periodic
FortisFortuna May 25, 2023
aa9d457
Merge pull request #209 from FraxFinance/travis
FortisFortuna May 25, 2023
75de289
misc updates
FortisFortuna Jun 6, 2023
816d622
Merge pull request #210 from FraxFinance/travis
FortisFortuna Jun 6, 2023
12bdd2c
periodic update
FortisFortuna Jul 21, 2023
afede25
Merge pull request #211 from FraxFinance/travis
FortisFortuna Jul 21, 2023
d3516d0
periodic update
FortisFortuna Sep 7, 2023
fc9810d
Merge pull request #212 from FraxFinance/travis
FortisFortuna Sep 7, 2023
090ab4a
periodic update
FortisFortuna Nov 14, 2023
967002f
Merge pull request #216 from FraxFinance/travis
FortisFortuna Nov 14, 2023
bc44682
periodic update
FortisFortuna Dec 11, 2023
03bd11e
Merge pull request #224 from FraxFinance/travis
FortisFortuna Dec 11, 2023
8193f08
routine update
FortisFortuna Jan 12, 2024
4cff110
Merge pull request #226 from FraxFinance/travis
FortisFortuna Jan 12, 2024
294e38d
periodic update
FortisFortuna Mar 2, 2024
b799d54
periodic update
FortisFortuna Mar 2, 2024
85039d4
Merge pull request #227 from FraxFinance/travis
FortisFortuna Mar 2, 2024
c146dbd
periodic update
FortisFortuna May 6, 2024
ff7d3fd
Merge pull request #229 from FraxFinance/travis
FortisFortuna May 6, 2024
6d7ad10
sync
FortisFortuna Jun 18, 2024
1bb585a
remove unnecessary code
FortisFortuna Jun 18, 2024
be073d2
Merge pull request #230 from FraxFinance/travis
FortisFortuna Jun 18, 2024
341b6cf
Create npm-publish.yml
Hawthorne001 Aug 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@ src/hardhat/artifacts/*
src/hardhat/artifacts/*/*
src/hardhat/artifacts/*/*/*
src/hardhat/artifacts/*/*/*/*
src/hardhat/artifacts-zk/*
src/hardhat/artifacts-zk/*/*
src/hardhat/artifacts-zk/*/*/*
src/hardhat/artifacts-zk/*/*/*/*
src/hardhat/cache/*
src/hardhat/cache/*/*
src/hardhat/cache/*/*/*
src/hardhat/cache/*/*/*/*
src/hardhat/cache-zk/*
src/hardhat/cache-zk/*/*
src/hardhat/cache-zk/*/*/*
src/hardhat/cache-zk/*/*/*/*
src/hardhat/___For_Etherscan/*

# Bin
bin

# Lib
lib
lib/*

# Forge
broadcast
forge-cache
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forge-std/=lib/forge-std/src/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@mocks/=src/hardhat/contracts/mocks/",
"@staking/=src/hardhat/contracts/Staking/"
"@staking/=src/hardhat/contracts/Staking/",
"@openzeppelin/=node_modules/@openzeppelin/"
]
}
439 changes: 439 additions & 0 deletions README_DEPLOYS.md

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions README_TESTS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# PREP
1) Using SAMPLE.env and SAMPLE.env.forge, make local versions of .env and .env.forge
2) npm install
3) tsc
4) forge b

## FORGE
**------Testing------**
Do first
Expand All @@ -19,19 +13,23 @@ If you need to fork mainnet
```source .env.forge && forge test --fork-url $MAINNET_RPC_URL -vv```

If you need to fork mainnet, single test contract
```source .env.forge && forge test --fork-url $MAINNET_RPC_URL -vv --match-path ./src/foundry/test/veFPISProxy.t.sol```
```source .env.forge && forge test --fork-url $MAINNET_RPC_URL -vv --match-path ./src/foundry/test/FXS/FXSDisableVoteTracking.t.sol```

Verbosely test a single contract while forking mainnet
or ```source .env.forge && forge test --fork-url $MAINNET_RPC_URL -m veFPISProxy.t.sol -vvvvv``` for single test verbosity level 5
or ```source .env && forge test --fork-url $MAINNET_RPC_URL -vvvvv --match-path ./src/foundry/test/XYZ/XYZ.t.sol``` for single test verbosity level 5

## Hardhat
**------Testing------**
tsc
cd ./src/hardhat
npx hardhat compile

ARBITRUM
npx hardhat test ./test/__ARBITRUM/ComboOracle_KyberSwapElastic-Tests_ARBI.js --vv
npx hardhat test ./test/__ARBITRUM/CrossChainBridgeBacker_ARBI_AnySwap-Tests.js
npx hardhat test ./test/__ARBITRUM/FraxCrossChainFarmV2-Tests.js
npx hardhat test ./test/__ARBITRUM/FraxCrossChainFarmV3_ERC20-Tests.js
npx hardhat test ./test/__ARBITRUM/FraxCrossChainFarmV4_ERC20-Tests.js --no-compile --full-trace-error
npx hardhat test ./test/__ARBITRUM/CurveAMO-ARBI-Tests.js

AURORA
Expand All @@ -48,6 +46,7 @@ Todo
ETHEREUM
npx hardhat test ./test/TWAMM_AMO-Tests.js
npx hardhat test --no-compile ./test/AaveAMO-Tests.js
npx hardhat test ./test/BAMM/BAMM.js
npx hardhat test ./test/CPITrackerOracle-Tests.js
npx hardhat test ./test/ComboOracle_SLP_UniV2_UniV3-Tests.js
npx hardhat test ./test/CommunalFarm-Tests.js
Expand All @@ -61,7 +60,9 @@ npx hardhat test ./test/FXS1559AMO-Tests.js
npx hardhat test ./test/FraxCrossChainLiquidityTracker-Tests.js
npx hardhat test ./test/FraxFarmBSC_Dual_V5.js
npx hardhat test ./test/FraxFarmRageQuitter-Tests.js
npx hardhat test ./test/Fraxbonds/SlippageAuction.js
npx hardhat test ./test/Fraxferry/Fraxferry-test.js
npx hardhat test ./test/FraxferryV2/FerryV2-test.js
npx hardhat test ./test/FraxGaugeController-Tests.js
npx hardhat test ./test/FraxLendingAMO.js
npx hardhat test ./test/FraxLiquidityBridger-Tests.js
Expand All @@ -75,6 +76,7 @@ npx hardhat test ./test/FraxUnifiedFarm_PosRebase-Tests.js
npx hardhat test ./test/FraxUnifiedFarm_UniV3-Tests.js
npx hardhat test ./test/Fraxswap/fraxswap-twamm-test.js
npx hardhat test ./test/Fraxswap/fraxswap-uniV2-test.js
npx hardhat test ./test/FrxETH/FrxETHMiniRouter-Tests.js
npx hardhat test ./test/Governance_Slap_2.js
npx hardhat test ./test/IFraxGaugeFXSRewardsDistributor-Tests.js
npx hardhat test ./test/InvestorAMO_V3-Tests.js
Expand All @@ -91,6 +93,7 @@ npx hardhat test ./test/UniV3LiquidityAMO_V2-Tests.js
npx hardhat test ./test/UniV3TWAPOracle-Tests.js
npx hardhat test ./test/openzeppelin/ERC20.test.js
npx hardhat test ./test/veFPIS-Tests.js
npx hardhat test ./test/veFPISYieldDistributorV5-Tests.js
npx hardhat test ./test/veFXSYieldDistributorV4-Tests.js

FANTOM
Expand All @@ -115,4 +118,3 @@ npx hardhat test ./test/__OPTIMISM/CrossChainBridgeBacker_OPTI_Celer-Tests.js
POLYGON
npx hardhat test ./test/__POLYGON/CrossChainBridgeBacker_POLY_MaticBridge-Tests.js
npx hardhat test ./test/__POLYGON/SushiSwapLiquidityAMO_POLY-Tests.js

29 changes: 28 additions & 1 deletion SAMPLE.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#==========================
MAINTENANCE_ADDRESS='0xBB437059584e30598b3AF0154472E47E6e2a45B9'
MAINTENANCE_PRIVATE_KEY=''
MAINTENANCE_CURRENT_FORK='london'
MAINTENANCE_CURRENT_FORK='paris'

# Hardhat
#===========================
Expand Down Expand Up @@ -64,6 +64,7 @@ BSCSCAN_API_KEY=''
COINGECKO_API_KEY=''
ETHERSCAN_API_KEY=''
EVMOS_API_KEY=''
FRAXTAL_API_KEY=''
FTMSCAN_API_KEY=''
HARMONY_API_KEY=''
MOONBEAM_API_KEY=''
Expand Down Expand Up @@ -105,6 +106,9 @@ EVMOS_MNEMONIC_PHRASE='future ahead slight riot brand perfect paddle hammer circ
# Fantom
FANTOM_MNEMONIC_PHRASE='future ahead slight riot brand perfect paddle hammer circle return review behave nasty fiction balcony'

# Fraxtal
FRAXTAL_MNEMONIC_PHRASE='future ahead slight riot brand perfect paddle hammer circle return review behave nasty fiction balcony'

# Harmony
HARMONY_MNEMONIC_PHRASE='future ahead slight riot brand perfect paddle hammer circle return review behave nasty fiction balcony'

Expand All @@ -120,6 +124,13 @@ OPTIMISM_MNEMONIC_PHRASE='future ahead slight riot brand perfect paddle hammer c
# Polygon
POLYGON_MNEMONIC_PHRASE='future ahead slight riot brand perfect paddle hammer circle return review behave nasty fiction balcony'

# Polygon
POLYGON_ZKEVM_MNEMONIC_PHRASE='future ahead slight riot brand perfect paddle hammer circle return review behave nasty fiction balcony'

# zkSync
ZKSYNC_MNEMONIC_PHRASE='future ahead slight riot brand perfect paddle hammer circle return review behave nasty fiction balcony'
ZKSYNC_PKEY=''

#INFURA
#==========================
INFURA_PROJECT_ID=''
Expand Down Expand Up @@ -203,6 +214,14 @@ FANTOM_NETWORK_ENDPOINT_WSS='wss://apis.ankr.com/wss/<ANKR PATH FANTOM>/fantom/f
#FANTOM_NETWORK_ENDPOINT='https://lingering-old-bird.fantom.quiknode.pro/<QUICKNODE ID>/'
#FANTOM_NETWORK_ENDPOINT_WSS='wss://lingering-old-bird.fantom.quiknode.pro/<QUICKNODE ID>/'

# FRAXCHAIN DEVNET
#========================
FRAXCHAIN_DEVNET_L1_NETWORK_ENDPOINT=''
FRAXCHAIN_DEVNET_L2_NETWORK_ENDPOINT=''
FRAXCHAIN_DEVNET_COOKIE=''
FRAXCHAIN_DEVNET_ADMIN_ADDRESS=''
FRAXCHAIN_DEVNET_ADMIN_PKEY=''

# HARMONY
#========================
# NOTE 0x vs dec format https://docs.harmony.one/home/developers/api
Expand Down Expand Up @@ -232,3 +251,11 @@ OPTIMISM_NETWORK_ENDPOINT_WSS=''
# POLYGON
#========================
POLYGON_NETWORK_ENDPOINT='https://polygon-mainnet.infura.io/v3/<INFURA POLYGON ID>'

# POLYGON ZKEVM
#========================
POLYGON_ZKEVM_NETWORK_ENDPOINT='https://zkevm-rpc.com'

# ZKSYNC
#========================
ZKSYNC_NETWORK_ENDPOINT='https://mainnet.era.zksync.io'
2 changes: 1 addition & 1 deletion SAMPLE.env.forge
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Common
# =================================
MAINNET_RPC_URL="https://mainnet.infura.io/v3/<KEY HERE>"
MAINNET_RPC_URL="https://mainnet.infura.io/v3/<KEY HERE>"
11 changes: 11 additions & 0 deletions binance-fxs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## BSC FXS tokens
Many users have asked how they can withdraw $FXS from Binance to BSC and get natively issued (canonical/official) FXS onchain. If you withdraw FXS from Binance directly to BSC, you can use this handy swap UI to get the native $FXS token on BSC!
Link: https://app.frax.finance/bridge?chain=bsc&from=0xDE2F075f6F14EB9D96755b24E416A53E736Ca363&to=0xe48A3d7d0Bc88d552f730B62c006bC925eadB9eE
<br />
**Swap Ratio:** 1 to 1
<br />
**Binance FXS on BSC:** 0xDE2F075f6F14EB9D96755b24E416A53E736Ca363
<br />
**Canonical (official) FXS on BSC:** 0xe48A3d7d0Bc88d552f730B62c006bC925eadB9eE
<br />
**Rationale**: Fraxferry is now the official bridging solution for moving Frax-related tokens across chains. There are still a number of old bridge tokens that have not been converted to their official / canonical equivalents. The Binance FXS token (0xDE2...363) is one of them. We are working with Binance to gradually retire these to reduce confusion about users sending unsupported tokens to Binance Exchange and having them stranded.
4 changes: 2 additions & 2 deletions compiler_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"settings": {
"optimizer": {
"enabled": true,
"runs": 200000,
"runs": 100000,
"details": {
"orderLiterals": true,
"deduplicate": true,
Expand All @@ -22,6 +22,6 @@
"*": ["abi", "metadata", "devdoc", "userdoc", "storageLayout", "evm.legacyAssembly", "evm.bytecode", "evm.deployedBytecode", "evm.methodIdentifiers", "evm.gasEstimates", "evm.assembly"]
}
},
"evmVersion": "byzantium"
"evmVersion": "london"
}
}
41 changes: 40 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,45 @@
[profile.default]
src = 'src/hardhat/contracts'
src = 'src/hardhat/contracts/BAMM'
out = 'out'
libs = ['node_modules', 'lib']
test = 'src/foundry/test/'
cache_path = 'forge-cache'
remappings = [
'@fraxmocks/=lib/frax-solidity/src/hardhat/contracts/mocks/',
'@staking/=/src/hardhat/contracts/Staking/',
'@openzeppelin-contracts/=lib/openzeppelin-contracts/',
'openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/',
'@openzeppelin/=lib/openzeppelin-contracts/',
]

# See more config options https://github.com/foundry-rs/foundry/tree/master/config

solc_version = "0.8.19"
gas_reports = ["*"]

# settings for coverage reports
via_ir = true
optimizer = true #testing this out - was false
optimizer_runs = 100_000


[profile.default.optimizer_details]
jumpdestRemover = true
orderLiterals = true
deduplicate = true

yul = true
constantOptimizer = true
stackAllocation = true

# Have `cse = true` commented out for faster testing compilation,
### but UNCOMMENT it for DEPLOYMENT! ###
cse = true


[profile.default.optimizer_details.yulDetails]
stackAllocation = true

# Have `optimizerSteps = ""` uncommented for faster testing compilation,
### but COMMENT IT out for DEPLOYMENT!###
# optimizerSteps = ""
92 changes: 0 additions & 92 deletions lib/forge-std/.github/workflows/ci.yml

This file was deleted.

4 changes: 0 additions & 4 deletions lib/forge-std/.gitignore

This file was deleted.

Loading