Skip to content

Commit

Permalink
Merge pull request #137 from axieinfinity/implement-feature/rework/bu…
Browse files Browse the repository at this point in the history
…mp-package

feat(rework): implement `bump-package`
  • Loading branch information
TuDo1403 authored May 16, 2024
2 parents 2f48f7d + 922f64f commit c243492
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
shallow = true
branch = v1.8.2
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
Expand Down
2 changes: 1 addition & 1 deletion lib/solady
Submodule solady updated 93 files
+1,073 −945 .gas-snapshot
+4 −2 .github/workflows/ci-all-via-ir.yml
+1 −1 .github/workflows/ci-wake.yml
+17 −10 .github/workflows/ci.yml
+3 −0 .gitignore
+0 −4 .gitmodules
+10 −3 README.md
+2 −2 foundry.toml
+0 −1 lib/ds-test
+1 −1 package.json
+13 −6 src/Milady.sol
+225 −44 src/accounts/ERC1271.sol
+33 −15 src/accounts/ERC4337.sol
+106 −31 src/accounts/ERC6551.sol
+13 −10 src/accounts/ERC6551Proxy.sol
+232 −0 src/accounts/LibERC6551.sol
+4 −4 src/tokens/ERC1155.sol
+4 −1 src/tokens/ERC4626.sol
+4 −4 src/tokens/ERC6909.sol
+56 −34 src/tokens/ERC721.sol
+5 −0 src/utils/Base64.sol
+1 −1 src/utils/CREATE3.sol
+7 −11 src/utils/DateTimeLib.sol
+91 −0 src/utils/DeploylessPredeployQueryer.sol
+754 −3 src/utils/DynamicBufferLib.sol
+1 −1 src/utils/ERC1967Factory.sol
+630 −0 src/utils/EnumerableSetLib.sol
+7 −7 src/utils/FixedPointMathLib.sol
+185 −0 src/utils/Initializable.sol
+3 −3 src/utils/JSONParserLib.sol
+9 −8 src/utils/LibBit.sol
+5 −5 src/utils/LibBitmap.sol
+687 −5 src/utils/LibClone.sol
+235 −7 src/utils/LibPRNG.sol
+27 −1 src/utils/LibSort.sol
+5 −5 src/utils/LibString.sol
+21 −22 src/utils/LibZip.sol
+82 −9 src/utils/MetadataReaderLib.sol
+400 −56 src/utils/MinHeapLib.sol
+97 −0 src/utils/P256.sol
+194 −206 src/utils/RedBlackTreeLib.sol
+55 −0 src/utils/ReentrancyGuard.sol
+1 −1 src/utils/SSTORE2.sol
+284 −97 src/utils/SafeCastLib.sol
+188 −3 src/utils/SafeTransferLib.sol
+1 −1 src/utils/UUPSUpgradeable.sol
+190 −0 src/utils/UpgradeableBeacon.sol
+21 −1 test/Base64.t.sol
+157 −0 test/DeploylessPredeployQueryer.t.sol
+136 −0 test/DynamicBufferLib.t.sol
+315 −0 test/ERC1271.t.sol
+5 −1 test/ERC20.t.sol
+124 −63 test/ERC4337.t.sol
+1 −1 test/ERC4337Factory.t.sol
+177 −124 test/ERC4626.t.sol
+85 −51 test/ERC6551.t.sol
+3 −3 test/ERC6909.t.sol
+29 −0 test/ERC721.t.sol
+647 −0 test/EnumerableSetLib.t.sol
+159 −0 test/Initializable.t.sol
+29 −1 test/JSONParserLib.t.sol
+19 −10 test/LibBitmap.t.sol
+337 −9 test/LibClone.t.sol
+183 −0 test/LibERC6551.t.sol
+277 −0 test/LibPRNG.t.sol
+17 −0 test/LibSort.t.sol
+20 −25 test/LibString.t.sol
+61 −28 test/MetadataReaderLib.t.sol
+501 −10 test/MinHeapLib.t.sol
+25 −14 test/OwnableRoles.t.sol
+95 −0 test/P256.t.sol
+88 −32 test/RedBlackTree.t.sol
+86 −0 test/ReentrancyGuard.t.sol
+919 −199 test/SafeCastLib.t.sol
+357 −60 test/SafeTransferLib.t.sol
+197 −0 test/UpgradeableBeacon.t.sol
+184 −0 test/utils/Brutalizer.sol
+13 −132 test/utils/TestPlus.sol
+720 −93 test/utils/forge-std/Test.sol
+1,826 −366 test/utils/forge-std/Vm.sol
+2 −8 test/utils/mocks/MockERC1155.sol
+2 −8 test/utils/mocks/MockERC20.sol
+2 −15 test/utils/mocks/MockERC2981.sol
+2 −8 test/utils/mocks/MockERC4337.sol
+21 −8 test/utils/mocks/MockERC6551.sol
+4 −10 test/utils/mocks/MockERC6909.sol
+6 −8 test/utils/mocks/MockERC721.sol
+1 −1 test/utils/mocks/MockEntryPoint.sol
+80 −0 test/utils/mocks/MockInitializable.sol
+8 −20 test/utils/mocks/MockOwnable.sol
+14 −26 test/utils/mocks/MockOwnableRoles.sol
+136 −0 test/utils/mocks/MockReentrancyGuard.sol
+2 −8 test/utils/mocks/MockUUPSImplementation.sol
2 changes: 1 addition & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
foundry-deployment-kit/=script/
@fdk/=script/
2 changes: 1 addition & 1 deletion script/ArtifactFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.19;
import { Vm } from "../lib/forge-std/src/Vm.sol";
import { stdJson } from "../lib/forge-std/src/StdJson.sol";
import { StdStyle } from "../lib/forge-std/src/StdStyle.sol";
import { console2 as console } from "../lib/forge-std/src/console2.sol";
import { console } from "../lib/forge-std/src/console.sol";
import { LibString } from "../lib/solady/src/utils/LibString.sol";
import { JSONParserLib } from "../lib/solady/src/utils/JSONParserLib.sol";
import { IArtifactFactory } from "./interfaces/IArtifactFactory.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/BaseGeneralConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.19;

