From 348aef176e327be721fba123bb717bddc589bbb0 Mon Sep 17 00:00:00 2001
From: ZeKraken
Date: Thu, 13 Apr 2023 08:43:00 -0400
Subject: [PATCH 1/9] header update
---
src/App.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/App.js b/src/App.js
index 08e8ced..b75c473 100644
--- a/src/App.js
+++ b/src/App.js
@@ -278,7 +278,11 @@ function App() {
Rate Providers
-
+
+
+ Token Approvals
+
+
{rows.map((_, rowIndex) => (
From 2bc90ddb210a574d01693f7ccb3cb4b5efe63d70 Mon Sep 17 00:00:00 2001
From: ZeKraken
Date: Thu, 13 Apr 2023 18:01:25 -0400
Subject: [PATCH 2/9] update for initjoin
---
.gitignore | 1 +
README.md | 17 -------
src/App.js | 128 +++++++++++++++++++++++++++++++++++++++++++++++------
3 files changed, 116 insertions(+), 30 deletions(-)
diff --git a/.gitignore b/.gitignore
index 4d29575..36d5bdc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@
.env.development.local
.env.test.local
.env.production.local
+.scratchpad
npm-debug.log*
yarn-debug.log*
diff --git a/README.md b/README.md
index c38fe5b..e69de29 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +0,0 @@
-token addresses
-0xdfcea9088c8a88a76ff74892c1457c17dfeef9c1
-0xfa8449189744799ad2ace7e0ebac8bb7575eff47
-
-amounts
-800000000000000000
-200000000000000000
-
-swap fee
-10000000000000000
-
-owner
-0xaffc70b81d54f229a5f50ec07e2c76d2aaad07ae
-
-rate provider
-0x0000000000000000000000000000000000000000
-0x0000000000000000000000000000000000000000
diff --git a/src/App.js b/src/App.js
index b75c473..b99931e 100644
--- a/src/App.js
+++ b/src/App.js
@@ -7,8 +7,10 @@ import Box from "@mui/material/Box";
import Container from "@mui/material/Container";
import { CreateABI } from "./abi/WeightedPoolFactory";
import { ERC20 } from "./abi/erc20";
+import { vaultABI } from "./abi/BalVault";
function App() {
+ const [isConnected, setIsConnected] = useState(false);
const FactoryAddress = "0x230a59f4d9adc147480f03b0d3fffecd56c3289a";
const [walletAddress, setWalletAddress] = useState();
const [buttonText, setButtonText] = useState("Connect Wallet");
@@ -31,6 +33,7 @@ function App() {
const [tokenAddresses, setTokenAddresses] = useState(new Array(8).fill(""));
const [tokenWeights, setTokenWeights] = useState(new Array(8).fill(""));
const [rateProviders, setRateProviders] = useState(new Array(8).fill(""));
+ const [tokenAmounts, setTokenAmounts] = useState(new Array(8).fill(""));
const handleInputChange = (event, rowIndex, setter) => {
const newValue = event.target.value;
setter((prevState) => {
@@ -45,7 +48,7 @@ function App() {
const accounts = await window.ethereum.request({
method: "eth_accounts",
});
- if (accounts.length) {
+ if (accounts.length && !isConnected) {
const networkId = await window.ethereum.request({
method: "net_version",
});
@@ -54,17 +57,24 @@ function App() {
const ethaddress = accounts[0];
setWalletAddress(ethaddress);
setButtonText("Wallet Connected");
- } else {
+ setIsConnected(true);
+ } else if (!accounts.length && isConnected) {
console.log("Metamask is not connected");
+ setIsConnected(false);
}
}
- window.ethereum.on("chainChanged", () => {
+ const onChainChanged = () => {
checkWalletonLoad();
- });
- window.ethereum.on("accountsChanged", () => {
+ };
+
+ const onAccountsChanged = () => {
checkWalletonLoad();
- });
+ };
+
+ window.ethereum.setMaxListeners(window.ethereum.getMaxListeners() + 2); // Increase the max listeners limit
+ window.ethereum.on("chainChanged", onChainChanged);
+ window.ethereum.on("accountsChanged", onAccountsChanged);
async function checkApprovedTokens() {
const provider = new ethers.providers.Web3Provider(window.ethereum);
@@ -88,7 +98,13 @@ function App() {
checkWalletonLoad();
checkApprovedTokens();
- }, [tokenAddresses, approvedTokens, walletAddress]);
+
+ return () => {
+ window.ethereum.removeListener("chainChanged", onChainChanged);
+ window.ethereum.removeListener("accountsChanged", onAccountsChanged);
+ window.ethereum.setMaxListeners(window.ethereum.getMaxListeners() - 2); // Decrease the max listeners limit back
+ };
+ }, [tokenAddresses, approvedTokens, walletAddress, isConnected]);
function getNetworkName(networkId) {
switch (networkId) {
@@ -161,6 +177,57 @@ function App() {
);
}
+ async function initJoin() {
+ await requestAccount();
+ const provider = new ethers.providers.Web3Provider(window.ethereum);
+ await provider.send("eth_requestAccounts", []);
+ const signer = await provider.getSigner();
+ const ethcontract = new ethers.Contract(contractAddress, vaultABI, signer);
+ const gasoverride = { gasLimit: 6000000 };
+
+ const poolId =
+ "0xd503dd8ae0e4669106167ad1a7df0569a9c1340500020000000000000000073a";
+ const assets = [
+ "0xdfcea9088c8a88a76ff74892c1457c17dfeef9c1",
+ "0xfa8449189744799ad2ace7e0ebac8bb7575eff47",
+ ];
+ const amountsIn = ["1000000000000000", "70000000000000000"];
+
+ const linkedItems = assets.map((asset, index) => [asset, amountsIn[index]]);
+
+ linkedItems.sort((a, b) => {
+ if (a[0] < b[0]) return -1;
+ if (a[0] > b[0]) return 1;
+ return 0;
+ });
+
+ const sortedAssets = linkedItems.map((item) => item[0]);
+ const sortedAmountsIn = linkedItems.map((item) => item[1]);
+
+ const JOIN_KIND_INIT = 0;
+
+ const userData = ethers.utils.defaultAbiCoder.encode(
+ ["uint256", "uint256[]"],
+ [JOIN_KIND_INIT, sortedAmountsIn]
+ );
+
+ const joinRequest = {
+ assets: sortedAssets,
+ maxAmountsIn: amountsIn,
+ userData,
+ fromInternalBalance: false,
+ };
+
+ console.log(joinRequest);
+
+ await ethcontract.joinPool(
+ poolId,
+ walletAddress,
+ walletAddress,
+ joinRequest,
+ gasoverride
+ );
+ }
// const checkAllowance = async (tokenAddress, contractAddress) => {
// const provider = new ethers.providers.Web3Provider(window.ethereum);
// const tokenContract = new ethers.Contract(tokenAddress, ERC20, provider);
@@ -243,9 +310,16 @@ function App() {
-
@@ -262,13 +336,13 @@ function App() {
}}
>
-
+
Token Addresses
-
+
Token Weights
@@ -278,11 +352,16 @@ function App() {
Rate Providers
-
+
Token Approvals
+
+
+ Token Amounts
+
+
{rows.map((_, rowIndex) => (
@@ -307,7 +386,7 @@ function App() {
}}
/>
-
+
-
+
+
+
+ handleInputChange(event, rowIndex, setTokenAmounts)
+ }
+ fullWidth
+ InputProps={{
+ sx: {
+ color: "yellow",
+ fontSize: "12px",
+ },
+ }}
+ InputLabelProps={{
+ sx: {
+ color: "white",
+ },
+ }}
+ />
+
))}
+
+
- Wallet Address: {walletAddress}
+
+ Wallet Address: {walletAddress.substring(0, 6)}...
+ {walletAddress.substring(walletAddress.length - 6)}
+
+
Network: {network}
@@ -468,7 +497,7 @@ function App() {
onClick={() =>
handleApprovalClick(
tokenAddresses[rowIndex],
- contractAddress,
+ vaultAddress,
rowIndex
)
}
@@ -505,9 +534,6 @@ function App() {
-
- check decimal
-
diff --git a/src/abi/WeightedPool.js b/src/abi/WeightedPool.js
new file mode 100644
index 0000000..c176a75
--- /dev/null
+++ b/src/abi/WeightedPool.js
@@ -0,0 +1,609 @@
+export const weightedPool = [
+ {
+ inputs: [
+ {
+ components: [
+ { internalType: "string", name: "name", type: "string" },
+ { internalType: "string", name: "symbol", type: "string" },
+ {
+ internalType: "contract IERC20[]",
+ name: "tokens",
+ type: "address[]",
+ },
+ {
+ internalType: "uint256[]",
+ name: "normalizedWeights",
+ type: "uint256[]",
+ },
+ {
+ internalType: "contract IRateProvider[]",
+ name: "rateProviders",
+ type: "address[]",
+ },
+ {
+ internalType: "address[]",
+ name: "assetManagers",
+ type: "address[]",
+ },
+ {
+ internalType: "uint256",
+ name: "swapFeePercentage",
+ type: "uint256",
+ },
+ ],
+ internalType: "struct WeightedPool.NewPoolParams",
+ name: "params",
+ type: "tuple",
+ },
+ { internalType: "contract IVault", name: "vault", type: "address" },
+ {
+ internalType: "contract IProtocolFeePercentagesProvider",
+ name: "protocolFeeProvider",
+ type: "address",
+ },
+ { internalType: "uint256", name: "pauseWindowDuration", type: "uint256" },
+ {
+ internalType: "uint256",
+ name: "bufferPeriodDuration",
+ type: "uint256",
+ },
+ { internalType: "address", name: "owner", type: "address" },
+ { internalType: "string", name: "version", type: "string" },
+ ],
+ stateMutability: "nonpayable",
+ type: "constructor",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ {
+ indexed: true,
+ internalType: "address",
+ name: "owner",
+ type: "address",
+ },
+ {
+ indexed: true,
+ internalType: "address",
+ name: "spender",
+ type: "address",
+ },
+ {
+ indexed: false,
+ internalType: "uint256",
+ name: "value",
+ type: "uint256",
+ },
+ ],
+ name: "Approval",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ { indexed: false, internalType: "bool", name: "paused", type: "bool" },
+ ],
+ name: "PausedStateChanged",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ {
+ indexed: true,
+ internalType: "uint256",
+ name: "feeType",
+ type: "uint256",
+ },
+ {
+ indexed: false,
+ internalType: "uint256",
+ name: "protocolFeePercentage",
+ type: "uint256",
+ },
+ ],
+ name: "ProtocolFeePercentageCacheUpdated",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ { indexed: false, internalType: "bool", name: "enabled", type: "bool" },
+ ],
+ name: "RecoveryModeStateChanged",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ {
+ indexed: false,
+ internalType: "uint256",
+ name: "swapFeePercentage",
+ type: "uint256",
+ },
+ ],
+ name: "SwapFeePercentageChanged",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ { indexed: true, internalType: "address", name: "from", type: "address" },
+ { indexed: true, internalType: "address", name: "to", type: "address" },
+ {
+ indexed: false,
+ internalType: "uint256",
+ name: "value",
+ type: "uint256",
+ },
+ ],
+ name: "Transfer",
+ type: "event",
+ },
+ {
+ inputs: [],
+ name: "DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "DOMAIN_SEPARATOR",
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "address", name: "owner", type: "address" },
+ { internalType: "address", name: "spender", type: "address" },
+ ],
+ name: "allowance",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "address", name: "spender", type: "address" },
+ { internalType: "uint256", name: "amount", type: "uint256" },
+ ],
+ name: "approve",
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
+ name: "balanceOf",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "decimals",
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "address", name: "spender", type: "address" },
+ { internalType: "uint256", name: "amount", type: "uint256" },
+ ],
+ name: "decreaseAllowance",
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "disableRecoveryMode",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "enableRecoveryMode",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getATHRateProduct",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [{ internalType: "bytes4", name: "selector", type: "bytes4" }],
+ name: "getActionId",
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getActualSupply",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getAuthorizer",
+ outputs: [
+ { internalType: "contract IAuthorizer", name: "", type: "address" },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getDomainSeparator",
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getInvariant",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getLastPostJoinExitInvariant",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
+ name: "getNextNonce",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getNormalizedWeights",
+ outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getOwner",
+ outputs: [{ internalType: "address", name: "", type: "address" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getPausedState",
+ outputs: [
+ { internalType: "bool", name: "paused", type: "bool" },
+ { internalType: "uint256", name: "pauseWindowEndTime", type: "uint256" },
+ { internalType: "uint256", name: "bufferPeriodEndTime", type: "uint256" },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getPoolId",
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [{ internalType: "uint256", name: "feeType", type: "uint256" }],
+ name: "getProtocolFeePercentageCache",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getProtocolFeesCollector",
+ outputs: [
+ {
+ internalType: "contract IProtocolFeesCollector",
+ name: "",
+ type: "address",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getProtocolSwapFeeDelegation",
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getRateProviders",
+ outputs: [
+ { internalType: "contract IRateProvider[]", name: "", type: "address[]" },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getScalingFactors",
+ outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getSwapFeePercentage",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "getVault",
+ outputs: [{ internalType: "contract IVault", name: "", type: "address" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "inRecoveryMode",
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "address", name: "spender", type: "address" },
+ { internalType: "uint256", name: "addedValue", type: "uint256" },
+ ],
+ name: "increaseAllowance",
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "name",
+ outputs: [{ internalType: "string", name: "", type: "string" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
+ name: "nonces",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "bytes32", name: "poolId", type: "bytes32" },
+ { internalType: "address", name: "sender", type: "address" },
+ { internalType: "address", name: "recipient", type: "address" },
+ { internalType: "uint256[]", name: "balances", type: "uint256[]" },
+ { internalType: "uint256", name: "lastChangeBlock", type: "uint256" },
+ {
+ internalType: "uint256",
+ name: "protocolSwapFeePercentage",
+ type: "uint256",
+ },
+ { internalType: "bytes", name: "userData", type: "bytes" },
+ ],
+ name: "onExitPool",
+ outputs: [
+ { internalType: "uint256[]", name: "", type: "uint256[]" },
+ { internalType: "uint256[]", name: "", type: "uint256[]" },
+ ],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "bytes32", name: "poolId", type: "bytes32" },
+ { internalType: "address", name: "sender", type: "address" },
+ { internalType: "address", name: "recipient", type: "address" },
+ { internalType: "uint256[]", name: "balances", type: "uint256[]" },
+ { internalType: "uint256", name: "lastChangeBlock", type: "uint256" },
+ {
+ internalType: "uint256",
+ name: "protocolSwapFeePercentage",
+ type: "uint256",
+ },
+ { internalType: "bytes", name: "userData", type: "bytes" },
+ ],
+ name: "onJoinPool",
+ outputs: [
+ { internalType: "uint256[]", name: "", type: "uint256[]" },
+ { internalType: "uint256[]", name: "", type: "uint256[]" },
+ ],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ components: [
+ { internalType: "enum IVault.SwapKind", name: "kind", type: "uint8" },
+ { internalType: "contract IERC20", name: "tokenIn", type: "address" },
+ {
+ internalType: "contract IERC20",
+ name: "tokenOut",
+ type: "address",
+ },
+ { internalType: "uint256", name: "amount", type: "uint256" },
+ { internalType: "bytes32", name: "poolId", type: "bytes32" },
+ { internalType: "uint256", name: "lastChangeBlock", type: "uint256" },
+ { internalType: "address", name: "from", type: "address" },
+ { internalType: "address", name: "to", type: "address" },
+ { internalType: "bytes", name: "userData", type: "bytes" },
+ ],
+ internalType: "struct IPoolSwapStructs.SwapRequest",
+ name: "request",
+ type: "tuple",
+ },
+ { internalType: "uint256", name: "balanceTokenIn", type: "uint256" },
+ { internalType: "uint256", name: "balanceTokenOut", type: "uint256" },
+ ],
+ name: "onSwap",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "pause",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "address", name: "owner", type: "address" },
+ { internalType: "address", name: "spender", type: "address" },
+ { internalType: "uint256", name: "value", type: "uint256" },
+ { internalType: "uint256", name: "deadline", type: "uint256" },
+ { internalType: "uint8", name: "v", type: "uint8" },
+ { internalType: "bytes32", name: "r", type: "bytes32" },
+ { internalType: "bytes32", name: "s", type: "bytes32" },
+ ],
+ name: "permit",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "bytes32", name: "poolId", type: "bytes32" },
+ { internalType: "address", name: "sender", type: "address" },
+ { internalType: "address", name: "recipient", type: "address" },
+ { internalType: "uint256[]", name: "balances", type: "uint256[]" },
+ { internalType: "uint256", name: "lastChangeBlock", type: "uint256" },
+ {
+ internalType: "uint256",
+ name: "protocolSwapFeePercentage",
+ type: "uint256",
+ },
+ { internalType: "bytes", name: "userData", type: "bytes" },
+ ],
+ name: "queryExit",
+ outputs: [
+ { internalType: "uint256", name: "bptIn", type: "uint256" },
+ { internalType: "uint256[]", name: "amountsOut", type: "uint256[]" },
+ ],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "bytes32", name: "poolId", type: "bytes32" },
+ { internalType: "address", name: "sender", type: "address" },
+ { internalType: "address", name: "recipient", type: "address" },
+ { internalType: "uint256[]", name: "balances", type: "uint256[]" },
+ { internalType: "uint256", name: "lastChangeBlock", type: "uint256" },
+ {
+ internalType: "uint256",
+ name: "protocolSwapFeePercentage",
+ type: "uint256",
+ },
+ { internalType: "bytes", name: "userData", type: "bytes" },
+ ],
+ name: "queryJoin",
+ outputs: [
+ { internalType: "uint256", name: "bptOut", type: "uint256" },
+ { internalType: "uint256[]", name: "amountsIn", type: "uint256[]" },
+ ],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "contract IERC20", name: "token", type: "address" },
+ { internalType: "bytes", name: "poolConfig", type: "bytes" },
+ ],
+ name: "setAssetManagerPoolConfig",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "uint256", name: "swapFeePercentage", type: "uint256" },
+ ],
+ name: "setSwapFeePercentage",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "symbol",
+ outputs: [{ internalType: "string", name: "", type: "string" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "totalSupply",
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "address", name: "recipient", type: "address" },
+ { internalType: "uint256", name: "amount", type: "uint256" },
+ ],
+ name: "transfer",
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ { internalType: "address", name: "sender", type: "address" },
+ { internalType: "address", name: "recipient", type: "address" },
+ { internalType: "uint256", name: "amount", type: "uint256" },
+ ],
+ name: "transferFrom",
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "unpause",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "updateProtocolFeePercentageCache",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "version",
+ outputs: [{ internalType: "string", name: "", type: "string" }],
+ stateMutability: "view",
+ type: "function",
+ },
+];
From 57b1cafe2ff0cd19376bb64af18837278cfe2e0c Mon Sep 17 00:00:00 2001
From: zekraken
Date: Sun, 23 Apr 2023 22:08:01 -0400
Subject: [PATCH 7/9] update firebase
---
firebase.json | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/firebase.json b/firebase.json
index e782939..cd83b60 100644
--- a/firebase.json
+++ b/firebase.json
@@ -1,10 +1,16 @@
{
"hosting": {
- "public": "public",
+ "public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
+ ],
+ "rewrites": [
+ {
+ "source": "**",
+ "destination": "/index.html"
+ }
]
}
-}
+}
\ No newline at end of file
From 04d8087b602f8d109fc8bc79cdb998268ad38d0b Mon Sep 17 00:00:00 2001
From: zekraken
Date: Sun, 23 Apr 2023 22:17:59 -0400
Subject: [PATCH 8/9] update firebase
---
.firebaserc | 5 +++++
firebase.json | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
create mode 100644 .firebaserc
diff --git a/.firebaserc b/.firebaserc
new file mode 100644
index 0000000..1ecb211
--- /dev/null
+++ b/.firebaserc
@@ -0,0 +1,5 @@
+{
+ "projects": {
+ "default": "pool-creator"
+ }
+}
diff --git a/firebase.json b/firebase.json
index cd83b60..340ed5b 100644
--- a/firebase.json
+++ b/firebase.json
@@ -13,4 +13,4 @@
}
]
}
-}
\ No newline at end of file
+}
From b35b45cd353210f2d3650e9f27039c967bbb40dc Mon Sep 17 00:00:00 2001
From: zekraken
Date: Sun, 23 Apr 2023 22:57:41 -0400
Subject: [PATCH 9/9] update
---
src/App.js | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/App.js b/src/App.js
index 753b180..caf01c6 100644
--- a/src/App.js
+++ b/src/App.js
@@ -21,9 +21,9 @@ function App() {
const [walletAddress, setWalletAddress] = useState();
const [buttonText, setButtonText] = useState("Connect Wallet");
const [network, setNetwork] = useState();
- const [poolName, setPoolName] = useState("test");
- const [poolSymbol, setPoolSymbol] = useState("test");
- const [swapFeePercentage, setSwapFeePercentage] = useState("0.01");
+ const [poolName, setPoolName] = useState();
+ const [poolSymbol, setPoolSymbol] = useState();
+ const [swapFeePercentage, setSwapFeePercentage] = useState();
const [ownerAddress, setOwnerAddress] = useState(
"0xba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b"
);
@@ -363,8 +363,11 @@ function App() {
- Wallet Address: {walletAddress.substring(0, 6)}...
- {walletAddress.substring(walletAddress.length - 6)}
+ Wallet Address:{" "}
+ {walletAddress &&
+ `${walletAddress.substring(0, 6)}...${walletAddress.substring(
+ walletAddress.length - 6
+ )}`}
Network: {network}