Skip to content

Commit

Permalink
Merge pull request #10 from Axis-Fi/audit-updates
Browse files Browse the repository at this point in the history
axis-periphery audit updates
  • Loading branch information
0xJem authored Aug 23, 2024
2 parents fce88f3 + cc916a4 commit d4122f4
Show file tree
Hide file tree
Showing 34 changed files with 313 additions and 205 deletions.
4 changes: 3 additions & 1 deletion packages/axis-utils/.prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{}
{
"plugins": ["prettier-plugin-sh"]
}
8 changes: 4 additions & 4 deletions packages/axis-utils/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ src = "src"
out = "out"
libs = ["lib"]
fs_permissions = [
{access = "read", path = "./dependencies/axis-core-1.0.0/script/env.json"},
{access = "read", path = "./dependencies/axis-periphery-0.9.0/script/env.json"},
{access = "read", path = "./dependencies/axis-core-1.0.1/script/env.json"},
{access = "read", path = "./dependencies/axis-periphery-1.0.0/script/env.json"},
]
ffi = true
solc_version = "0.8.19"
Expand Down Expand Up @@ -32,8 +32,8 @@ ignore = [
[dependencies]
forge-std = "1.9.1"
solmate = { version = "6.7.0", url = "git@github.com:transmissions11/solmate.git", commit = "c892309933b25c03d32b1b0d674df7ae292ba925" }
axis-core = { version = "1.0.0" }
axis-periphery = { version = "0.9.0", git = "git@github.com:Axis-Fi/axis-periphery.git", rev = "a87edb37c610315dd46cd2d780863bb477f5c0c6" }
axis-core = { version = "1.0.1" }
axis-periphery = { version = "1.0.0" }
solady = { version = "0.0.124" }
clones-with-immutable-args = { version = "1.1.1", git = "git@github.com:wighawag/clones-with-immutable-args.git", rev = "f5ca191afea933d50a36d101009b5644dc28bc99" }
"@openzeppelin-contracts" = { version = "4.9.2" }
Expand Down
1 change: 1 addition & 0 deletions packages/axis-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"license": "ISC",
"devDependencies": {
"prettier": "3.3.3",
"prettier-plugin-sh": "^0.14.0",
"solhint-community": "^3.7.0"
}
}
33 changes: 33 additions & 0 deletions packages/axis-utils/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/axis-utils/remappings.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@forge-std-1.9.1=dependencies/forge-std-1.9.1/src
@axis-core-1.0.0=dependencies/axis-core-1.0.0/src
@axis-core-1.0.1=dependencies/axis-core-1.0.1/src
@solmate-6.7.0=dependencies/solmate-6.7.0/src
@axis-periphery-0.9.0=dependencies/axis-periphery-0.9.0/src
@axis-periphery-0.9.0-script=dependencies/axis-periphery-0.9.0/script
@axis-periphery-0.9.0-test=dependencies/axis-periphery-0.9.0/test
@axis-periphery-1.0.0=dependencies/axis-periphery-1.0.0/src
@axis-periphery-1.0.0-script=dependencies/axis-periphery-1.0.0/script
@axis-periphery-1.0.0-test=dependencies/axis-periphery-1.0.0/test
@solady-0.0.124=dependencies/solady-0.0.124/src
@clones-with-immutable-args-1.1.1=dependencies/clones-with-immutable-args-1.1.1/src
@openzeppelin-contracts-4.9.2=dependencies/@openzeppelin-contracts-4.9.2
Expand Down
4 changes: 2 additions & 2 deletions packages/axis-utils/script/WithEnvironment.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ abstract contract WithEnvironment is Script {
console2.log("Using chain:", chain_);

// Load environment file
envAxisCore = vm.readFile("dependencies/axis-core-1.0.0/script/env.json");
envAxisPeriphery = vm.readFile("dependencies/axis-periphery-0.9.0/script/env.json");
envAxisCore = vm.readFile("dependencies/axis-core-1.0.1/script/env.json");
envAxisPeriphery = vm.readFile("dependencies/axis-periphery-1.0.0/script/env.json");
}

/// @notice Get address from environment file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {Constants} from "../constants.s.sol";
import {MockERC20} from "../../../test/mocks/MockERC20.sol";

