fn pause(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
) -> Result<(), ContractError>
fn freeze(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
counterparty: soroban_sdk::Address,
reason: soroban_sdk::String,
) -> Result<(), ContractError>
Address of the BRLP SAC this contract administers.
fn get_sac(env: soroban_sdk::Env) -> soroban_sdk::Address
unpause is never blocked by paused.
fn unpause(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
) -> Result<(), ContractError>
Native Soroban in-place upgrade. Same contract ID, same storage, new bytecode.
Future work: This function is a candidate for a timelock
(propose + delay + execute). Until then, the Upgrader role should
be a multisig account on mainnet.
fn upgrade(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), ContractError>
fn clawback(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
from: soroban_sdk::Address,
amount: i128,
reason: soroban_sdk::String,
) -> Result<(), ContractError>
Whether who currently holds role.
fn has_role(env: soroban_sdk::Env, role: Role, who: soroban_sdk::Address) -> bool
fn unfreeze(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
counterparty: soroban_sdk::Address,
reason: soroban_sdk::String,
) -> Result<(), ContractError>
Current value of the Paused flag.
fn is_paused(env: soroban_sdk::Env) -> bool
Idempotent: granting a role the holder already has is a no-op.
fn grant_role(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
role: Role,
who: soroban_sdk::Address,
) -> Result<(), ContractError>
fn revoke_role(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
role: Role,
who: soroban_sdk::Address,
) -> Result<(), ContractError>
Deploy-time constructor. Sets admin as the sole Role::Admin holder,
stores the SAC address, and starts unpaused. All other roles start empty.
fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
sac: soroban_sdk::Address,
)
Holders of role, empty if the role was never granted.
fn get_role_members(
env: soroban_sdk::Env,
role: Role,
) -> soroban_sdk::Vec
Re-point the SAC's admin to new_sac_admin.
DANGER: This is the single most dangerous function in the contract. Once called, this contract loses SAC admin rights. The new admin has full control of the BRLP asset (authorize, clawback, mint, set_admin).
Future work: This function is the primary candidate for a timelock
and/or requiring the Admin role holder to be a multisig account.
Until then, operational discipline MUST ensure the Admin holder is a
classic multisig with an appropriate threshold.
fn transfer_sac_admin(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_sac_admin: soroban_sdk::Address,
) -> Result<(), ContractError>
fn authorize_trustline(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
counterparty: soroban_sdk::Address,
) -> Result<(), ContractError>
fn deauthorize_trustline(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
counterparty: soroban_sdk::Address,
) -> Result<(), ContractError>
Add new_admin to Role::Admin inside this contract.
Does NOT touch the SAC.
fn rotate_contract_admin(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_admin: soroban_sdk::Address,
) -> Result<(), ContractError>