change denoms to CLR/USDC from token/stake
parent
da45a14534
commit
627308d809
36
config.yml
36
config.yml
|
@ -1,11 +1,39 @@
|
||||||
|
genesis:
|
||||||
|
app_state:
|
||||||
|
bank:
|
||||||
|
denom_metadata:
|
||||||
|
- name: Colinear
|
||||||
|
symbol: CLR
|
||||||
|
description: "Native utility coin of the Colinear blockchain"
|
||||||
|
display: clr
|
||||||
|
base: uclr
|
||||||
|
denom_units:
|
||||||
|
- denom: uclr
|
||||||
|
exponent: "0"
|
||||||
|
- denom: clr
|
||||||
|
exponent: "6"
|
||||||
|
- name: "USD Coin"
|
||||||
|
symbol: USDC
|
||||||
|
description: "Mock USDC"
|
||||||
|
display: usdc
|
||||||
|
base: uusdc
|
||||||
|
denom_units:
|
||||||
|
- denom: uusdc
|
||||||
|
exponent: "0"
|
||||||
|
- denom: usdc
|
||||||
|
exponent: "6"
|
||||||
|
staking:
|
||||||
|
params:
|
||||||
|
bond_denom: "uclr"
|
||||||
|
|
||||||
accounts:
|
accounts:
|
||||||
- name: alice
|
- name: alice
|
||||||
coins: ["20000token", "200000000stake"]
|
coins: ["20000usdc", "200000000000uclr"]
|
||||||
- name: bob
|
- name: bob
|
||||||
coins: ["10000token", "100000000stake"]
|
coins: ["10000usdc", "100000000000uclr"]
|
||||||
validator:
|
validator:
|
||||||
name: alice
|
name: alice
|
||||||
staked: "100000000stake"
|
staked: "100000000uclr"
|
||||||
client:
|
client:
|
||||||
openapi:
|
openapi:
|
||||||
path: "docs/static/openapi.yml"
|
path: "docs/static/openapi.yml"
|
||||||
|
@ -13,4 +41,4 @@ client:
|
||||||
# path: "vue/src/store"
|
# path: "vue/src/store"
|
||||||
faucet:
|
faucet:
|
||||||
name: bob
|
name: bob
|
||||||
coins: ["5token", "100000stake"]
|
coins: ["500usdc", "100000000uclr"]
|
||||||
|
|
|
@ -8,59 +8,59 @@ colineard tx colinear new-auction asdf asdf 200 token $(now + 3500) \
|
||||||
-y --from bob \
|
-y --from bob \
|
||||||
| expect_fail "Can't create auction below min lease period"
|
| expect_fail "Can't create auction below min lease period"
|
||||||
|
|
||||||
colineard tx colinear new-auction asdf asdf 200 token $(now + 8200000) \
|
colineard tx colinearcore new-auction asdf asdf 200 usdc $(now + 8200000) \
|
||||||
-y --from bob \
|
-y --from bob \
|
||||||
| expect_fail "Can't create auction above max lease period"
|
| expect_fail "Can't create auction above max lease period"
|
||||||
|
|
||||||
before=$(get_balance $BOB token)
|
before=$(get_balance $BOB usdc)
|
||||||
|
|
||||||
colineard tx colinear new-auction asdf asdf 200 token $(now + 3700) \
|
colineard tx colinearcore new-auction asdf asdf 200 usdc $(now + 3700) \
|
||||||
-y --from bob \
|
-y --from bob \
|
||||||
| expect_success "New auction is created"
|
| expect_success "New auction is created"
|
||||||
|
|
||||||
get_balance $BOB token | expect_change -200 $before "Change in Bob's balance"
|
get_balance $BOB usdc | expect_change -200 $before "Change in Bob's balance"
|
||||||
|
|
||||||
colineard tx colinear new-bid $(get_last_auction_index) 100 \
|
colineard tx colinearcore new-bid $(get_last_auction_index) 100 \
|
||||||
-y --from alice \
|
-y --from alice \
|
||||||
| expect_success "New bid is correctly created"
|
| expect_success "New bid is correctly created"
|
||||||
|
|
||||||
colineard tx colinear new-bid $(get_last_auction_index) 90 \
|
colineard tx colinearcore new-bid $(get_last_auction_index) 90 \
|
||||||
-y --from alice \
|
-y --from alice \
|
||||||
| expect_success "Can bid below price ceiling"
|
| expect_success "Can bid below price ceiling"
|
||||||
|
|
||||||
colineard tx colinear new-bid $(get_last_auction_index) 100 \
|
colineard tx colinearcore new-bid $(get_last_auction_index) 100 \
|
||||||
-y --from alice \
|
-y --from alice \
|
||||||
| expect_fail "Can't create duplicate bids"
|
| expect_fail "Can't create duplicate bids"
|
||||||
|
|
||||||
colineard tx colinear new-bid $(get_next_auction_index) 100 \
|
colineard tx colinearcore new-bid $(get_next_auction_index) 100 \
|
||||||
-y --from alice \
|
-y --from alice \
|
||||||
| expect_fail "Can't create bids for nonexistent auctions"
|
| expect_fail "Can't create bids for nonexistent auctions"
|
||||||
|
|
||||||
colineard tx colinear new-bid $(get_last_auction_index) 600 \
|
colineard tx colinearcore new-bid $(get_last_auction_index) 600 \
|
||||||
-y --from alice \
|
-y --from alice \
|
||||||
| expect_fail "Can't bid over price ceiling"
|
| expect_fail "Can't bid over price ceiling"
|
||||||
|
|
||||||
colineard tx colinear new-bid $(get_last_auction_index) 0 \
|
colineard tx colinearcore new-bid $(get_last_auction_index) 0 \
|
||||||
-y --from alice \
|
-y --from alice \
|
||||||
| expect_fail "Can't bid 0 tokens"
|
| expect_fail "Can't bid 0 usdcs"
|
||||||
|
|
||||||
colineard q colinear auction-bids $(get_last_auction_index) \
|
colineard q colinearcore auction-bids $(get_last_auction_index) \
|
||||||
| jq -M ".bids | length" \
|
| jq -M ".bids | length" \
|
||||||
| assert_eq 2 "Number of auction bids"
|
| assert_eq 2 "Number of auction bids"
|
||||||
|
|
||||||
before=$(get_balance $BOB token)
|
before=$(get_balance $BOB usdc)
|
||||||
|
|
||||||
# Was experiencing issues with bob's balance not updating, probably
|
# Was experiencing issues with bob's balance not updating, probably
|
||||||
# because we weren't waiting long enough
|
# because we weren't waiting long enough
|
||||||
log_info "Waiting 12s until auction expires..."
|
log_info "Waiting 12s until auction expires..."
|
||||||
sleep 12
|
sleep 12
|
||||||
|
|
||||||
colineard tx colinear new-bid $(get_last_auction_index) 50 \
|
colineard tx colinearcore new-bid $(get_last_auction_index) 50 \
|
||||||
-y --from alice \
|
-y --from alice \
|
||||||
| expect_fail "Can't add bids after auction expiry"
|
| expect_fail "Can't add bids after auction expiry"
|
||||||
|
|
||||||
colineard q colinear show-auction $(get_last_auction_index) \
|
colineard q colinearcore show-auction $(get_last_auction_index) \
|
||||||
| jq -rM ".auction.best.amount" \
|
| jq -rM ".auction.best.amount" \
|
||||||
| assert_eq 90 "Remaining vested amount from finalized top bid"
|
| assert_eq 90 "Remaining vested amount from finalized top bid"
|
||||||
|
|
||||||
get_balance $BOB token | expect_change 110 $before "Change in Bob's balance"
|
get_balance $BOB usdc | expect_change 110 $before "Change in Bob's balance"
|
||||||
|
|
|
@ -69,12 +69,12 @@ function get_key {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_last_auction_index {
|
function get_last_auction_index {
|
||||||
res=$(colineard q colinear show-next-auction | jq -M ".NextAuction.auctionId | tonumber")
|
res=$(colineard q colinearcore show-next-auction | jq -M ".NextAuction.auctionId | tonumber")
|
||||||
echo "$res-1" | bc
|
echo "$res-1" | bc
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_next_auction_index {
|
function get_next_auction_index {
|
||||||
colineard q colinear show-next-auction | jq -M ".NextAuction.auctionId | tonumber"
|
colineard q colinearcore show-next-auction | jq -M ".NextAuction.auctionId | tonumber"
|
||||||
}
|
}
|
||||||
|
|
||||||
function now {
|
function now {
|
||||||
|
|
|
@ -9,13 +9,18 @@ const (
|
||||||
MaxLeasePeriod = 8_035_200 // 3 months
|
MaxLeasePeriod = 8_035_200 // 3 months
|
||||||
|
|
||||||
// Minimum required staked CLR to be a provider (i.e. to bid)
|
// Minimum required staked CLR to be a provider (i.e. to bid)
|
||||||
ProviderMinLockedClr = 500
|
// 500 CLR
|
||||||
|
ProviderMinLockedUClr = 500_000_000
|
||||||
// Amount slashed when a provider is offline during an audit
|
// Amount slashed when a provider is offline during an audit
|
||||||
ProviderLockedSlash = 100
|
// 100 CLR
|
||||||
|
ProviderLockedSlashUClr = 100_000_000
|
||||||
|
|
||||||
// Blocks between provider audit pings
|
// Blocks between provider audits
|
||||||
// 40 blocks ~40min-2hr
|
// 400 blocks ~400-1200min
|
||||||
ProviderPingFrequency = 40
|
ProviderAuditFrequency = 400
|
||||||
|
// Blocks before an audit ping must be returned
|
||||||
|
// 3 blocks ~4-12sec
|
||||||
|
ProviderAuditLength = 4
|
||||||
|
|
||||||
// Gas Fees
|
// Gas Fees
|
||||||
AuctionGas = 10
|
AuctionGas = 10
|
||||||
|
|
Loading…
Reference in New Issue