-
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 #51 from axieinfinity/release/v0.1.2
chore: merge all features from 'release/v0.1.2'
- Loading branch information
Showing
20 changed files
with
548 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,16 @@ | ||
| Contract | Size (B) | Margin (B) | | ||
|---------------------------|----------|------------| | ||
| LibErrorHandler | 86 | 24,490 | | ||
| LibEventRange | 86 | 24,490 | | ||
| LibNativeTransfer | 86 | 24,490 | | ||
| LibSafeRange | 86 | 24,490 | | ||
| Math | 86 | 24,490 | | ||
| Panic | 86 | 24,490 | | ||
| RONTransferHelper | 86 | 24,490 | | ||
| RONTransferHelperExtended | 86 | 24,490 | | ||
| SafeCast | 86 | 24,490 | | ||
| SignedMath | 86 | 24,490 | | ||
| Strings | 86 | 24,490 | | ||
| TransferFromHelper | 86 | 24,490 | | ||
| TransferHelper | 86 | 24,490 | | ||
|
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,42 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
struct EventRange { | ||
// uint40 is enough to represent the timestamp until year 36812 | ||
uint40 startedAt; | ||
uint40 endedAt; | ||
/// @dev Reserved space for future upgrades | ||
uint176 __reserved; | ||
} | ||
|
||
using LibEventRange for EventRange global; | ||
|
||
library LibEventRange { | ||
/** | ||
* @dev Checks whether the event range is valid. | ||
*/ | ||
function valid(EventRange memory range) internal pure returns (bool) { | ||
return range.startedAt <= range.endedAt; | ||
} | ||
|
||
/** | ||
* @dev Returns whether the current range is not yet started. | ||
*/ | ||
function isNotYetStarted(EventRange memory range) internal view returns (bool) { | ||
return block.timestamp < range.startedAt; | ||
} | ||
|
||
/** | ||
* @dev Returns whether the current range is ended or not. | ||
*/ | ||
function isEnded(EventRange memory range) internal view returns (bool) { | ||
return range.endedAt <= block.timestamp; | ||
} | ||
|
||
/** | ||
* @dev Returns whether the current block is in period. | ||
*/ | ||
function isInPeriod(EventRange memory range) internal view returns (bool) { | ||
return range.startedAt <= block.timestamp && block.timestamp < range.endedAt; | ||
} | ||
} |
Oops, something went wrong.