From cc8bef87a56e99714d726eff65bc0e905ea02aa4 Mon Sep 17 00:00:00 2001 From: Kyle Fang Date: Tue, 2 Apr 2024 12:47:32 +0800 Subject: [PATCH] chore: rename to v1-1 (#777) --- clarity/Clarinet.toml | 4 ++-- ...ol-helper.clar => amm-swap-pool-helper-v1-1.clar} | 0 .../helpers/launchpad-vesting-helper-v1-7.clar | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) rename clarity/contracts/helpers/{amm-swap-pool-helper.clar => amm-swap-pool-helper-v1-1.clar} (100%) diff --git a/clarity/Clarinet.toml b/clarity/Clarinet.toml index aede0fc3..8dfcd8bb 100644 --- a/clarity/Clarinet.toml +++ b/clarity/Clarinet.toml @@ -1562,8 +1562,8 @@ depends_on = [ "trait-ownable", "trait-sip-010" ] clarity_version = 2 epoch = 2.4 -[contracts.amm-swap-pool-helper] -path = "contracts/helpers/amm-swap-pool-helper.clar" +[contracts.amm-swap-pool-helper-v1-1] +path = "contracts/helpers/amm-swap-pool-helper-v1-1.clar" depends_on = [ ] clarity_version = 2 epoch = 2.4 diff --git a/clarity/contracts/helpers/amm-swap-pool-helper.clar b/clarity/contracts/helpers/amm-swap-pool-helper-v1-1.clar similarity index 100% rename from clarity/contracts/helpers/amm-swap-pool-helper.clar rename to clarity/contracts/helpers/amm-swap-pool-helper-v1-1.clar diff --git a/clarity/contracts/helpers/launchpad-vesting-helper-v1-7.clar b/clarity/contracts/helpers/launchpad-vesting-helper-v1-7.clar index b0fc95ac..f29adb91 100644 --- a/clarity/contracts/helpers/launchpad-vesting-helper-v1-7.clar +++ b/clarity/contracts/helpers/launchpad-vesting-helper-v1-7.clar @@ -42,7 +42,7 @@ (ok (var-set contract-owner owner)))) (define-public (transfer (token-trait ) (amount uint) (recipient principal)) - (begin + (begin (try! (check-is-owner)) (as-contract (contract-call? token-trait transfer-fixed amount tx-sender recipient none)))) @@ -50,7 +50,7 @@ (let ( (launch-details (try! (contract-call? .alex-launchpad-v1-7 get-launch-or-fail launch-id))) (total-tickets-won (contract-call? .alex-launchpad-v1-7 get-total-tickets-won launch-id)) - (total-amount (mul-down total-tickets-won (mul-down (get launch-tokens-per-ticket launch-details) (get multiplier details))))) + (total-amount (* total-tickets-won (get launch-tokens-per-ticket launch-details) (get multiplier details)))) (try! (check-is-owner)) (asserts! (is-eq (contract-of token-trait) (get launch-token launch-details)) ERR-TOKEN-MISMATCH) (asserts! (> (get end details) (get start details)) ERR-INVALID-VESTING-DETAILS) @@ -67,8 +67,8 @@ (define-public (claim (launch-id uint) (user principal) (token-trait )) (let ( - (vesting-details (try! (get-vesting-or-fail launch-id))) - (launch-details (try! (contract-call? .alex-launchpad-v1-7 get-launch-or-fail launch-id))) + (vesting-details (try! (get-vesting-or-fail launch-id))) + (launch-details (try! (contract-call? .alex-launchpad-v1-7 get-launch-or-fail launch-id))) (tickets-won (contract-call? .alex-launchpad-v1-7 get-tickets-won launch-id user)) (total-amount (mul-down tickets-won (mul-down (get launch-tokens-per-ticket launch-details) (get multiplier vesting-details)))) (checkpoint (* (try! (get-checkpoint-or-fail launch-id user)) ONE_8)) @@ -78,7 +78,7 @@ (asserts! (not (is-paused)) ERR-PAUSED) (asserts! (> block-height (get start vesting-details)) ERR-VESTING-NOT-STARTED) (asserts! (is-eq (contract-of token-trait) (get launch-token launch-details)) ERR-TOKEN-MISMATCH) - + (map-set checkpoints { launch-id: launch-id, user: user } new-checkpoint) (and (> vested-amount u0) (try! (as-contract (contract-call? token-trait transfer-fixed vested-amount tx-sender user none)))) @@ -97,4 +97,4 @@ (if (is-eq a u0) u0 (/ (* a ONE_8) b))) (define-private (min (a uint) (b uint)) - (if (<= a b) a b)) \ No newline at end of file + (if (<= a b) a b))