diff --git a/src/Hooks.ts b/src/Hooks.ts index b9f3fea..71c6197 100644 --- a/src/Hooks.ts +++ b/src/Hooks.ts @@ -35,23 +35,10 @@ class Hooks extends SmartContract implements _Hooks { const admin = this.admin.get(); this.admin.requireEquals(admin); - // If you want to disallow some AdminActions, you can do - // that via an assert statement like this: - //const actionPossible = action.type - // .equals(AdminAction.types.setPaused) - // .equals(Bool(false)); - //actionPossible.assertTrue(); - // This would check that the action is not setPaused, - // and thus disallow pausing/unpausing token transfers. - - // If you want to allow any AdminAction, unconditioanlly return true. - const actionPossible = Bool(true); - - // Require a signature from the admin const adminAccountUpdate = AccountUpdate.create(admin); adminAccountUpdate.requireSignature(); - return actionPossible; + return Bool(true); } } diff --git a/src/interfaces/token/adminable.ts b/src/interfaces/token/adminable.ts index 774a75c..fc8839b 100644 --- a/src/interfaces/token/adminable.ts +++ b/src/interfaces/token/adminable.ts @@ -18,8 +18,7 @@ class AdminAction extends Struct({ mint: 0, burn: 1, setTotalSupply: 2, - setPaused: 3, - setVerificationKey: 4, + setVerificationKey: 3, }; public static fromType(type: number): AdminAction { @@ -38,14 +37,9 @@ interface Burnable { burn: (from: PublicKey, amount: UInt64) => AccountUpdate; } -interface Pausable { - paused: State; - setPaused: (paused: Bool) => void; -} - interface Upgradable { setVerificationKey: (verificationKey: VerificationKey) => void; } -export type { Mintable, Burnable, Pausable, Upgradable }; +export type { Mintable, Burnable, Upgradable }; export { AdminAction }; diff --git a/src/interfaces/token/viewable.ts b/src/interfaces/token/viewable.ts index 646d262..9ceefb5 100644 --- a/src/interfaces/token/viewable.ts +++ b/src/interfaces/token/viewable.ts @@ -9,7 +9,6 @@ interface Viewable { getTotalSupply: () => UInt64; getCirculatingSupply: () => UInt64; getDecimals: () => UInt64; - getPaused: () => Bool; getHooks: () => PublicKey; } diff --git a/src/token.ts b/src/token.ts index 02e612a..7778ba7 100644 --- a/src/token.ts +++ b/src/token.ts @@ -22,7 +22,6 @@ import { import errors from './errors'; import { AdminAction, - type Pausable, type Burnable, type Mintable, type Upgradable, @@ -43,7 +42,6 @@ class Token Mintable, Burnable, Viewable, - Pausable, Transferable, Upgradable { @@ -58,8 +56,6 @@ class Token @state(UInt64) public circulatingSupply = State(); - @state(Bool) public paused = State(); - public decimals: UInt64 = UInt64.from(Token.defaultDecimals); public getHooksContract(): Hooks { @@ -80,7 +76,6 @@ class Token this.hooks.set(hooks); this.totalSupply.set(totalSupply); this.circulatingSupply.set(UInt64.from(0)); - this.paused.set(Bool(false)); } /** @@ -147,19 +142,11 @@ class Token } /** - * Pausable + * Approvable */ @method - public setPaused(paused: Bool) { - const hooksContract = this.getHooksContract(); - hooksContract.canAdmin(AdminAction.fromType(AdminAction.types.setPaused)); - - this.paused.set(paused); - } - - @method - approveBase(updates: AccountUpdateForest) { + public approveBase(updates: AccountUpdateForest) { this.checkZeroBalanceChange(updates); } @@ -200,13 +187,6 @@ class Token return hooks; } - public getPaused(): Bool { - const paused = this.paused.get(); - this.paused.requireEquals(paused); - - return paused; - } - public getDecimals(): UInt64 { return this.decimals; }