-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from axieinfinity/release/v0.1.0
feat: release v0.1.0
- Loading branch information
Showing
23 changed files
with
658 additions
and
41 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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Create PR Deploy to Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- deploy/* | ||
pull_request: | ||
branches: | ||
- deploy/* | ||
|
||
env: | ||
HEAD_BRANCH: ${{ github.head_ref || github.ref_name }} | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set Env | ||
run: | | ||
echo "PR_BRANCH=merge/${HEAD_BRANCH}" >> $GITHUB_ENV | ||
echo "VERSION=$(echo -n ${{ env.HEAD_BRANCH }} | sed 's/.*deploy\///' | cut -d'-' -f1)" >> $GITHUB_ENV | ||
echo "NETWORK=$(echo -n ${{ env.HEAD_BRANCH }} | sed 's/.*deploy\/v[0-9\.]*-\(.*\)/\1/')" >> $GITHUB_ENV | ||
- name: Checkout code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
ref: 'release/${{ env.VERSION }}' | ||
fetch-depth: 0 | ||
fetch-tags: 'true' | ||
|
||
- name: Get Testnet Latest Tag | ||
if: ${{ env.NETWORK == 'testnet' }} | ||
run: | | ||
echo "LATESTTAG=$(git describe --tags --match "*testnet*" --abbrev=0)" >> $GITHUB_ENV | ||
- name: Get Mainnet Latest Tag | ||
if: ${{ env.NETWORK == 'mainnet' }} | ||
run: | | ||
echo "LATESTTAG=$(git describe --tags --match "*mainnet*" --abbrev=0)" >> $GITHUB_ENV | ||
- name: Reset promotion branch | ||
run: | | ||
git fetch origin ${HEAD_BRANCH}:${HEAD_BRANCH} | ||
git reset --hard ${HEAD_BRANCH} | ||
- name: Generate Release note | ||
id: template | ||
run: | | ||
echo "VERSION=${{ env.VERSION }} - SHA: ${{ github.sha }}" > CHANGELOG.md | ||
- name: Create Pull Request | ||
id: cpr | ||
uses: peter-evans/[email protected] | ||
with: | ||
labels: automated PR | ||
delete-branch: true | ||
title: 'chore(`release/${{ env.VERSION }}`): merge from `${{ env.HEAD_BRANCH}}`' | ||
body: ${{ steps.template.outputs.result }} | ||
branch: ${{ env.PR_BRANCH }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Create PR from release to network | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- release/* | ||
types: | ||
- closed | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
env: | ||
HEAD_BRANCH: ${{ github.head_ref || github.ref_name }} | ||
RELEASE_BRANCH: ${{ github.event.pull_request.base.ref}} | ||
|
||
jobs: | ||
merge-release-to-network: | ||
runs-on: ubuntu-latest | ||
if: ${{ (github.event.pull_request.merged == true) && (contains(github.head_ref, 'deploy') || contains(github.ref_name, 'deploy')) }} | ||
steps: | ||
- name: Set Env | ||
run: | | ||
echo "PR_BRANCH=merge/${HEAD_BRANCH}" >> $GITHUB_ENV | ||
echo "VERSION=$(echo -n ${{ env.HEAD_BRANCH }} | sed 's/.*deploy\///' | cut -d'-' -f1)" >> $GITHUB_ENV | ||
echo "NETWORK=$(echo -n ${{ env.HEAD_BRANCH }} | sed 's/.*deploy\/v[0-9\.]*-\(.*\)/\1/')" >> $GITHUB_ENV | ||
- name: Checkout code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
ref: ${{ env.NETWORK }} | ||
|
||
- name: Reset promotion branch | ||
run: | | ||
git fetch origin ${RELEASE_BRANCH}:${RELEASE_BRANCH} | ||
git reset --hard ${RELEASE_BRANCH} | ||
- name: Create Pull Request | ||
id: cpr | ||
uses: peter-evans/[email protected] | ||
with: | ||
labels: automated PR | ||
delete-branch: true | ||
title: 'chore(`${{ env.NETWORK }}`): merge from `${{ env.HEAD_BRANCH}}`' | ||
body: ${{ steps.template.outputs.result }} | ||
branch: ${{env.PR_BRANCH}} |
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,64 @@ | ||
name: Create Release Tag | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- mainnet | ||
- testnet | ||
|
||
env: | ||
HEAD_BRANCH: ${{ github.head_ref || github.ref_name }} | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
create-release-tag: | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged == true | ||
steps: | ||
- name: Set Env | ||
run: | | ||
echo "VERSION=$(echo -n ${{ env.HEAD_BRANCH }} | sed 's/.*deploy\///' | cut -d'-' -f1)" >> $GITHUB_ENV | ||
echo "NETWORK=$(echo -n ${{ env.HEAD_BRANCH }} | sed 's/.*deploy\/v[0-9\.]*-\(.*\)/\1/')" >> $GITHUB_ENV | ||
- name: Checkout code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
ref: ${{ env.NETWORK }} | ||
fetch-depth: 0 | ||
fetch-tags: 'true' | ||
|
||
- name: Set Mainnet Tag | ||
if: ${{ env.NETWORK == 'mainnet' }} | ||
run: | | ||
echo "TAG=${{ env.VERSION }}" >> $GITHUB_ENV | ||
- name: Set Testnet Tag | ||
if: ${{ env.NETWORK == 'testnet' }} | ||
run: | | ||
echo "TAG=${{ env.VERSION }}-testnet" >> $GITHUB_ENV | ||
- name: Get Testnet Latest Tag | ||
if: ${{ env.NETWORK == 'testnet' }} | ||
run: | | ||
echo "LATESTTAG=$(git describe --tags --match "*testnet*" --abbrev=0)" >> $GITHUB_ENV | ||
- name: Get Mainnet Latest Tag | ||
if: ${{ env.NETWORK == 'mainnet' }} | ||
run: | | ||
echo "LATESTTAG=$(git describe --tags --match "*mainnet*" --abbrev=0)" >> $GITHUB_ENV | ||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ env.TAG }} | ||
run: | | ||
gh release create "$tag" \ | ||
--repo "$GITHUB_REPOSITORY" \ | ||
--title "${{ env.NETWORK }} release ${{ env.VERSION }}" \ | ||
--target "${{ env.NETWORK }}" \ | ||
--notes-start-tag "${{ env.LATESTTAG }}" \ | ||
--generate-notes |
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,6 +1,9 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
shallow = true | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts | ||
[submodule "lib/lib/openzeppelin-contracts"] | ||
shallow = true |
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
Submodule forge-std
updated
29 files
+1 −0 | .gitattributes | |
+0 −3 | .gitmodules | |
+1 −1 | README.md | |
+0 −1 | lib/ds-test | |
+1 −1 | package.json | |
+635 −0 | scripts/vm.py | |
+518 −225 | src/StdAssertions.sol | |
+7 −1 | src/StdChains.sol | |
+7 −11 | src/StdJson.sol | |
+201 −106 | src/StdStorage.sol | |
+179 −0 | src/StdToml.sol | |
+2 −5 | src/Test.sol | |
+1,280 −469 | src/Vm.sol | |
+51 −33 | src/mocks/MockERC20.sol | |
+46 −32 | src/mocks/MockERC721.sol | |
+39 −909 | test/StdAssertions.t.sol | |
+27 −22 | test/StdChains.t.sol | |
+18 −10 | test/StdCheats.t.sol | |
+3 −1 | test/StdError.t.sol | |
+49 −0 | test/StdJson.t.sol | |
+8 −8 | test/StdMath.t.sol | |
+159 −11 | test/StdStorage.t.sol | |
+49 −0 | test/StdToml.t.sol | |
+20 −20 | test/StdUtils.t.sol | |
+3 −3 | test/Vm.t.sol | |
+8 −0 | test/fixtures/test.json | |
+6 −0 | test/fixtures/test.toml | |
+1 −1 | test/mocks/MockERC20.t.sol | |
+1 −1 | test/mocks/MockERC721.t.sol |
Submodule openzeppelin-contracts
updated
667 files
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,27 @@ | ||
| Contract | Size (kB) | Margin (kB) | | ||
|---------------------------|-----------|-------------| | ||
| LibErrorHandler | 0.086 | 24.49 | | ||
| LibNativeTransfer | 0.086 | 24.49 | | ||
| LibSafeRange | 0.086 | 24.49 | | ||
| Math | 0.086 | 24.49 | | ||
| MockERC20 | 3.704 | 20.872 | | ||
| MockERC721 | 3.964 | 20.612 | | ||
| Panic | 0.086 | 24.49 | | ||
| RONTransferHelper | 0.086 | 24.49 | | ||
| RONTransferHelperExtended | 0.086 | 24.49 | | ||
| SafeCast | 0.086 | 24.49 | | ||
| SignedMath | 0.086 | 24.49 | | ||
| StdStyle | 0.086 | 24.49 | | ||
| Strings | 0.086 | 24.49 | | ||
| TransferFromHelper | 0.086 | 24.49 | | ||
| TransferHelper | 0.086 | 24.49 | | ||
| console | 0.086 | 24.49 | | ||
| console2 | 0.086 | 24.49 | | ||
| safeconsole | 0.086 | 24.49 | | ||
| stdError | 0.592 | 23.984 | | ||
| stdJson | 0.086 | 24.49 | | ||
| stdMath | 0.086 | 24.49 | | ||
| stdStorage | 0.086 | 24.49 | | ||
| stdStorageSafe | 0.086 | 24.49 | | ||
| stdToml | 0.086 | 24.49 | | ||
|
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 @@ | ||
src/Counter.sol:Counter:number (storage_slot: 0) (offset: 0) (type: uint256) (numberOfBytes: 32) |
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,40 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
library LibErrorHandler { | ||
/// @dev Reserves error definition to upload to signature database. | ||
error ExternalCallFailed(bytes4 msgSig, bytes4 callSig); | ||
|
||
/// @notice handle low level call revert if call failed, | ||
/// If extcall return empty bytes, reverts with custom error. | ||
/// @param status Status of external call | ||
/// @param callSig function signature of the calldata | ||
/// @param returnOrRevertData bytes result from external call | ||
function handleRevert(bool status, bytes4 callSig, bytes memory returnOrRevertData) internal pure { | ||
// Get the function signature of current context | ||
bytes4 msgSig = msg.sig; | ||
assembly ("memory-safe") { | ||
if iszero(status) { | ||
// Load the length of bytes array | ||
let revertLength := mload(returnOrRevertData) | ||
// Check if length != 0 => revert following reason from external call | ||
if iszero(iszero(revertLength)) { | ||
// Start of revert data bytes. The 0x20 offset is always the same. | ||
revert(add(returnOrRevertData, 0x20), revertLength) | ||
} | ||
|
||
// Load free memory pointer | ||
let ptr := mload(0x40) | ||
// Store 4 bytes the function selector of ExternalCallFailed(msg.sig, callSig) | ||
// Equivalent to revert ExternalCallFailed(bytes4,bytes4) | ||
mstore(ptr, 0x49bf4104) | ||
// Store 4 bytes of msgSig parameter in the next slot | ||
mstore(add(ptr, 0x20), msgSig) | ||
// Store 4 bytes of callSig parameter in the next slot | ||
mstore(add(ptr, 0x40), callSig) | ||
// Revert 68 bytes of error starting from 0x1c | ||
revert(add(ptr, 0x1c), 0x44) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.