Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
adf0239
poc for operations script with foundry.
clement-ux Aug 5, 2025
f15d55c
chore: update .gitignore, refactor foundry.toml, and add JSON transfo…
clement-ux Aug 12, 2025
7ac2082
refactor: remove JsonWriter inheritance from SetupMainnet contract
clement-ux Aug 12, 2025
8e9ea4a
feat: add display option for JSON output and implement Runlogs_2025_0…
clement-ux Aug 12, 2025
ba3e72a
feat: add Runlogs_2025_08 contract and JSON transformation script; up…
clement-ux Aug 17, 2025
38b9974
fix: rename contract to Runlogs_2025_08_Mainnet for clarity
clement-ux Aug 18, 2025
cfcb4af
Create README.md
clement-ux Aug 18, 2025
6cea131
feat: add Makefile for script execution and chain ID retrieval; updat…
clement-ux Aug 18, 2025
ae5369a
Update README.md
clement-ux Aug 18, 2025
031e3fc
fix: correct error message for invalid chain in Makefile
clement-ux Aug 18, 2025
afca0e9
Merge branch 'clement/foundry-poc' of https://github.com/OriginProtoc…
clement-ux Aug 18, 2025
3fe2efa
feat: refactor contract setup and add Base chain support; enhance log…
clement-ux Aug 18, 2025
072fea5
feat: add function to deposit 125 WETH on Curve AMO; update run metho…
clement-ux Aug 21, 2025
4a9bda9
migrate from python script to foundry script
clement-ux Aug 28, 2025
d672420
feat: enhance BroadcastConvertor to support timelock transactions and…
clement-ux Aug 28, 2025
1c39327
feat: add support for Sonic chain
clement-ux Aug 28, 2025
0f914ca
feat: add ISonicARM interface and update runlogs for Sonic integratio…
clement-ux Aug 29, 2025
7214036
fix: correct file extension in BroadcastConvertor script path
clement-ux Sep 1, 2025
c644b85
feat: enhance ISonicARM interface and add new runlogs for Sonic integ…
clement-ux Sep 1, 2025
ea1384c
Revise runlogs conversion instructions in README
clement-ux Sep 1, 2025
d2e17e3
feat: enhance BroadcastConvertor to support Timelock scheduling and e…
clement-ux Sep 1, 2025
8fc2dc5
Update README.md
clement-ux Sep 1, 2025
37f4938
feat: update Makefile to correct script path and add new runlogs for …
clement-ux Sep 2, 2025
2a5078e
Add runlog
shahthepro Sep 4, 2025
7d9ef97
feat: implement deposit functionality for Curve AMO in runlogs for Se…
clement-ux Sep 4, 2025
8cf7dda
feat: update runlogs for September 09, 2025; implement deposit of 125…
clement-ux Sep 9, 2025
3bfcd3f
feat: add Pool Booster functionality and update runlogs for September…
clement-ux Sep 11, 2025
13b995f
feat: update salt generation for Merkl Pool Booster to use a fixed st…
clement-ux Sep 11, 2025
02ced43
feat: add verbose flag to forge script command in Makefile
clement-ux Sep 11, 2025
a767237
refactor: comment out unused pool booster logic in Runlogs_2025_09_Base
clement-ux Sep 11, 2025
ac72912
feat: update September 11, 2025 runlog to deploy Merkl Pool Booster w…
clement-ux Sep 18, 2025
9220e17
feat: implement September 18, 2025 runlog for OETH/WETH pool deposit …
clement-ux Sep 18, 2025
444264b
feat: update September 18, 2025 runlog to deposit 86 WETH on Curve AMO
clement-ux Sep 18, 2025
6e8c657
Yield forwarding for a Merkl Pool booster (#2678)
sparrowDom Oct 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ contracts/.localKeyValueStorage
contracts/.localKeyValueStorage.mainnet
contracts/.localKeyValueStorage.holesky
contracts/scripts/defender-actions/dist/
contracts/broadcast/
contracts/out/
cache/
dependencies/

contracts/lib/defender-actions/dist/

Expand All @@ -89,3 +93,8 @@ unit-coverage

# Certora #
.certora_internal


# Soldeer
foundry/dependencies
soldeer.lock
57 changes: 57 additions & 0 deletions contracts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
-include .env

.EXPORT_ALL_VARIABLES:
MAKEFLAGS += --no-print-directory

# ANSI Colors
RESET=\033[0m

BLACK=\033[0;30m
RED=\033[0;31m
GREEN=\033[0;32m
YELLOW=\033[0;33m
BLUE=\033[0;34m
MAGENTA=\033[0;35m
CYAN=\033[0;36m
WHITE=\033[0;37m

# Bold colors
BOLD_BLACK=\033[1;30m
BOLD_RED=\033[1;31m
BOLD_GREEN=\033[1;32m
BOLD_YELLOW=\033[1;33m
BOLD_BLUE=\033[1;34m
BOLD_MAGENTA=\033[1;35m
BOLD_CYAN=\033[1;36m
BOLD_WHITE=\033[1;37m

DATE ?= $(shell date +%Y_%m)
CHAIN ?= Mainnet

VALID_CHAINS = Mainnet Base Sonic Plume Arbitrum Holesky
MAINNET_ID = 1
BASE_ID = 8453
SONIC_ID = 146
PLUME_ID = 98865
ARBITRUM_ID = 42161
HOLESKY_ID = 17000

define get_chain_id
$(if $(filter $(CHAIN),$(VALID_CHAINS)),\
$(if $(filter Mainnet,$(CHAIN)),$(MAINNET_ID),\
$(if $(filter Base,$(CHAIN)),$(BASE_ID),\
$(if $(filter Sonic,$(CHAIN)),$(SONIC_ID),\
$(if $(filter Plume,$(CHAIN)),$(PLUME_ID),\
$(if $(filter Arbitrum,$(CHAIN)),$(ARBITRUM_ID),\
$(HOLESKY_ID)))))),\
$(error CHAIN "$(CHAIN)" is not valid. Valid chains are: $(VALID_CHAINS)))
endef

script:
$(eval CHAIN_ID := $(call get_chain_id))
@echo "$(BOLD_BLUE)Running script RunlogsDATE=$(DATE)_CHAIN=$(CHAIN) $(RESET) \n"
forge script Runlogs_$(DATE)_$(CHAIN) -vvvvv
@echo "$(BOLD_BLUE)\nConverting foundry broadcast messages to Safe format... $(RESET) \n"
forge script BroadcastConvertor contracts/broadcast/$(DATE).s.sol/$(CHAIN_ID)/dry-run/

.PHONY: script
267 changes: 267 additions & 0 deletions contracts/contracts/interfaces/arm/ISonicARM.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;

interface ISonicARM {
error ERC20InsufficientAllowance(
address spender,
uint256 allowance,
uint256 needed
);
error ERC20InsufficientBalance(
address sender,
uint256 balance,
uint256 needed
);
error ERC20InvalidApprover(address approver);
error ERC20InvalidReceiver(address receiver);
error ERC20InvalidSender(address sender);
error ERC20InvalidSpender(address spender);
error InvalidInitialization();
error NotInitializing();
error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);
error SafeCastOverflowedIntToUint(int256 value);
error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
error SafeCastOverflowedUintToInt(uint256 value);

event ARMBufferUpdated(uint256 armBuffer);
event ActiveMarketUpdated(address indexed market);
event AdminChanged(address previousAdmin, address newAdmin);
event Allocated(address indexed market, int256 assets);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
event CapManagerUpdated(address indexed capManager);
event ClaimOriginWithdrawals(uint256[] requestIds, uint256 amountClaimed);
event CrossPriceUpdated(uint256 crossPrice);
event Deposit(address indexed owner, uint256 assets, uint256 shares);
event FeeCollected(address indexed feeCollector, uint256 fee);
event FeeCollectorUpdated(address indexed newFeeCollector);
event FeeUpdated(uint256 fee);
event Initialized(uint64 version);
event MarketAdded(address indexed market);
event MarketRemoved(address indexed market);
event OperatorChanged(address newAdmin);
event RedeemClaimed(
address indexed withdrawer,
uint256 indexed requestId,
uint256 assets
);
event RedeemRequested(
address indexed withdrawer,
uint256 indexed requestId,
uint256 assets,
uint256 queued,
uint256 claimTimestamp
);
event RequestOriginWithdrawal(uint256 amount, uint256 requestId);
event TraderateChanged(uint256 traderate0, uint256 traderate1);
event Transfer(address indexed from, address indexed to, uint256 value);

function FEE_SCALE() external view returns (uint256);

function MAX_CROSS_PRICE_DEVIATION() external view returns (uint256);

function PRICE_SCALE() external view returns (uint256);

function activeMarket() external view returns (address);

function addMarkets(address[] memory _markets) external;

function allocate() external returns (int256 liquidityDelta);

function allocateThreshold() external view returns (int256);

function allowance(address owner, address spender)
external
view
returns (uint256);

function approve(address spender, uint256 value) external returns (bool);

function armBuffer() external view returns (uint256);

function balanceOf(address account) external view returns (uint256);

function baseAsset() external view returns (address);

function capManager() external view returns (address);

function claimDelay() external view returns (uint256);

function claimOriginWithdrawals(uint256[] memory requestIds)
external
returns (uint256 amountClaimed);

function claimRedeem(uint256 requestId) external returns (uint256 assets);

function claimable() external view returns (uint256 claimableAmount);

function collectFees() external returns (uint256 fees);

function convertToAssets(uint256 shares)
external
view
returns (uint256 assets);

function convertToShares(uint256 assets)
external
view
returns (uint256 shares);

function crossPrice() external view returns (uint256);

function decimals() external view returns (uint8);

function deposit(uint256 assets, address receiver)
external
returns (uint256 shares);

function deposit(uint256 assets) external returns (uint256 shares);

function fee() external view returns (uint16);

function feeCollector() external view returns (address);

function feesAccrued() external view returns (uint256 fees);

function initialize(
string memory _name,
string memory _symbol,
address _operator,
uint256 _fee,
address _feeCollector,
address _capManager
) external;

function lastAvailableAssets() external view returns (int128);

function liquidityAsset() external view returns (address);

function minSharesToRedeem() external view returns (uint256);

function name() external view returns (string memory);

function nextWithdrawalIndex() external view returns (uint256);

function operator() external view returns (address);

function owner() external view returns (address);

function previewDeposit(uint256 assets)
external
view
returns (uint256 shares);

function previewRedeem(uint256 shares)
external
view
returns (uint256 assets);

function removeMarket(address _market) external;

function requestOriginWithdrawal(uint256 amount)
external
returns (uint256 requestId);

function requestRedeem(uint256 shares)
external
returns (uint256 requestId, uint256 assets);

function setARMBuffer(uint256 _armBuffer) external;

function setActiveMarket(address _market) external;

function setCapManager(address _capManager) external;

function setCrossPrice(uint256 newCrossPrice) external;

function setFee(uint256 _fee) external;

function setFeeCollector(address _feeCollector) external;

function setOperator(address newOperator) external;

function setOwner(address newOwner) external;

function setPrices(uint256 buyT1, uint256 sellT1) external;

function supportedMarkets(address market)
external
view
returns (bool supported);

function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] memory path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);

function swapExactTokensForTokens(
address inToken,
address outToken,
uint256 amountIn,
uint256 amountOutMin,
address to
) external;

function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] memory path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);

function swapTokensForExactTokens(
address inToken,
address outToken,
uint256 amountOut,
uint256 amountInMax,
address to
) external;

function symbol() external view returns (string memory);

function token0() external view returns (address);

function token1() external view returns (address);

function totalAssets() external view returns (uint256);

function totalSupply() external view returns (uint256);

function traderate0() external view returns (uint256);

function traderate1() external view returns (uint256);

function transfer(address to, uint256 value) external returns (bool);

function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);

function vault() external view returns (address);

function vaultWithdrawalAmount() external view returns (uint256);

function withdrawalRequests(uint256 requestId)
external
view
returns (
address withdrawer,
bool claimed,
uint40 claimTimestamp,
uint128 assets,
uint128 queued
);

function withdrawsClaimed() external view returns (uint128);

function withdrawsQueued() external view returns (uint128);
}
Loading
Loading