import { Vm, VmSafe } from "../lib/forge-std/src/Vm.sol";
import { StdStyle } from "../lib/forge-std/src/StdStyle.sol";
import { console2 as console } from "../lib/forge-std/src/console2.sol";
import { console } from "../lib/forge-std/src/console.sol";
import { WalletConfig } from "./configs/WalletConfig.sol";
import { RuntimeConfig } from "./configs/RuntimeConfig.sol";
import { MigrationConfig } from "./configs/MigrationConfig.sol";
Expand Down
4 changes: 2 additions & 2 deletions script/BaseMigration.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ abstract contract BaseMigration is ScriptExtended {
} else {
console.log(
StdStyle.yellow(
"`ProxyAdmin:upgrade` failed!. Retrying with `ProxyAdmin:upgradeAndCall` with emty args..."
"`ProxyAdmin:upgrade` failed!. Retrying with `ProxyAdmin:upgradeAndCall` with empty args..."
)
);
vm.prank(owner);
Expand Down Expand Up @@ -283,7 +283,7 @@ abstract contract BaseMigration is ScriptExtended {
}
} else {
console.log(
"`ProxyAdmin:upgrade` failed!. Retrying with `ProxyAdmin:upgradeAndCall` with emty args...".yellow()
"`ProxyAdmin:upgrade` failed!. Retrying with `ProxyAdmin:upgradeAndCall` with empty args...".yellow()
);
if (owner.code.length != 0) {
_cheatUpgradeAndCall(owner, wProxyAdmin, iProxy, logic, args);
Expand Down
2 changes: 1 addition & 1 deletion script/OnchainExecutor.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.19;

import { StdStyle } from "../lib/forge-std/src/StdStyle.sol";
import { console2 as console } from "../lib/forge-std/src/console2.sol";
import { console } from "../lib/forge-std/src/console.sol";
import { ScriptExtended } from "./extensions/ScriptExtended.s.sol";
import { BaseGeneralConfig } from "./BaseGeneralConfig.sol";
import { LibErrorHandler } from "../lib/contract-libs/src/LibErrorHandler.sol";
Expand Down
4 changes: 2 additions & 2 deletions script/configs/ContractConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.19;

import { EnumerableSet } from "../../lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol";
import { Vm, VmSafe } from "../../lib/forge-std/src/Vm.sol";
import { console2 as console } from "../../lib/forge-std/src/console2.sol";
import { console } from "../../lib/forge-std/src/console.sol";
import { StdStyle } from "../../lib/forge-std/src/StdStyle.sol";
import { LibString } from "../../lib/solady/src/utils/LibString.sol";
import { IContractConfig } from "../interfaces/configs/IContractConfig.sol";
Expand Down Expand Up @@ -47,7 +47,7 @@ abstract contract ContractConfig is IContractConfig {
);
}

function getContractTypeFromCurrentNetwok(address contractAddr) public view virtual returns (TContract contractType) {
function getContractTypeFromCurrentNetwork(address contractAddr) public view virtual returns (TContract contractType) {
return getContractTypeByRawData(block.chainid, contractAddr);
}

Expand Down
2 changes: 1 addition & 1 deletion script/configs/NetworkConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.19;

import { Vm } from "../../lib/forge-std/src/Vm.sol";
import { StdStyle } from "../../lib/forge-std/src/StdStyle.sol";
import { console2 as console } from "../../lib/forge-std/src/console2.sol";
import { console } from "../../lib/forge-std/src/console.sol";
import { INetworkConfig } from "../interfaces/configs/INetworkConfig.sol";
import { LibSharedAddress } from "../libraries/LibSharedAddress.sol";
import { TNetwork } from "../types/Types.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/configs/RuntimeConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.19;

import { StdStyle } from "../../lib/forge-std/src/StdStyle.sol";
import { console2 as console } from "../../lib/forge-std/src/console2.sol";
import { console } from "../../lib/forge-std/src/console.sol";
import { LibString } from "../../lib/solady/src/utils/LibString.sol";
import { IRuntimeConfig } from "../interfaces/configs/IRuntimeConfig.sol";

Expand Down
2 changes: 1 addition & 1 deletion script/interfaces/configs/IContractConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IContractConfig {

function label(uint256 chainId, address contractAddr, string memory contractName) external;

function getContractTypeFromCurrentNetwok(address contractAddr) external view returns (TContract contractType);
function getContractTypeFromCurrentNetwork(address contractAddr) external view returns (TContract contractType);

function getContractName(TContract contractType) external view returns (string memory name);

Expand Down
6 changes: 3 additions & 3 deletions script/sample/SampleGeneralConfig.sol
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { BaseGeneralConfig } from "foundry-deployment-kit/BaseGeneralConfig.sol";
import { BaseGeneralConfig } from "@fdk/BaseGeneralConfig.sol";
import { Contract } from "./utils/Contract.sol";

contract SampleGeneralConfig is BaseGeneralConfig {
constructor() BaseGeneralConfig("", "deployments/") { }

function _setUpContracts() internal virtual override {
_contractNameMap[Contract.Sample.key()] = Contract.Sample.name();
// {SamepleClone} share same logic as {Sample}
// {SampleClone} share same logic as {Sample}
_contractNameMap[Contract.SampleClone.key()] = Contract.Sample.name();
_contractNameMap[Contract.SampleProxy.key()] = Contract.SampleProxy.name();

// allow diffrent contracts to share same logic
// allow different contracts to share same logic
_contractNameMap[Contract.tSLP.key()] = "Token";
_contractNameMap[Contract.tAXS.key()] = "Token";
_contractNameMap[Contract.tWETH.key()] = "Token";
Expand Down
4 changes: 2 additions & 2 deletions script/sample/SampleMigration.s.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { BaseMigration } from "foundry-deployment-kit/BaseMigration.s.sol";
import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol";
import { BaseMigration } from "@fdk/BaseMigration.s.sol";
import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol";
import { SampleGeneralConfig } from "./SampleGeneralConfig.sol";
import { ISharedArgument } from "./interfaces/ISharedArgument.sol";

Expand Down
4 changes: 2 additions & 2 deletions script/sample/interfaces/ISharedArgument.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { IGeneralConfig } from "foundry-deployment-kit/interfaces/IGeneralConfig.sol";
import { IGeneralConfig } from "@fdk/interfaces/IGeneralConfig.sol";

interface ISharedArgument is IGeneralConfig {
struct SharedParameter {
Expand All @@ -10,7 +10,7 @@ interface ISharedArgument is IGeneralConfig {
address mFactory;
address testnetFactory;
bytes32 mPairCodeHash;
bytes32 testnetpairCodeHash;
bytes32 testnetPairCodeHash;
address mWRON;
address mSLP;
address mAXS;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol";
import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol";
import { ISharedArgument, SampleMigration } from "../../SampleMigration.s.sol";
import { Sample, SampleDeploy } from "../../contracts/SampleDeploy.s.sol";
import { SampleProxy, SampleProxyDeploy } from "../../contracts/SampleProxyDeploy.s.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { console2 as console } from "forge-std/console2.sol";
import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol";
import { console } from "forge-std/console.sol";
import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol";
import { Contract } from "../../utils/Contract.sol";
import { ISharedArgument, SampleMigration } from "../../SampleMigration.s.sol";
import { Token } from "../../../../src/Token.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol";
import { DefaultNetwork } from "@fdk/utils/DefaultNetwork.sol";
import { ISharedArgument, SampleMigration } from "../../SampleMigration.s.sol";
import { Sample, SampleDeploy } from "../../contracts/SampleDeploy.s.sol";
import { SampleProxy, SampleProxyDeploy } from "../../contracts/SampleProxyDeploy.s.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/sample/utils/Contract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.19;

import { LibString } from "lib/solady/src/utils/LibString.sol";
import { TContract } from "foundry-deployment-kit/types/Types.sol";
import { TContract } from "@fdk/types/Types.sol";

enum Contract {
tSLP,
Expand Down

0 comments on commit c243492

Please sign in to comment.