Skip to content

Commit

Permalink
Script Set-up Testnet (#34)
Browse files Browse the repository at this point in the history
* set-up testnet

* remove unused file

* move file

* fix param amm

* Fix Create Pool

* remove debug

---------

Co-authored-by: Ha Quang Minh <[email protected]>
  • Loading branch information
ljttl3q04t and m1n999999 authored Jun 19, 2024
1 parent 7479364 commit f090d77
Show file tree
Hide file tree
Showing 15 changed files with 748 additions and 776 deletions.
78 changes: 58 additions & 20 deletions amm-plutus.json

Large diffs are not rendered by default.

807 changes: 116 additions & 691 deletions amm-plutus.ts

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions lbe-v2-script.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/lb_v2/utils.ak
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ pub const amm_factory_auth_asset_name = #"4d5346"
pub const amm_pool_auth_asset_name = #"4d5350"

pub const amm_authen_policy_id =
#"4579ebf5c76b30a8b23e9e94790d0d86fe4b693a94669a66ed91cf4e"
#"d6aae2059baee188f74917493cf7637e679cd219bdfbbf4dcbeb1d0b"

pub const amm_pool_validation_hash =
#"7a277b0dd0cfffdeaee4b58df515cd57f49636750a54773b4f0b2b14"
#"d6ba9b7509eac866288ff5072d2a18205ac56f744bc82dcd808cb8fe"

pub const default_burn_liquidity = 10

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"collect-validators": "bun run src/setup.ts collect-validators",
"check": "aiken build && bun gen-plutus && bun init-params && bun collect-validators && bun test",
"format": "bun prettier --w src/* --print-width 80",
"test:init-factory": "aiken build -t verbose && bun gen-plutus && bun test init-factory"
"test:init-factory": "aiken build -t verbose && bun gen-plutus && bun test init-factory",
"setup-testnet": "aiken build && bun gen-plutus && bun run src/cmd/set-up.ts"
},
"main": "./build/index.js",
"module": "./build/index.es.js",
Expand Down
26 changes: 26 additions & 0 deletions params.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
{
"minswap": {
"poolStakeCredential": {
"type": "Key",
"hash": "83ec96719dc0591034b78e472d6f477446261fec4bc517fa4d047f02"
},
"seedOutRef": {
"txHash": "66e05b2723f9fca69601771bf8bda0ff6281945a2340191e04ca3954d6cf3f03",
"outputIndex": 2
},
"authenRef": {
"txHash": "c429b8ee27e5761ba8714e26e3a5899886cd28d136d43e969d4bc1acf0f72d4a",
"outputIndex": 0
},
"factoryRef": {
"txHash": "9741d59656e9ad54f197b0763482eede9a6fa1616c4547797eee6617f92a1396",
"outputIndex": 0
},
"poolRef": {
"txHash": "9f30b1c3948a009ceebda32d0b1d25699674b2eaf8b91ef029a43bfc1073ce28",
"outputIndex": 0
},
"poolBatchingRef": {
"txHash": "b0a6c5512735c7a183a167eed035ac75c191d6ff5be9736dfa1f1f02f7ae5dbc",
"outputIndex": 0
}
},
"seedOutRef": {
"txHash": "5428517bd92102ce1af705f8b66560d445e620aead488b47fb824426484912f8",
"outputIndex": 1
Expand Down
4 changes: 2 additions & 2 deletions plutus.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plutus.ts

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions src/build-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
TREASURY_MIN_ADA,
} from "./constants";
import type {
DeployMinswapValidators,
DeployedValidators,
MinswapValidators,
Validators,
Expand Down Expand Up @@ -77,7 +78,7 @@ export type WarehouseBuilderOptions = {
validators: Validators;
deployedValidators: DeployedValidators;
ammValidators: MinswapValidators;
ammDeployedValidators: DeployedValidators;
ammDeployedValidators: DeployMinswapValidators;
};

export type BuildInitFactoryOptions = {
Expand Down Expand Up @@ -235,7 +236,7 @@ export class WarehouseBuilder {

// AMM
ammValidators: MinswapValidators;
ammDeployedValidators: DeployedValidators;
ammDeployedValidators: DeployMinswapValidators;
ammFactoryAddress: Address;
ammPoolAddress: Address;
ammAuthenHash: string;
Expand Down Expand Up @@ -307,9 +308,7 @@ export class WarehouseBuilder {
this.ammFactoryAddress = t.utils.validatorToAddress(
ammValidators.factoryValidator,
);
this.ammPoolAddress = t.utils.validatorToAddress(
ammValidators.poolValidator,
);
this.ammPoolAddress = ammValidators.poolAddress;
this.ammDeployedValidators = ammDeployedValidators;
this.ammAuthenHash = t.utils.validatorToScriptHash(
ammValidators.authenValidator,
Expand Down
Loading

0 comments on commit f090d77

Please sign in to comment.