-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Synapse bridge facet doc (#235) * add interface of SynapseRouter * add SynapseBridge facet contract * add SynpaseBridge configuration * add deployment and update scripts of SynapseBridge facet * add SynpaseBridge foundry test * make synapseRouter variable public * add SynapseBridge facet doc * fix issue with setting receiver address for relayer * run prettier for CeleIMFacet * update comments in CelerIMFacet * update CelerIMFacet foundry test with destination call * add fee check to DeBridgeFacet * add test for invalid fee rate of DeBridgeFacet * add comments to CelerIMFacet * rename the test function * #73 check circle swap result * update _depositAndSwap function to not include nativeReserve in newBalance * update ArbitrumBridge and DeBridge facets with updated _depositAndSwap * update CelerIMFacet to use right _depositAndSwap function * add swap test with destination call to CelerIMFacet test * update minAmount conversion in MakerTeleportFacet with SafeCast * update SquidFacet with source swap flag check * update SquidFacet test * remove feeAmount param from collectNativeInsuranceFees and collectNativeGasFees * update LIFuelFacet with updated ServiceFeeCollector functions * update ServiceFeeCollector test * update refundExcessNative modifier to save gas * remove unused imports from ThorSwapFacet * LF-2637 remove noNativeAsset modifier from startBridgeTokensViaCircleBridge * update ArbitrumBridgeFacet * update facets with validateDestinationCallFlag function * remove unused imports from LIFuelFacet * add WithdrawFailed error to GenericErrors * update RelayerCelerIM with generic error * remove unused reentrancy guard from RelayerCelerIM * add doesNotContainDestinationCalls modifier to LIFuelFacet * update LibAsset and AcrossFacet with isNativeAsset function * remove destination chain id check from CBridgeFacet * LF-2607 LF-2605 #52 #50 remove swap data checks (#276) * remove swapData check from CircleBridgeFacet * add recipient check to transferERC20 * update variable visibilities to private * update maxApproveERC20 of LibAsset * remove LibMappings * use calldata instead of memory to save gas (#268) * remove duplicated validateBridgeData modifier from ArbitrumBridgeFacet * add validation for token symbol (#282) * Check return value (#244) * Restrict approval method to owner (#245) * Add explicit revert (#248) * Only approve once we know we have enough gas (#247) * remove unneeded parameter (#263) * update comment (#264) * remove unneeded modifiers (#265) * remove unneeded events/errors (#266) * check amount != 0 in all cases (#279) * add missing refundExcessNative (#280) * track chain id (#289) * update dstNativeAddr in quoteLayerZeroFee of StargateFacet * update dstNativeAddr in _startBridge of StargateFacet * remove unused imports from CircleBridgeFacet * Use temp variable in _startBridge function of MultichainFacet (#293) * Update cfUSDC check in CelerIMFacet (#254) * update CelerIMFacet with cfUSDC * add cfUSDC to cBridge config * update DeployCelerIMFacet with cfUSDC * update CelerIMFacet test with cfUSDC * LF-2638 83 add cfUSDC check to swapAndStartBridgeTokensViaCelerIM * refactor LibBytes (#267) * Add missing test case (#296) * add missing emit (#281) * check for sufficient expiration time (#278) * check for sufficient expiration time * Update ThorSwapFacet.sol Fix typo * Update ThorSwapFacet.sol Fix typo * fix tests * Make function more readable (#290) * Allow executor to receive ERC1155 tokens (#295) * fix solidity version (#277) * clear out penging owner if any (#250) * feat: Add HopFacetPacked (#283) * feat: Add HopFacetPacked * add gas comparisson with HopFacetOptimized * formatting * add gas test for other polygon * add packed version of cbridge * add testcase to ensure callData extraction works the same when forwarded via another contract * cbridge: order arguments add pure encode functions * hop: order arguments and add pure encode functions * fix test * add optimized functions for hop on L1 as well * update hoppacked documentation * add gas cost comparrison for cbridge optimizations * rename encodeBridge... functions to encoder_startBridge... * replace hardcoded strings with function selectors * replace assembly parsing with solidity * add validation to encoder functions * fix typos and documentation * add validation tests * Remove unusable permit param (#291) * chore: build types for audit branch * chore: build using forge only * chore: update generateDiamond * Test Stargate Pool Validation (#297) * fix: passing pool data as calldata (#237) * test: add stargate poolId validation tests --------- Co-authored-by: Leonardo Cascianelli <[email protected]> Co-authored-by: Ed Zynda <[email protected]> * Auto format code and configure husky to do so on every commit (#298) * chore: autoformat code * chore: update husky * fix compiler warnings * #31 cache gasleft to prevent underflow (#249) * cache gasleft to prevent underflow * add missing cachGasLeft * Fix issue with unused code for setting pool id in StargateFacet (#299) * remove unused code from StargateFacet * update UpdateStargateFacet script * Fix issue of native bridging test with SquidFacet (#303) * Add version numbers (#302) * Add version numbers to facets and periphery contracts * Formatting --------- Co-authored-by: satoshi-lifi <[email protected]> Co-authored-by: Satoshi Naoki <[email protected]> Co-authored-by: Max Klenk <[email protected]> Co-authored-by: Leonardo Cascianelli <[email protected]>
- Loading branch information
1 parent
81c6417
commit 6806e8b
Showing
136 changed files
with
2,299 additions
and
2,674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ coverage/ | |
node_modules/ | ||
package.json | ||
typechain/ | ||
lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Types Bindings | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
- "staging" | ||
- "spearbit-audit-march-2023" | ||
|
||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
|
||
jobs: | ||
generate-tag: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout contracts repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.BRANCH_NAME }} | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install Node deps | ||
run: yarn install | ||
|
||
- name: Generate ABI | ||
run: yarn abi:generate | ||
|
||
- name: Generate types bindings | ||
run: yarn typechain | ||
|
||
- name: Checkout lifi-contract-types repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: lifinance/lifi-contract-types | ||
path: lifi-contract-types | ||
ssh-key: ${{ secrets.SSH_REPO_TOKEN }} | ||
ref: master | ||
|
||
- name: Copy types bindings | ||
run: | | ||
rm -r lifi-contract-types/src/ | ||
mv typechain lifi-contract-types/src | ||
cp diamondABI/diamond.json lifi-contract-types/dist/ | ||
- name: Build contract types | ||
run: cd lifi-contract-types && yarn install && yarn build | ||
|
||
- name: Retrieve latest Tag | ||
id: latest_release | ||
run: | | ||
# fetch tag releases | ||
release_json=$(curl https://api.github.com/repos/lifinance/lifi-contract-types/tags) | ||
# get the latest tag | ||
LATEST_TAG=$(echo "$release_json" | jq -r '.[0].name') | ||
# we need to make sure that on staging we're going to update a -beta version, if any | ||
if [[ "$BRANCH_NAME" != "master" ]]; then | ||
# if it has already "-beta", no other action is required, since it means | ||
# that we're already going to update the latest staging release | ||
if [[ "$LATEST_TAG" != *"beta"* ]]; then | ||
# otherwise, start looping through the tags and search for the latest -beta tag | ||
while read item; do | ||
tag_name=$(jq -r '.name' <<< "$item") | ||
# check if there's already a latest tag beta release | ||
# and, if present, use it instead of the main one | ||
# if we end up without any latest beta tag, we will create a beta release from the latest tag | ||
if [[ "$tag_name" == "$LATEST_TAG-$beta"* ]]; then | ||
LATEST_TAG=$tag_name | ||
break | ||
fi | ||
done <<<$(echo "$release_json" | jq -c -r '.[]') | ||
fi | ||
fi | ||
echo "latest tag: $LATEST_TAG" | ||
echo "LATEST_TAG=${LATEST_TAG}" >> $GITHUB_ENV | ||
- name: Update version | ||
id: bump_version | ||
uses: christian-draeger/[email protected] | ||
with: | ||
current-version: "${{ env.LATEST_TAG }}" | ||
version-fragment: "${{ env.BRANCH_NAME == 'master' && (contains(github.event.head_commit.message, 'major') && 'major' || contains(github.event.head_commit.message, 'feat') && 'feature' || 'bug') || 'beta' }}" | ||
|
||
- name: Push tag | ||
if: steps.bump_version.outputs.next-version | ||
run: | | ||
cd lifi-contract-types | ||
tmp=$(mktemp) | ||
jq '.version="${{ steps.bump_version.outputs.next-version }}"' package.json > "$tmp" && mv "$tmp" package.json | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
echo "Updating version from ${{ env.LATEST_TAG }} to ${{ steps.bump_version.outputs.next-version }}" | ||
git add src/* | ||
git add dist/* | ||
git add package.json | ||
git commit -m "actions: new contracts version ${{ steps.bump_version.outputs.next-version }}" | ||
git tag -a v${{ steps.bump_version.outputs.next-version }} -m "${{ github.event.head_commit.message }}" | ||
git push origin tag v${{ steps.bump_version.outputs.next-version }} | ||
if [[ "$BRANCH_NAME" == "master" ]]; then | ||
git push -u origin $BRANCH_NAME | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn lint:fix | ||
yarn format:fix && yarn lint:fix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ module.exports = { | |
printWidth: 79, | ||
tabWidth: 4, | ||
singleQuote: false, | ||
explicitTypes: 'always', | ||
}, | ||
}, | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ cache/ | |
coverage/ | ||
node_modules/ | ||
typechain/ | ||
lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.