Skip to content

Module razor_amm::amm_controller

Resource SwapConfig

Configuration object that manages AMM protocol settings and administrative controls. This is a singleton object stored at the @razor_amm address.

struct SwapConfig has key

Constants

const ADMIN: address = 0xfaded96b72a03b2ed9e2b2dc0bef0642d63e07fd7b1eeeac047188eb1ef34dd6;

Operation is not allowed

const ERROR_FORBIDDEN: u64 = 3;

Invalid Address

const ERROR_INVALID_ADDRESS: u64 = 5;

No Pending Admin

const ERROR_NO_PENDING_ADMIN: u64 = 4;

No operations are allowed when contract is paused

const ERROR_PAUSED: u64 = 1;

Pending Admin Exists

const ERROR_PENDING_ADMIN_EXISTS: u64 = 6;

Contract is needs to be paused first

const ERROR_UNPAUSED: u64 = 2;
const FEE_ADMIN: address = 0xdadface12f06592ecb04ea00cd11c6ff7050890881c8ec58c2011955352c9f1a;

Function get_signer

Can be called by friended modules to obtain the object signer.

public friend fun get_signer(): signer

Function get_signer_address

#[view]
public fun get_signer_address(): address

Function get_fee_to

#[view]
public fun get_fee_to(): address

Function get_admin

#[view]
public fun get_admin(): address

Function get_fee_on

#[view]
public fun get_fee_on(): bool

Function assert_paused

Asserts that the protocol is in paused state Aborts if protocol is not paused

public fun assert_paused()

Function assert_unpaused

Asserts that the protocol is not paused Aborts if protocol is paused

public fun assert_unpaused()

Function pause

Pauses the protocol Can only be called by the current admin

public friend fun pause(account: &signer)

Function unpause

Unpauses the protocol Can only be called by the current admin

public friend fun unpause(account: &signer)

Function set_fee_to

public friend fun set_fee_to(account: &signer, fee_to: address)

Function set_admin_address

public friend fun set_admin_address(account: &signer, admin_address: address)

Function claim_admin

public friend fun claim_admin(account: &signer)