Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App: next release #638

Draft
wants to merge 56 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
08a7d2e
Don’t store the demo state when DEMO_MODE is off (#627)
bpierre Dec 2, 2024
4d89832
Detect leverage in subgraph (#626)
bpierre Dec 2, 2024
40de9e6
Panda config: extract styles from the css prop
bpierre Dec 2, 2024
3fc5f23
Merge branch 'main' into next
bpierre Dec 2, 2024
94ba371
App: add a flavor tag in the top banner (#631)
bpierre Dec 3, 2024
9040929
App env.ts minor tweaks + add "use client"
bpierre Dec 3, 2024
e9a297d
Subgraph deployment script: add sepolia-preview preset
bpierre Dec 3, 2024
449a055
Subgraph: remove reference to lastTroveIdByCollateral
bpierre Dec 3, 2024
96f88aa
Merge branch 'main' into next
bpierre Dec 3, 2024
882277c
Merge branch 'main' into next
bpierre Dec 4, 2024
ec15af8
Price fetching strategy update (#636)
bpierre Dec 5, 2024
7e72170
Fix the VERCEL_ANALYTICS error message (#637)
bpierre Dec 5, 2024
0f8af00
UI kit: add the "use client" directive to components (#639)
bpierre Dec 5, 2024
91a1d3c
Improve tx flow error box (#641)
bpierre Dec 6, 2024
5f98850
Fix + improve the loan closing flow for redeemed loans (#642)
bpierre Dec 7, 2024
846cbb2
Merge branch 'main' into next
bpierre Dec 7, 2024
608c664
Simplify useDebouncedQueryKey() to avoid useEffect()
bpierre Dec 9, 2024
4212761
Loan Screen: fully redeemed state (#643)
bpierre Dec 9, 2024
db46d93
TS fixes
bpierre Dec 9, 2024
d08f424
Leverage: slippage calculation improvements (#644)
bpierre Dec 9, 2024
2944a98
About Modal (#647)
bpierre Dec 10, 2024
9d75c61
deployment-manifest-to-app-env: remove interestRouter from the contra…
bpierre Dec 10, 2024
67beaae
About modal: tweak logo animation
bpierre Dec 10, 2024
bebe21e
Tweak Screen transition
bpierre Dec 10, 2024
e8d4ebf
Transaction screen: fix the loading state of the loan summary card
bpierre Dec 12, 2024
b142d12
Various UI tweaks (#653)
bpierre Dec 13, 2024
dcc0346
Merge branch 'main' into next
bpierre Dec 14, 2024
8eb5da7
Manifest to app env script: add governance contracts (#650)
bpierre Dec 14, 2024
6aa7a4d
Merge branch 'next' of github.com:liquity/bold into next
bpierre Dec 14, 2024
111a0bf
Update deployment-artifacts-to-app-env.ts for the new manifest format…
bpierre Dec 14, 2024
1c38eed
Merge branch 'main' into next
bpierre Dec 17, 2024
18d22aa
Blocking mechanism (#658)
bpierre Dec 17, 2024
3ff8976
Merge branch 'main' into next
bpierre Dec 17, 2024
d504a93
ProtocolStats: use Link for the account button
bpierre Dec 17, 2024
07e5cf7
Formatting
bpierre Dec 17, 2024
ef789e0
Stake screen: do not scroll on tab change
bpierre Dec 17, 2024
216e13e
Merge branch 'main' into next
bpierre Dec 19, 2024
c5f2089
Improve the env parsing errors (#660)
bpierre Dec 19, 2024
713d043
Subgraph: udpate Governance (#661)
bpierre Dec 19, 2024
1d66bfb
Merge branch 'main' into next
bpierre Dec 19, 2024
6142929
chore: get Governance ABI from forge output
danielattilasimon Dec 20, 2024
41e276c
feat: track voting power in subgraph
danielattilasimon Dec 20, 2024
689e49c
App: Error + Not Found Screen (#665)
bpierre Dec 20, 2024
0860975
Chore/multiply (#663)
ColinPlatt Dec 20, 2024
4e6cf2d
Updated tx flow declaration format + updated governance txes (#652)
bpierre Dec 20, 2024
f670d7d
tsconfig: noUncheckedIndexedAccess (#667)
bpierre Dec 20, 2024
586470f
TransactionScreen loan card: remove icon color
bpierre Dec 20, 2024
d69b502
Add missing subgraph query
bpierre Dec 20, 2024
ead393a
Voting panel: allow partial allocation (#668)
bpierre Dec 20, 2024
78fda1e
Dynamic epoch duration (#669)
bpierre Dec 20, 2024
a9a00ba
Add a title attribute to show the exact end time for the current epoc…
bpierre Dec 20, 2024
701bfb8
Voting panel: various improvements
bpierre Dec 20, 2024
4b8cb77
Merge branch 'next' into subgraph-voting-power
bpierre Dec 20, 2024
c670662
App: show live voting power
bpierre Dec 20, 2024
194d3fa
Merge pull request #664 from liquity/subgraph-voting-power
danielattilasimon Dec 22, 2024
43c4278
Merge pull request #672 from liquity/app-voting-power
danielattilasimon Dec 22, 2024
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
43 changes: 40 additions & 3 deletions contracts/utils/deployment-manifest-to-app-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,23 @@ const argv = minimist(process.argv.slice(2), {
],
});

const ZERO_ADDRESS = "0x" + "0".repeat(40);

const ZAddress = z.string().regex(/^0x[0-9a-fA-F]{40}$/);
const ZDeploymentManifest = z.object({
collateralRegistry: ZAddress,
boldToken: ZAddress,
hintHelpers: ZAddress,
multiTroveGetter: ZAddress,
exchangeHelpers: ZAddress,

governance: z.object({
LQTYToken: ZAddress,
LQTYStaking: ZAddress.default(ZERO_ADDRESS),
governance: ZAddress,
uniV4DonationsInitiative: ZAddress,
curveV2GaugeRewardsInitiative: ZAddress,
}),

branches: z.array(
z.object({
Expand All @@ -46,7 +57,6 @@ const ZDeploymentManifest = z.object({
collToken: ZAddress,
defaultPool: ZAddress,
gasPool: ZAddress,
interestRouter: ZAddress,
leverageZapper: ZAddress,
metadataNFT: ZAddress,
priceFeed: ZAddress,
Expand Down Expand Up @@ -128,7 +138,7 @@ function deployedContractsToAppEnvVariables(manifest: DeploymentManifest) {
NEXT_PUBLIC_CONTRACT_WETH: manifest.branches[0].collToken,
};

const { branches, ...protocol } = manifest;
const { branches, governance, ...protocol } = manifest;

// protocol contracts
for (const [contractName, address] of Object.entries(protocol)) {
Expand All @@ -138,7 +148,7 @@ function deployedContractsToAppEnvVariables(manifest: DeploymentManifest) {
}
}

// collateral contracts
// branches contracts
for (const [index, contract] of Object.entries(branches)) {
for (const [contractName, address] of Object.entries(contract)) {
const envVarName = contractNameToAppEnvVariable(contractName, `COLL_${index}_CONTRACT`);
Expand All @@ -148,6 +158,17 @@ function deployedContractsToAppEnvVariables(manifest: DeploymentManifest) {
}
}

// governance contracts
for (const [contractName, address] of Object.entries(governance)) {
const envVarName = contractNameToAppEnvVariable(
contractName,
contractName.endsWith("Initiative") ? "INITIATIVE" : "CONTRACT",
);
if (envVarName) {
appEnvVariables[envVarName] = address;
}
}

return appEnvVariables;
}

Expand All @@ -163,6 +184,8 @@ function contractNameToAppEnvVariable(contractName: string, prefix: string = "")
return `${prefix}_HINT_HELPERS`;
case "multiTroveGetter":
return `${prefix}_MULTI_TROVE_GETTER`;
case "exchangeHelpers":
return `${prefix}_EXCHANGE_HELPERS`;

// collateral contracts
case "activePool":
Expand All @@ -189,6 +212,20 @@ function contractNameToAppEnvVariable(contractName: string, prefix: string = "")
return `${prefix}_TROVE_MANAGER`;
case "troveNFT":
return `${prefix}_TROVE_NFT`;

// governance contracts
case "LQTYToken":
return `${prefix}_LQTY_TOKEN`;
case "LQTYStaking":
return `${prefix}_LQTY_STAKING`;
case "governance":
return `${prefix}_GOVERNANCE`;

// governance initiatives
case "uniV4DonationsInitiative":
return `${prefix}_UNI_V4_DONATIONS`;
case "curveV2GaugeRewardsInitiative":
return `${prefix}_CURVE_V2_GAUGE_REWARDS`;
}
return null;
}
Expand Down
13 changes: 13 additions & 0 deletions frontend/app/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
NEXT_PUBLIC_DEMO_MODE=false
NEXT_PUBLIC_VERCEL_ANALYTICS=false
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=1
# NEXT_PUBLIC_DEPLOYMENT_FLAVOR=

# use demo|API_KEY (demo API) or pro|API_KEY (pro API)
NEXT_PUBLIC_COINGECKO_API_KEY=

# the BLOCKING_LIST contract must implement isBlackListed(address)(bool)
# NEXT_PUBLIC_BLOCKING_LIST=0x97044531D0fD5B84438499A49629488105Dc58e6

# format: {vpnapi.io key}|{comma separated country codes} e.g. 1234|US,CA
# NEXT_PUBLIC_BLOCKING_VPNAPI=

# Ethereum (mainnet)
# NEXT_PUBLIC_CHAIN_ID=1
Expand All @@ -11,6 +21,8 @@ NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=1
# NEXT_PUBLIC_CHAIN_CONTRACT_ENS_REGISTRY=0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e
# NEXT_PUBLIC_CHAIN_CONTRACT_ENS_RESOLVER=0xce01f8eee7E479C928F8919abD53E553a36CeF67|19258213
# NEXT_PUBLIC_CHAIN_CONTRACT_MULTICALL=0xca11bde05977b3631167028862be2a173976ca11|14353601
# NEXT_PUBLIC_LIQUITY_STATS_URL=
# NEXT_PUBLIC_KNOWN_INITIATIVES_URL=

# Hardhat / Anvil (local)
# NEXT_PUBLIC_CHAIN_ID=31337
Expand All @@ -25,6 +37,7 @@ NEXT_PUBLIC_CHAIN_CURRENCY=Ether|ETH|18
NEXT_PUBLIC_CHAIN_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com
NEXT_PUBLIC_CHAIN_BLOCK_EXPLORER=Etherscan Sepolia|https://sepolia.etherscan.io/
NEXT_PUBLIC_CHAIN_CONTRACT_MULTICALL=0xcA11bde05977b3631167028862bE2a173976CA11
NEXT_PUBLIC_KNOWN_INITIATIVES_URL=https://liquity2-sepolia.vercel.app/known-initiatives/sepolia.json
NEXT_PUBLIC_LIQUITY_STATS_URL=https://api.liquity.org/v2/testnet/sepolia.json
NEXT_PUBLIC_SUBGRAPH_URL=https://api.studio.thegraph.com/query/42403/liquity2-sepolia/version/latest

Expand Down
13 changes: 13 additions & 0 deletions frontend/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,17 @@ export default withBundleAnalyzer({
eslint: {
ignoreDuringBuilds: true,
},
async headers() {
return [
{
source: "/known-initiatives/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" },
{ key: "Access-Control-Allow-Methods", value: "GET,OPTIONS" },
{ key: "Access-Control-Allow-Headers", value: "Origin, Content-Type, Accept" },
],
},
];
},
});
1 change: 1 addition & 0 deletions frontend/app/panda.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { defineConfig, defineGlobalStyles, definePreset } from "@pandacss/dev";

export default defineConfig({
preflight: true, // CSS reset
jsxFramework: "react", // needed for panda to extract props named `css`
presets: [
liquityUiKitPreset as Preset, // `as Preset` prevents a type error: "Expression produces a union type that is too complex to represent."
definePreset({
Expand Down
3 changes: 1 addition & 2 deletions frontend/app/scripts/update-liquity-abis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ async function main() {

await Promise.all(ABIS.map(async (possibleNames) => {
const abiName = possibleNames[0];

const abi = await readJsonFromDir(`${artifactsTmpDir}`, possibleNames);

if (!abi) {
if (!abi || !abiName) {
throw new Error(`Could not find ABI for ${possibleNames.join(", ")}`);
}

Expand Down
39 changes: 39 additions & 0 deletions frontend/app/src/abi/Erc2612.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { erc20Abi } from "viem";

// https://eips.ethereum.org/EIPS/eip-2612
const permitAbiExtension = [
{
name: "permit",
type: "function",
stateMutability: "nonpayable",
inputs: [
{ name: "owner", type: "address" },
{ name: "spender", type: "address" },
{ name: "value", type: "uint256" },
{ name: "deadline", type: "uint256" },
{ name: "v", type: "uint8" },
{ name: "r", type: "bytes32" },
{ name: "s", type: "bytes32" },
],
outputs: [],
},
{
name: "nonces",
type: "function",
stateMutability: "view",
inputs: [{ name: "owner", type: "address" }],
outputs: [{ type: "uint256" }],
},
{
name: "DOMAIN_SEPARATOR",
type: "function",
stateMutability: "view",
inputs: [],
outputs: [{ type: "bytes32" }],
},
] as const;

export default [
...erc20Abi,
...permitAbiExtension,
] as const;
Loading
Loading