Skip to content

Commit

Permalink
Merge pull request #3 from agencyenterprise/feat/liquidity-pool-page
Browse files Browse the repository at this point in the history
Feat/liquidity pool page
  • Loading branch information
Peixer authored Jan 20, 2024
2 parents 76e1c01 + 4b718d2 commit 1341c60
Show file tree
Hide file tree
Showing 24 changed files with 261 additions and 146 deletions.
2 changes: 1 addition & 1 deletion contracts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[workspace]

resolver = "1"
members = ["src/zkdex"]
members = ["src/zkramp"]
2 changes: 0 additions & 2 deletions contracts/deployments/zkdex/alephzero-testnet.ts

This file was deleted.

1 change: 0 additions & 1 deletion contracts/deployments/zkdex/zkdex.contract

This file was deleted.

2 changes: 2 additions & 0 deletions contracts/deployments/zkramp/alephzero-testnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const address = '5GbSCJukgyAkVeYdTTDiw4mbTFQP9wKPQ5WhDgHf7NyY9QYA'
export const blockNumber = 52340496
1 change: 1 addition & 0 deletions contracts/deployments/zkramp/zkramp.contract

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": {
"hash": "0x074d82affe64989a4853b3c7f6f674bc6f13efe2d0aa5124d9ea7a2397f06b55",
"hash": "0xbeb1e9fbf9704c76b0ab5f89ded6bbfff2c3047cb6addec24ad9e3c108ccee8d",
"language": "ink! 4.3.0",
"compiler": "rustc 1.75.0",
"build_info": {
Expand All @@ -14,10 +14,10 @@
}
},
"contract": {
"name": "zkdex",
"name": "zkramp",
"version": "0.0.1",
"authors": [
"AE Studio<hello@scio.xyz>"
"AE Studio<hello@ae.studio>"
]
},
"spec": {
Expand All @@ -26,7 +26,7 @@
"args": [],
"default": false,
"docs": [
"Create new instance of ZKDex contract."
"Create new instance of ZKRamp contract."
],
"label": "default",
"payable": false,
Expand Down Expand Up @@ -382,7 +382,7 @@
{
"layout": {
"leaf": {
"key": "0x73f77d47",
"key": "0xa4ec08fe",
"ty": 0
}
},
Expand All @@ -391,7 +391,7 @@
{
"layout": {
"leaf": {
"key": "0x73f77d47",
"key": "0xa4ec08fe",
"ty": 1
}
},
Expand All @@ -400,7 +400,7 @@
{
"layout": {
"leaf": {
"key": "0x73f77d47",
"key": "0xa4ec08fe",
"ty": 4
}
},
Expand All @@ -409,7 +409,7 @@
{
"layout": {
"leaf": {
"key": "0x73f77d47",
"key": "0xa4ec08fe",
"ty": 4
}
},
Expand All @@ -418,7 +418,7 @@
{
"layout": {
"enum": {
"dispatchKey": "0x73f77d47",
"dispatchKey": "0xa4ec08fe",
"name": "OrderStatus",
"variants": {
"0": {
Expand All @@ -441,7 +441,7 @@
{
"layout": {
"leaf": {
"key": "0x73f77d47",
"key": "0xa4ec08fe",
"ty": 5
}
},
Expand All @@ -450,7 +450,7 @@
{
"layout": {
"leaf": {
"key": "0x73f77d47",
"key": "0xa4ec08fe",
"ty": 5
}
},
Expand All @@ -459,7 +459,7 @@
{
"layout": {
"leaf": {
"key": "0x73f77d47",
"key": "0xa4ec08fe",
"ty": 0
}
},
Expand All @@ -469,7 +469,7 @@
"name": "Order"
}
},
"root_key": "0x73f77d47"
"root_key": "0xa4ec08fe"
}
},
"name": "orders"
Expand All @@ -483,7 +483,7 @@
{
"layout": {
"leaf": {
"key": "0x4b32d86a",
"key": "0x6126ac8a",
"ty": 1
}
},
Expand All @@ -492,7 +492,7 @@
{
"layout": {
"leaf": {
"key": "0x4b32d86a",
"key": "0x6126ac8a",
"ty": 0
}
},
Expand All @@ -501,7 +501,7 @@
{
"layout": {
"enum": {
"dispatchKey": "0x4b32d86a",
"dispatchKey": "0x6126ac8a",
"name": "ClaimStatus",
"variants": {
"0": {
Expand All @@ -528,7 +528,7 @@
{
"layout": {
"leaf": {
"key": "0x4b32d86a",
"key": "0x6126ac8a",
"ty": 4
}
},
Expand All @@ -538,7 +538,7 @@
"name": "OrderClaim"
}
},
"root_key": "0x4b32d86a"
"root_key": "0x6126ac8a"
}
},
"name": "orders_claim"
Expand All @@ -562,7 +562,7 @@
"name": "owner"
}
],
"name": "ZKDex"
"name": "ZKRamp"
}
},
"root_key": "0x00000000"
Expand Down Expand Up @@ -803,8 +803,8 @@
}
},
"path": [
"zkdex",
"zkdex",
"zkramp",
"zkramp",
"Order"
]
}
Expand All @@ -831,8 +831,8 @@
}
},
"path": [
"zkdex",
"zkdex",
"zkramp",
"zkramp",
"OrderStatus"
]
}
Expand Down Expand Up @@ -919,8 +919,8 @@
}
},
"path": [
"zkdex",
"zkdex",
"zkramp",
"zkramp",
"OrderClaim"
]
}
Expand Down Expand Up @@ -951,8 +951,8 @@
}
},
"path": [
"zkdex",
"zkdex",
"zkramp",
"zkramp",
"ClaimStatus"
]
}
Expand Down Expand Up @@ -1243,8 +1243,8 @@
}
},
"path": [
"zkdex",
"zkdex",
"zkramp",
"zkramp",
"EscrowError"
]
}
Expand Down
Binary file not shown.
6 changes: 3 additions & 3 deletions contracts/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ set -eu
# This is kind of a hack to prevent a nasty Next.js error when running the frontend
# for the first time after deploying to a local node which forces to clear `frontend/.next`.