// Axis contracts
import {IAtomicAuctionHouse} from "@axis-core-1.0.0/interfaces/IAtomicAuctionHouse.sol";
import {IFixedPriceSale} from "@axis-core-1.0.0/interfaces/modules/auctions/IFixedPriceSale.sol";
import {IAtomicAuctionHouse} from "@axis-core-1.0.1/interfaces/IAtomicAuctionHouse.sol";
import {IFixedPriceSale} from "@axis-core-1.0.1/interfaces/modules/auctions/IFixedPriceSale.sol";

contract PurchaseScript is Script, Constants {
function run(bool usePermit2_) public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {console2} from "@forge-std-1.9.1/console2.sol";
import {Constants} from "../constants.s.sol";

// Axis contracts
import {IBatchAuctionHouse} from "@axis-core-1.0.0/interfaces/IBatchAuctionHouse.sol";
import {IBatchAuctionHouse} from "@axis-core-1.0.1/interfaces/IBatchAuctionHouse.sol";

contract AbortScript is Script, Constants {
function run() public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {console2} from "@forge-std-1.9.1/console2.sol";
import {Constants} from "../constants.s.sol";

// Axis contracts
import {IBatchAuctionHouse} from "@axis-core-1.0.0/interfaces/IBatchAuctionHouse.sol";
import {IBatchAuction} from "@axis-core-1.0.0/interfaces/modules/IBatchAuction.sol";
import {IBatchAuctionHouse} from "@axis-core-1.0.1/interfaces/IBatchAuctionHouse.sol";
import {IBatchAuction} from "@axis-core-1.0.1/interfaces/modules/IBatchAuction.sol";

contract BidCancelScript is Script, Constants {
function run() public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {console2} from "@forge-std-1.9.1/console2.sol";
import {Constants} from "../constants.s.sol";

// Axis contracts
import {IBatchAuctionHouse} from "@axis-core-1.0.0/interfaces/IBatchAuctionHouse.sol";
import {IBatchAuctionHouse} from "@axis-core-1.0.1/interfaces/IBatchAuctionHouse.sol";

contract BidClaimScript is Script, Constants {
function run() public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import {Constants} from "../constants.s.sol";
import {MockERC20} from "../../../test/mocks/MockERC20.sol";

// Axis contracts
import {IBatchAuctionHouse} from "@axis-core-1.0.0/interfaces/IBatchAuctionHouse.sol";
import {IBatchAuctionHouse} from "@axis-core-1.0.1/interfaces/IBatchAuctionHouse.sol";
import {IEncryptedMarginalPrice} from
"@axis-core-1.0.0/interfaces/modules/auctions/IEncryptedMarginalPrice.sol";
"@axis-core-1.0.1/interfaces/modules/auctions/IEncryptedMarginalPrice.sol";

// Libraries
import {ECIES, Point} from "@axis-core-1.0.0/lib/ECIES.sol";
import {ECIES, Point} from "@axis-core-1.0.1/lib/ECIES.sol";
import {EncryptedMarginalPriceBid} from "../../../src/lib/EncryptedMarginalPriceBid.sol";

contract BidSubmitScript is Script, Constants {
Expand Down
6 changes: 3 additions & 3 deletions packages/axis-utils/script/developer-guide/batch/settle.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {console2} from "@forge-std-1.9.1/console2.sol";
import {Constants} from "../constants.s.sol";

// Axis contracts
import {IBatchAuctionHouse} from "@axis-core-1.0.0/interfaces/IBatchAuctionHouse.sol";
import {IBatchAuctionHouse} from "@axis-core-1.0.1/interfaces/IBatchAuctionHouse.sol";
import {IEncryptedMarginalPrice} from
"@axis-core-1.0.0/interfaces/modules/auctions/IEncryptedMarginalPrice.sol";
import {IBatchAuction} from "@axis-core-1.0.0/interfaces/modules/IBatchAuction.sol";
"@axis-core-1.0.1/interfaces/modules/auctions/IEncryptedMarginalPrice.sol";
import {IBatchAuction} from "@axis-core-1.0.1/interfaces/modules/IBatchAuction.sol";

contract SettleScript is Script, Constants {
function run() public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Script} from "@forge-std-1.9.1/Script.sol";
import {Constants} from "./constants.s.sol";

// Axis contracts
import {IAuctionHouse} from "@axis-core-1.0.0/interfaces/IAuctionHouse.sol";
import {IAuctionHouse} from "@axis-core-1.0.1/interfaces/IAuctionHouse.sol";

contract CancelAuctionScript is Script, Constants {
function run() public {
Expand Down
12 changes: 6 additions & 6 deletions packages/axis-utils/script/developer-guide/create-auction.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import {Constants} from "./constants.s.sol";
import {MockERC20} from "../../test/mocks/MockERC20.sol";

// Libraries
import {ECIES, Point} from "@axis-core-1.0.0/lib/ECIES.sol";
import {ECIES, Point} from "@axis-core-1.0.1/lib/ECIES.sol";

// Axis contracts
import {IAuctionHouse} from "@axis-core-1.0.0/interfaces/IAuctionHouse.sol";
import {IAuction} from "@axis-core-1.0.0/interfaces/modules/IAuction.sol";
import {ICallback} from "@axis-core-1.0.0/interfaces/ICallback.sol";
import {toKeycode} from "@axis-core-1.0.0/modules/Keycode.sol";
import {IAuctionHouse} from "@axis-core-1.0.1/interfaces/IAuctionHouse.sol";
import {IAuction} from "@axis-core-1.0.1/interfaces/modules/IAuction.sol";
import {ICallback} from "@axis-core-1.0.1/interfaces/ICallback.sol";
import {toKeycode} from "@axis-core-1.0.1/modules/Keycode.sol";
import {IEncryptedMarginalPrice} from
"@axis-core-1.0.0/interfaces/modules/auctions/IEncryptedMarginalPrice.sol";
"@axis-core-1.0.1/interfaces/modules/auctions/IEncryptedMarginalPrice.sol";

contract CreateAuctionScript is Script, Constants {
function run() external {
Expand Down
6 changes: 3 additions & 3 deletions packages/axis-utils/script/developer-guide/curation.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {Script} from "@forge-std-1.9.1/Script.sol";
import {Constants} from "./constants.s.sol";

// Axis contracts
import {IAuctionHouse} from "@axis-core-1.0.0/interfaces/IAuctionHouse.sol";
import {IFeeManager} from "@axis-core-1.0.0/interfaces/IFeeManager.sol";
import {Keycode, toKeycode} from "@axis-core-1.0.0/modules/Keycode.sol";
import {IAuctionHouse} from "@axis-core-1.0.1/interfaces/IAuctionHouse.sol";
import {IFeeManager} from "@axis-core-1.0.1/interfaces/IFeeManager.sol";
import {Keycode, toKeycode} from "@axis-core-1.0.1/modules/Keycode.sol";

contract CuratorScript is Script, Constants {
function setCuratorMaxFee() public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import {Constants} from "./constants.s.sol";
import {MockERC20} from "../../test/mocks/MockERC20.sol";

// Axis contracts
import {IAuctionHouse} from "@axis-core-1.0.0/interfaces/IAuctionHouse.sol";
import {IAtomicAuctionHouse} from "@axis-core-1.0.0/interfaces/IAtomicAuctionHouse.sol";
import {IAuctionHouse} from "@axis-core-1.0.1/interfaces/IAuctionHouse.sol";
import {IAtomicAuctionHouse} from "@axis-core-1.0.1/interfaces/IAtomicAuctionHouse.sol";

import {IAuction} from "@axis-core-1.0.0/interfaces/modules/IAuction.sol";
import {IFixedPriceSale} from "@axis-core-1.0.0/interfaces/modules/auctions/IFixedPriceSale.sol";
import {IAuction} from "@axis-core-1.0.1/interfaces/modules/IAuction.sol";
import {IFixedPriceSale} from "@axis-core-1.0.1/interfaces/modules/auctions/IFixedPriceSale.sol";

import {IDerivative} from "@axis-core-1.0.0/interfaces/modules/IDerivative.sol";
import {ILinearVesting} from "@axis-core-1.0.0/interfaces/modules/derivatives/ILinearVesting.sol";
import {IDerivative} from "@axis-core-1.0.1/interfaces/modules/IDerivative.sol";
import {ILinearVesting} from "@axis-core-1.0.1/interfaces/modules/derivatives/ILinearVesting.sol";

import {ICallback} from "@axis-core-1.0.0/interfaces/ICallback.sol";
import {toKeycode} from "@axis-core-1.0.0/modules/Keycode.sol";
import {ICallback} from "@axis-core-1.0.1/interfaces/ICallback.sol";
import {toKeycode} from "@axis-core-1.0.1/modules/Keycode.sol";

contract DerivativesScript is Script, Constants {
function createAuction() external {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ pragma solidity 0.8.19;
import {Script} from "@forge-std-1.9.1/Script.sol";

// System contracts
import {BatchAuctionHouse} from "@axis-core-1.0.0/BatchAuctionHouse.sol";
import {IAuctionHouse} from "@axis-core-1.0.0/interfaces/IAuctionHouse.sol";
import {toKeycode} from "@axis-core-1.0.0/modules/Modules.sol";
import {EncryptedMarginalPrice} from "@axis-core-1.0.0/modules/auctions/batch/EMP.sol";
import {Point} from "@axis-core-1.0.0/lib/ECIES.sol";
import {BatchAuctionHouse} from "@axis-core-1.0.1/BatchAuctionHouse.sol";
import {IAuctionHouse} from "@axis-core-1.0.1/interfaces/IAuctionHouse.sol";
import {toKeycode} from "@axis-core-1.0.1/modules/Modules.sol";
import {EncryptedMarginalPrice} from "@axis-core-1.0.1/modules/auctions/batch/EMP.sol";
import {Point} from "@axis-core-1.0.1/lib/ECIES.sol";

// Generic contracts
import {MockERC20} from "@solmate-6.7.0/test/utils/mocks/MockERC20.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ source .env

# Cancel auction
forge script ./script/test/EncryptedMarginalPrice/TestData.s.sol:TestData --sig "cancelAuction(uint96)()" $1 \
--rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \
--broadcast
--rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \
--broadcast
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,25 @@ eval "$curenv"
AUCTION_TYPE=$1

# Check if Auction type is set
if [ -z "$AUCTION_TYPE" ]
then
if [ -z "$AUCTION_TYPE" ]; then
echo "No auction type specified. Provide a valid auction type."
exit 1
fi

# Check if Auction type is valid
if [ "$AUCTION_TYPE" != "EMP" ] && [ "$AUCTION_TYPE" != "FPB" ]
then
if [ "$AUCTION_TYPE" != "EMP" ] && [ "$AUCTION_TYPE" != "FPB" ]; then
echo "Invalid auction type. Provide a valid auction type."
exit 1
fi

# Set the function to call based on the auction type
if [ "$AUCTION_TYPE" == "EMP" ]
then
if [ "$AUCTION_TYPE" == "EMP" ]; then
CALLDATA=$(cast calldata "createAuction(uint256,uint256,address)" $2 $3 $4)
elif [ "$AUCTION_TYPE" == "FPB" ]
then
elif [ "$AUCTION_TYPE" == "FPB" ]; then
CALLDATA=$(cast calldata "createFPBAuction()")
fi

# Create auction
forge script ./script/test/EncryptedMarginalPrice/TestData.s.sol:TestData --sig $CALLDATA \
--rpc-url $RPC_URL --private-key $BIDDER_PRIVATE_KEY --froms $BIDDER_ADDRESS --slow -vvv \
--broadcast
--rpc-url $RPC_URL --private-key $BIDDER_PRIVATE_KEY --froms $BIDDER_ADDRESS --slow -vvv \
--broadcast
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ source .env

# Create auction
forge script ./script/test/EncryptedMarginalPrice/TestData.s.sol:TestData --sig "mintTestTokens(address,address)()" $1 $2 \
--rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \
--broadcast
--rpc-url $RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --froms $DEPLOYER_ADDRESS --slow -vvv \
--broadcast
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ source .env

# Create auction
forge script ./script/test/EncryptedMarginalPrice/TestData.s.sol:TestData --sig "placeBid(uint96,uint256,uint256)()" $1 $2 $3 \
--rpc-url $RPC_URL --private-key $BIDDER_PRIVATE_KEY --froms $BIDDER_ADDRESS --slow -vvv \
--broadcast
--rpc-url $RPC_URL --private-key $BIDDER_PRIVATE_KEY --froms $BIDDER_ADDRESS --slow -vvv \
--broadcast
Loading

0 comments on commit d4122f4

Please sign in to comment.