diff --git a/bin/generate-contracts b/bin/generate-contracts index b7801c3..6e260c1 100755 --- a/bin/generate-contracts +++ b/bin/generate-contracts @@ -2,11 +2,20 @@ CHAIN_ID=${1:-31337} +case "$CHAIN_ID" in + "sepolia") + CHAIN_ID=11155111 + ;; + "mainnet") + CHAIN_ID=1 + ;; +esac + if [ "$CHAIN_ID" = "31337" ]; then ABI_PATH=../lmsr-amm/out METADATA_PATH=../lmsr-amm/liqp-deployments.json else - ABI_PATH=../lmsr-amm/deployment/$1/v1/out + ABI_PATH=../lmsr-amm/deployment/$CHAIN_ID/v1/out METADATA_PATH=../lmsr-amm/deployment/liqp-deployments.json fi diff --git a/src/contracts/IPartyPoolABI.ts b/src/contracts/IPartyPoolABI.ts index 20b5805..57674a4 100644 --- a/src/contracts/IPartyPoolABI.ts +++ b/src/contracts/IPartyPoolABI.ts @@ -11,11 +11,6 @@ const IPartyPoolABI = [ "type": "tuple", "internalType": "struct LMSRStabilized.State", "components": [ - { - "name": "nAssets", - "type": "uint256", - "internalType": "uint256" - }, { "name": "kappa", "type": "int128", @@ -183,7 +178,7 @@ const IPartyPoolABI = [ "internalType": "uint256" }, { - "name": "inputTokenIndex", + "name": "outputTokenIndex", "type": "uint256", "internalType": "uint256" }, @@ -240,6 +235,43 @@ const IPartyPoolABI = [ ], "stateMutability": "view" }, + { + "type": "function", + "name": "fee", + "inputs": [ + { + "name": "i", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "j", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "fees", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "flashFeePpm", @@ -526,7 +558,7 @@ const IPartyPoolABI = [ "internalType": "uint256" }, { - "name": "fee", + "name": "inFee", "type": "uint256", "internalType": "uint256" } @@ -570,20 +602,7 @@ const IPartyPoolABI = [ "internalType": "uint256" }, { - "name": "fee", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "swapFeePpm", - "inputs": [], - "outputs": [ - { - "name": "", + "name": "inFee", "type": "uint256", "internalType": "uint256" } @@ -621,10 +640,20 @@ const IPartyPoolABI = [ } ], "outputs": [ + { + "name": "amountInUsed", + "type": "uint256", + "internalType": "uint256" + }, { "name": "lpMinted", "type": "uint256", "internalType": "uint256" + }, + { + "name": "inFee", + "type": "uint256", + "internalType": "uint256" } ], "stateMutability": "payable" @@ -681,7 +710,7 @@ const IPartyPoolABI = [ "internalType": "uint256" }, { - "name": "fee", + "name": "inFee", "type": "uint256", "internalType": "uint256" } diff --git a/src/contracts/IPartyPoolViewerABI.ts b/src/contracts/IPartyPoolViewerABI.ts index 15c0c01..0882489 100644 --- a/src/contracts/IPartyPoolViewerABI.ts +++ b/src/contracts/IPartyPoolViewerABI.ts @@ -40,7 +40,7 @@ const IPartyPoolViewerABI = [ "internalType": "uint256" }, { - "name": "inputTokenIndex", + "name": "outputTokenIndex", "type": "uint256", "internalType": "uint256" } @@ -50,6 +50,11 @@ const IPartyPoolViewerABI = [ "name": "amountOut", "type": "uint256", "internalType": "uint256" + }, + { + "name": "outFee", + "type": "uint256", + "internalType": "uint256" } ], "stateMutability": "view" @@ -235,12 +240,12 @@ const IPartyPoolViewerABI = [ "internalType": "uint256" }, { - "name": "fee", + "name": "lpMinted", "type": "uint256", "internalType": "uint256" }, { - "name": "lpMinted", + "name": "inFee", "type": "uint256", "internalType": "uint256" } @@ -284,7 +289,7 @@ const IPartyPoolViewerABI = [ "internalType": "uint256" }, { - "name": "fee", + "name": "inFee", "type": "uint256", "internalType": "uint256" }