if [[ ! -e deployments/zkdex/development.ts ]]; then
if [[ ! -e deployments/zkramp/development.ts ]]; then
echo "Creating empty 'development.ts'…"
if command -v touch &> /dev/null; then
touch deployments/zkdex/development.ts
touch deployments/zkramp/development.ts
else
copy /b deployments/zkdex/development.ts +,,
copy /b deployments/zkramp/development.ts +,,
fi
else
echo "Great, 'development.ts' already exists! Skipping…"
Expand Down
10 changes: 5 additions & 5 deletions contracts/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { writeContractAddresses } from '@/utils/writeContractAddresses'
import { deployContract } from '@scio-labs/use-inkathon/helpers'

/**
* Script that deploys the zkdex contract and writes its address to a file.
* Script that deploys the zkramp contract and writes its address to a file.
*
* Parameters:
* - `DIR`: Directory to read contract build artifacts & write addresses to (optional, defaults to `./deployments`)
Expand All @@ -18,13 +18,13 @@ const main = async () => {
const initParams = await initPolkadotJs()
const { api, chain, account } = initParams

// Deploy zkdex contract
const { abi, wasm } = await getDeploymentData('zkdex')
const zkdex = await deployContract(api, account, abi, wasm, 'default', [])
// Deploy zkramp contract
const { abi, wasm } = await getDeploymentData('zkramp')
const zkramp = await deployContract(api, account, abi, wasm, 'default', [])

// Write contract addresses to `{contract}/{network}.ts` file(s)
await writeContractAddresses(chain.network, {
zkdex,
zkramp,
})
}

Expand Down
6 changes: 3 additions & 3 deletions contracts/scripts/script.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@scio-labs/use-inkathon/helpers'

/**
* Example script that updates & reads a message from a zkdex contract.
* Example script that updates & reads a message from a zkramp contract.
* Can be used as a template for other scripts.
*
* Parameters:
Expand All @@ -23,8 +23,8 @@ import {
const main = async () => {
const { api, account } = await initPolkadotJs()

// Deploy zkdex contract
const { abi, wasm } = await getDeploymentData('zkdex')
// Deploy zkramp contract
const { abi, wasm } = await getDeploymentData('zkramp')
const { address } = await deployContract(api, account, abi, wasm, 'default', [])
const contract = new ContractPromise(api, abi, address)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "zkdex"
name = "zkramp"
version = "0.0.1"
authors = ["AE Studio<hello@scio.xyz>"]
authors = ["AE Studio<hello@ae.studio>"]
edition = "2021"

[dependencies]
Expand All @@ -13,7 +13,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }

[lib]
path = "zkdex.rs"
path = "zkramp.rs"

[features]
default = ["std"]
Expand Down
Loading

0 comments on commit 1341c60

Please sign in to comment.