mirror of
https://github.com/alexgo-io/alex-dao.git
synced 2026-04-30 20:51:49 +08:00
agp002 updated / clarinet test set up and passes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "executor-dao"
|
||||
requirements = []
|
||||
costs_version = 2
|
||||
costs_version = 1
|
||||
|
||||
[contracts.age000-governance-token]
|
||||
path = "contracts/extensions/age000-governance-token.clar"
|
||||
|
||||
2
alex-v1
2
alex-v1
Submodule alex-v1 updated: ff9d74723f...8f3a92deb5
@@ -64,7 +64,10 @@
|
||||
;; --- Bootstrap
|
||||
|
||||
(define-public (construct (proposal <proposal-trait>))
|
||||
(let ((sender tx-sender))
|
||||
(let
|
||||
(
|
||||
(sender tx-sender)
|
||||
)
|
||||
(asserts! (is-eq sender (var-get executive)) err-unauthorised)
|
||||
(var-set executive (as-contract tx-sender))
|
||||
(as-contract (execute proposal sender))
|
||||
|
||||
@@ -269,6 +269,7 @@
|
||||
(burn (fixed-to-decimals amount) sender)
|
||||
)
|
||||
|
||||
;; for testing only
|
||||
(map-set approved-contracts .alex-reserve-pool true)
|
||||
(map-set approved-contracts .exchange true)
|
||||
(map-set approved-contracts .faucet true)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
(impl-trait .extension-trait.extension-trait)
|
||||
(use-trait proposal-trait .proposal-trait.proposal-trait)
|
||||
|
||||
(define-data-var emergency-proposal-duration uint u144) ;; ~1 day
|
||||
(define-data-var emergency-proposal-duration uint u1440) ;; ~10 day
|
||||
(define-data-var emergency-team-sunset-height uint (+ block-height u26280)) ;; ~6 months from deploy time
|
||||
|
||||
(define-constant err-unauthorised (err u3000))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
;; Title: EDP000 Bootstrap
|
||||
|
||||
;; Author: Marvin Janssen
|
||||
;; Synopsis:
|
||||
;; Boot proposal that sets the governance token, DAO parameters, and extensions, and
|
||||
@@ -24,32 +24,18 @@
|
||||
))
|
||||
|
||||
;; Set emergency team members.
|
||||
(try! (contract-call? .age002-emergency-proposals set-emergency-team-member 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM true))
|
||||
(try! (contract-call? .age002-emergency-proposals set-emergency-team-member 'ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5 true))
|
||||
(try! (contract-call? .age002-emergency-proposals set-emergency-team-member 'ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE true))
|
||||
(try! (contract-call? .age002-emergency-proposals set-emergency-team-sunset-height (+ block-height u26280))) ;; ~6 months
|
||||
(try! (contract-call? .age002-emergency-proposals set-emergency-proposal-duration u1440)) ;; ~10 days
|
||||
|
||||
;; Set executive team members.
|
||||
(try! (contract-call? .age003-emergency-execute set-executive-team-member 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM true))
|
||||
(try! (contract-call? .age003-emergency-execute set-executive-team-member 'ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5 true))
|
||||
(try! (contract-call? .age003-emergency-execute set-executive-team-member 'ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG true))
|
||||
(try! (contract-call? .age003-emergency-execute set-executive-team-member 'ST2JHG361ZXG51QTKY2NQCVBPPRRE2KZB1HR05NNC true))
|
||||
(try! (contract-call? .age003-emergency-execute set-signals-required u3)) ;; signal from 3 out of 4 team members requied.
|
||||
|
||||
;; Mint initial token supply.
|
||||
(try! (contract-call? .age000-governance-token edg-mint-many
|
||||
(list
|
||||
{amount: u1000, recipient: sender}
|
||||
{amount: u1000, recipient: 'ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5}
|
||||
{amount: u1000, recipient: 'ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG}
|
||||
{amount: u1000, recipient: 'ST2JHG361ZXG51QTKY2NQCVBPPRRE2KZB1HR05NNC}
|
||||
{amount: u1000, recipient: 'ST2NEB84ASENDXKYGJPQW86YXQCEFEX2ZQPG87ND}
|
||||
{amount: u1000, recipient: 'ST2REHHS5J3CERCRBEPMGH7921Q6PYKAADT7JP2VB}
|
||||
{amount: u1000, recipient: 'ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0}
|
||||
{amount: u1000, recipient: 'ST3NBRSFKX28FQ2ZJ1MAKX58HKHSDGNV5N7R21XCP}
|
||||
{amount: u1000, recipient: 'ST3PF13W7Z0RRM42A8VZRVFQ75SV1K26RXEP8YGKJ}
|
||||
{amount: u1000, recipient: 'STNHKEPYEPJ8ET55ZZ0M5A34J0R3N5FM2CMMMAZ6}
|
||||
)
|
||||
))
|
||||
(try! (contract-call? .age003-emergency-execute set-executive-team-member 'ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE true))
|
||||
(try! (contract-call? .age003-emergency-execute set-signals-required u1))
|
||||
(try! (contract-call? .age003-emergency-execute set-executive-team-sunset-height (+ block-height u13140))) ;; ~3 months
|
||||
|
||||
;; Set approved-contracts to governance token
|
||||
(try! (contract-call? .age000-governance-token edg-add-approved-contract .alex-reserve-pool))
|
||||
|
||||
(print "ALEX DAO has risen.")
|
||||
(ok true)
|
||||
)
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
(impl-trait .proposal-trait.proposal-trait)
|
||||
|
||||
(define-constant fee-to-address .alex-vault)
|
||||
(define-constant amount-per-ticket u0) ;; number of $ALEX per IDO ticket
|
||||
(define-constant wstx-per-ticket-in-fixed u0) ;; STX required per IDO ticket (in 8-digit fixed notation)
|
||||
(define-constant tickets u0) ;; total number of IDO tickets to win $ALEX
|
||||
(define-constant registration-start u0) ;; block-height when registration opens
|
||||
(define-constant registration-end u0) ;; block-height when registration closes / claim opens
|
||||
(define-constant claim-end u0) ;; block-height when claim ends
|
||||
(define-constant activation-threshold u0) ;; minimum number of IDO tickets to be registered before listing activates
|
||||
(define-constant fee-to-address .executor-dao)
|
||||
(define-constant amount-per-ticket u1) ;; number of $ALEX per IDO ticket
|
||||
(define-constant wstx-per-ticket-in-fixed u100000000) ;; STX required per IDO ticket (in 8-digit fixed notation)
|
||||
(define-constant tickets u1) ;; total number of IDO tickets to win $ALEX
|
||||
(define-constant registration-start (+ block-height u100)) ;; block-height when registration opens
|
||||
(define-constant registration-end (+ block-height u200)) ;; block-height when registration closes / claim opens
|
||||
(define-constant claim-end (+ block-height u300)) ;; block-height when claim ends
|
||||
(define-constant activation-threshold u1) ;; minimum number of IDO tickets to be registered before listing activates
|
||||
|
||||
(define-constant ONE_8 (pow u10 u8))
|
||||
|
||||
(define-public (execute (sender principal))
|
||||
(begin
|
||||
(try! (contract-call? .age000-governance-token mint-fixed (* amount-per-ticket tickets ONE_8) .executor-dao))
|
||||
(try! (contract-call? .alex-launchpad create-pool .age000-governance-token .lottery-ido-alex fee-to-address amount-per-ticket wstx-per-ticket-in-fixed registration-start registration-end claim-end activation-threshold))
|
||||
(contract-call? .alex-launchpad add-to-position .age000-governance-token tickets)
|
||||
)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/zsh
|
||||
# clarity-cli and jq required.
|
||||
cd "$(dirname "$0")"
|
||||
deployer=$(cat initial-allocations.json | jq ".[0].principal" -r)
|
||||
deploy_order=(
|
||||
# traits
|
||||
"traits/extension-trait.clar" "traits/governance-token-trait.clar" "traits/ownable-trait.clar" "traits/proposal-trait.clar" "traits/sip010-ft-trait.clar"
|
||||
# ExecutorDAO
|
||||
"executor-dao.clar"
|
||||
# Extensions
|
||||
"extensions/ede000-governance-token.clar" "extensions/ede001-proposal-voting.clar" "extensions/ede002-proposal-submission.clar" "extensions/ede003-emergency-proposals.clar" "extensions/ede004-emergency-execute.clar" "extensions/ede005-dev-fund.clar"
|
||||
# Proposals
|
||||
"proposals/edp000-bootstrap.clar" "proposals/edp001-dev-fund.clar" "proposals/edp002-kill-emergency-execute.clar"
|
||||
)
|
||||
vmstate="vmstate.db"
|
||||
|
||||
rm -rf "$vmstate"
|
||||
clarity-cli initialize --testnet initial-allocations.json "$vmstate"
|
||||
for contract in "${deploy_order[@]}"; do
|
||||
echo "LAUNCH $contract"
|
||||
clarity-cli launch "$deployer.$(basename $contract .clar)" "../contracts/$contract" "$vmstate"
|
||||
done
|
||||
echo "BOOTSTRAP"
|
||||
result=$(clarity-cli execute "$vmstate" "$deployer.executor-dao" "construct" "$deployer" "'$deployer.edp000-bootstrap")
|
||||
if [[ $(echo $result | jq ".success") == "true" ]]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAILED"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf "$vmstate"
|
||||
@@ -1,3 +0,0 @@
|
||||
[
|
||||
{"principal": "ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM", "amount": 1000000}
|
||||
]
|
||||
42
settings/Development.toml
Normal file
42
settings/Development.toml
Normal file
@@ -0,0 +1,42 @@
|
||||
[network]
|
||||
name = "Development"
|
||||
|
||||
[accounts.deployer]
|
||||
mnemonic = "fetch outside black test wash cover just actual execute nice door want airport betray quantum stamp fish act pen trust portion fatigue scissors vague"
|
||||
balance = 1_000_000
|
||||
|
||||
[accounts.wallet_1]
|
||||
mnemonic = "spoil sock coyote include verify comic jacket gain beauty tank flush victory illness edge reveal shallow plug hobby usual juice harsh pact wreck eight"
|
||||
balance = 1_000_000
|
||||
|
||||
[accounts.wallet_2]
|
||||
mnemonic = "arrange scale orient half ugly kid bike twin magnet joke hurt fiber ethics super receive version wreck media fluid much abstract reward street alter"
|
||||
balance = 1_000_000
|
||||
|
||||
[accounts.wallet_3]
|
||||
mnemonic = "glide clown kitchen picnic basket hidden asset beyond kid plug carbon talent drama wet pet rhythm hero nest purity baby bicycle ghost sponsor dragon"
|
||||
balance = 1_000_000
|
||||
|
||||
[accounts.wallet_4]
|
||||
mnemonic = "pulp when detect fun unaware reduce promote tank success lecture cool cheese object amazing hunt plug wing month hello tunnel detect connect floor brush"
|
||||
balance = 1_000_000
|
||||
|
||||
[accounts.wallet_5]
|
||||
mnemonic = "replace swing shove congress smoke banana tired term blanket nominee leave club myself swing egg virus answer bulk useful start decrease family energy february"
|
||||
balance = 1_000_000
|
||||
|
||||
[accounts.wallet_6]
|
||||
mnemonic = "apology together shy taxi glare struggle hip camp engage lion possible during squeeze hen exotic marriage misery kiwi once quiz enough exhibit immense tooth"
|
||||
balance = 1_000_000
|
||||
|
||||
[accounts.wallet_7]
|
||||
mnemonic = "antenna bitter find rely gadget father exact excuse cross easy elbow alcohol injury loud silk bird crime cabbage winter fit wide screen update october"
|
||||
balance = 1_000_000
|
||||
|
||||
[accounts.wallet_8]
|
||||
mnemonic = "east load echo merit ignore hip tag obvious truly adjust smart panther deer aisle north hotel process frown lock property catch bless notice topple"
|
||||
balance = 1_000_000
|
||||
|
||||
[accounts.wallet_9]
|
||||
mnemonic = "market ocean tortoise venue vivid coach machine category conduct enable insect jump fog file test core book chaos crucial burst version curious prosper fever"
|
||||
balance = 1_000_000
|
||||
@@ -2,77 +2,95 @@
|
||||
name = "devnet"
|
||||
|
||||
[accounts.deployer]
|
||||
mnemonic = "twice kind fence tip hidden tilt action fragile skin nothing glory cousin green tomorrow spring wrist shed math olympic multiply hip blue scout claw"
|
||||
mnemonic = "fetch outside black test wash cover just actual execute nice door want airport betray quantum stamp fish act pen trust portion fatigue scissors vague"
|
||||
balance = 100_000_000_000_000
|
||||
# secret_key: 753b7cc01a1a2e86221266a154af739463fce51219d97e4f856cd7200c3bd2a601
|
||||
# stx_address: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
||||
# stx_address: ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE
|
||||
# btc_address: mqVnk6NPRdhntvfm4hh9vvjiRkFDUuSYsH
|
||||
|
||||
[accounts.wallet_1]
|
||||
mnemonic = "sell invite acquire kitten bamboo drastic jelly vivid peace spawn twice guilt pave pen trash pretty park cube fragile unaware remain midnight betray rebuild"
|
||||
mnemonic = "spoil sock coyote include verify comic jacket gain beauty tank flush victory illness edge reveal shallow plug hobby usual juice harsh pact wreck eight"
|
||||
balance = 100_000_000_000_000
|
||||
# secret_key: 7287ba251d44a4d3fd9276c88ce34c5c52a038955511cccaf77e61068649c17801
|
||||
# stx_address: ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5
|
||||
# stx_address: ST1J4G6RR643BCG8G8SR6M2D9Z9KXT2NJDRK3FBTK
|
||||
# btc_address: mr1iPkD9N3RJZZxXRk7xF9d36gffa6exNC
|
||||
# [
|
||||
# {
|
||||
# "privateKey": "33ef2367ca0e02ba65531af2a21cf5926600bc4f950f7b34fc55ea0f893418c301",
|
||||
# "address": "ST1J4G6RR643BCG8G8SR6M2D9Z9KXT2NJDRK3FBTK",
|
||||
# "btcAddress": "mpfCFEnbtYn3QnpFmppGDiaHBqU75uYeat",
|
||||
# "wif": "KxxfU82x9WMvciCehCjWxyTziGWgDPwLZiE68LNVXe2NJcf2r38z",
|
||||
# "index": 0
|
||||
# }
|
||||
# ]
|
||||
|
||||
[accounts.wallet_2]
|
||||
mnemonic = "hold excess usual excess ring elephant install account glad dry fragile donkey gaze humble truck breeze nation gasp vacuum limb head keep delay hospital"
|
||||
mnemonic = "arrange scale orient half ugly kid bike twin magnet joke hurt fiber ethics super receive version wreck media fluid much abstract reward street alter"
|
||||
balance = 100_000_000_000_000
|
||||
# secret_key: 530d9f61984c888536871c6573073bdfc0058896dc1adfe9a6a10dfacadc209101
|
||||
# stx_address: ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG
|
||||
# btc_address: muYdXKmX9bByAueDe6KFfHd5Ff1gdN9ErG
|
||||
# [
|
||||
# {
|
||||
# "privateKey": "a8d75b0fab120c53ab0f6700378c52391863c8e197b3ff220de156ea46cdd58601",
|
||||
# "address": "ST20ATRN26N9P05V2F1RHFRV24X8C8M3W54E427B2",
|
||||
# "btcAddress": "msFLVdTCpq4ym3tbvY7M83Ui1WpSHvjYSs",
|
||||
# "wif": "L2sv6GV6p6RevgoKXYexDaiYJYHn1nQmAfRsFyMrYnHppiUrH8ip",
|
||||
# "index": 0
|
||||
# }
|
||||
# ]
|
||||
|
||||
[accounts.wallet_3]
|
||||
mnemonic = "cycle puppy glare enroll cost improve round trend wrist mushroom scorpion tower claim oppose clever elephant dinosaur eight problem before frozen dune wagon high"
|
||||
mnemonic = "glide clown kitchen picnic basket hidden asset beyond kid plug carbon talent drama wet pet rhythm hero nest purity baby bicycle ghost sponsor dragon"
|
||||
balance = 100_000_000_000_000
|
||||
# secret_key: d655b2523bcd65e34889725c73064feb17ceb796831c0e111ba1a552b0f31b3901
|
||||
# stx_address: ST2JHG361ZXG51QTKY2NQCVBPPRRE2KZB1HR05NNC
|
||||
# btc_address: mvZtbibDAAA3WLpY7zXXFqRa3T4XSknBX7
|
||||
|
||||
[accounts.wallet_4]
|
||||
mnemonic = "board list obtain sugar hour worth raven scout denial thunder horse logic fury scorpion fold genuine phrase wealth news aim below celery when cabin"
|
||||
mnemonic = "pulp when detect fun unaware reduce promote tank success lecture cool cheese object amazing hunt plug wing month hello tunnel detect connect floor brush"
|
||||
balance = 100_000_000_000_000
|
||||
# secret_key: f9d7206a47f14d2870c163ebab4bf3e70d18f5d14ce1031f3902fbbc894fe4c701
|
||||
# stx_address: ST2NEB84ASENDXKYGJPQW86YXQCEFEX2ZQPG87ND
|
||||
# btc_address: mg1C76bNTutiCDV3t9nWhZs3Dc8LzUufj8
|
||||
|
||||
[accounts.wallet_5]
|
||||
mnemonic = "hurry aunt blame peanut heavy update captain human rice crime juice adult scale device promote vast project quiz unit note reform update climb purchase"
|
||||
mnemonic = "replace swing shove congress smoke banana tired term blanket nominee leave club myself swing egg virus answer bulk useful start decrease family energy february"
|
||||
balance = 100_000_000_000_000
|
||||
# secret_key: 3eccc5dac8056590432db6a35d52b9896876a3d5cbdea53b72400bc9c2099fe801
|
||||
# stx_address: ST2REHHS5J3CERCRBEPMGH7921Q6PYKAADT7JP2VB
|
||||
# btc_address: mweN5WVqadScHdA81aATSdcVr4B6dNokqx
|
||||
|
||||
[accounts.wallet_6]
|
||||
mnemonic = "area desk dutch sign gold cricket dawn toward giggle vibrant indoor bench warfare wagon number tiny universe sand talk dilemma pottery bone trap buddy"
|
||||
mnemonic = "apology together shy taxi glare struggle hip camp engage lion possible during squeeze hen exotic marriage misery kiwi once quiz enough exhibit immense tooth"
|
||||
balance = 100_000_000_000_000
|
||||
# secret_key: 7036b29cb5e235e5fd9b09ae3e8eec4404e44906814d5d01cbca968a60ed4bfb01
|
||||
# stx_address: ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0
|
||||
# btc_address: mzxXgV6e4BZSsz8zVHm3TmqbECt7mbuErt
|
||||
|
||||
[accounts.wallet_7]
|
||||
mnemonic = "prevent gallery kind limb income control noise together echo rival record wedding sense uncover school version force bleak nuclear include danger skirt enact arrow"
|
||||
mnemonic = "antenna bitter find rely gadget father exact excuse cross easy elbow alcohol injury loud silk bird crime cabbage winter fit wide screen update october"
|
||||
balance = 100_000_000_000_000
|
||||
# secret_key: b463f0df6c05d2f156393eee73f8016c5372caa0e9e29a901bb7171d90dc4f1401
|
||||
# stx_address: ST3PF13W7Z0RRM42A8VZRVFQ75SV1K26RXEP8YGKJ
|
||||
# btc_address: n37mwmru2oaVosgfuvzBwgV2ysCQRrLko7
|
||||
|
||||
[accounts.wallet_8]
|
||||
mnemonic = "female adjust gallery certain visit token during great side clown fitness like hurt clip knife warm bench start reunion globe detail dream depend fortune"
|
||||
mnemonic = "east load echo merit ignore hip tag obvious truly adjust smart panther deer aisle north hotel process frown lock property catch bless notice topple"
|
||||
balance = 100_000_000_000_000
|
||||
# secret_key: 6a1a754ba863d7bab14adbbc3f8ebb090af9e871ace621d3e5ab634e1422885e01
|
||||
# stx_address: ST3NBRSFKX28FQ2ZJ1MAKX58HKHSDGNV5N7R21XCP
|
||||
# btc_address: n2v875jbJ4RjBnTjgbfikDfnwsDV5iUByw
|
||||
|
||||
[accounts.wallet_9]
|
||||
mnemonic = "shadow private easily thought say logic fault paddle word top book during ignore notable orange flight clock image wealth health outside kitten belt reform"
|
||||
mnemonic = "market ocean tortoise venue vivid coach machine category conduct enable insect jump fog file test core book chaos crucial burst version curious prosper fever"
|
||||
balance = 100_000_000_000_000
|
||||
# secret_key: de433bdfa14ec43aa1098d5be594c8ffb20a31485ff9de2923b2689471c401b801
|
||||
# stx_address: STNHKEPYEPJ8ET55ZZ0M5A34J0R3N5FM2CMMMAZ6
|
||||
# btc_address: mjSrB3wS4xab3kYqFktwBzfTdPg367ZJ2d
|
||||
|
||||
[devnet]
|
||||
disable_bitcoin_explorer = true
|
||||
disable_bitcoin_explorer = false
|
||||
# disable_stacks_explorer = true
|
||||
# disable_stacks_api = true
|
||||
# working_dir = "tmp/devnet"
|
||||
@@ -85,7 +103,7 @@ disable_bitcoin_explorer = true
|
||||
# bitcoin_node_username = "devnet"
|
||||
# bitcoin_node_password = "devnet"
|
||||
# bitcoin_controller_port = 18442
|
||||
# bitcoin_controller_block_time = 30_000
|
||||
# bitcoin_controller_block_time = 100
|
||||
# stacks_node_rpc_port = 20443
|
||||
# stacks_node_p2p_port = 20444
|
||||
# stacks_api_port = 3999
|
||||
|
||||
55
tests/dao_test.ts
Normal file
55
tests/dao_test.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
|
||||
const daoAddress = "ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE.executor-dao";
|
||||
const bootstrapAddress = "ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE.agp000-bootstrap";
|
||||
const agp002Address = "ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE.agp002-launchpad-alex";
|
||||
|
||||
class DAO {
|
||||
chain: Chain;
|
||||
deployer: Account;
|
||||
|
||||
constructor(chain: Chain, deployer: Account) {
|
||||
this.chain = chain;
|
||||
this.deployer = deployer;
|
||||
}
|
||||
|
||||
construct(sender: Account, contract: string) {
|
||||
let block = this.chain.mineBlock([
|
||||
Tx.contractCall("executor-dao", "construct", [
|
||||
types.principal(contract)
|
||||
], sender.address),
|
||||
]);
|
||||
return block.receipts[0].result;
|
||||
}
|
||||
|
||||
executiveAction(sender: Account, contract: string) {
|
||||
let block = this.chain.mineBlock([
|
||||
Tx.contractCall("age003-emergency-execute", "executive-action", [
|
||||
types.principal(contract)
|
||||
], sender.address),
|
||||
]);
|
||||
return block.receipts[0].result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* dao test cases
|
||||
*
|
||||
*/
|
||||
|
||||
Clarinet.test({
|
||||
name: "DAO: bootstrap",
|
||||
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let deployer = accounts.get("deployer")!;
|
||||
let DAOTest = new DAO(chain, deployer);
|
||||
|
||||
let result:any = await DAOTest.construct(deployer, bootstrapAddress);
|
||||
result.expectOk();
|
||||
|
||||
result = await DAOTest.executiveAction(deployer, agp002Address);
|
||||
result.expectOk();
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import { Clarinet, Tx, Chain, Account, types } from 'https://deno.land/x/clarinet@v0.14.0/index.ts';
|
||||
import { assertEquals } from 'https://deno.land/std@0.90.0/testing/asserts.ts';
|
||||
|
||||
Clarinet.test({
|
||||
name: "Ensure that <...>",
|
||||
async fn(chain: Chain, accounts: Map<string, Account>) {
|
||||
let block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 2);
|
||||
|
||||
block = chain.mineBlock([
|
||||
/*
|
||||
* Add transactions with:
|
||||
* Tx.contractCall(...)
|
||||
*/
|
||||
]);
|
||||
assertEquals(block.receipts.length, 0);
|
||||
assertEquals(block.height, 3);
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user