Bionttestnet
Address

oct7qrpW…nfmtiK

oct7qrpW3T8mXYbZfAZrkLQKGAtD6ZswCf9Px5jPXnfmtiK
State
OCT balance
0OCT
wallet balance
Type
Contract
smart contract on chain
Chain-level
View on Octrascan · devnet
raw txs · nonce · pubkey
Pipoke (no profile)
this wallet has not registered a Pipoke profile
Contract
balance0 OCT
version1.0 Rehovot
code hash1e26de…f22d21
History
live · 20s · last 0
Source · ABI · Bytecode
✓ verified
expand →
✓ verified
contract ORC20 {
  state {
    name: string
    symbol: string
    decimals: int
    total_supply: int
    owner: address
    balances: map[address]int
    allowances: map[address]map[address]int
  }

  constructor(token_name: string, token_symbol: string, token_decimals: int, initial_supply: int) {
    self.name = token_name
    self.symbol = token_symbol
    self.decimals = token_decimals
    self.owner = origin
    self.total_supply = initial_supply
    self.balances[origin] = initial_supply
  }

  // --- View methods ---

  view fn name(): string {
    return self.name
  }

  view fn symbol(): string {
    return self.symbol
  }

  view fn decimals(): int {
    return self.decimals
  }

  view fn total_supply(): int {
    return self.total_supply
  }

  view fn balance_of(account: address): int {
    return self.balances[account]
  }

  view fn allowance(token_owner: address, spender: address): int {
    return self.allowances[token_owner][spender]
  }

  // --- State-changing methods ---

  fn transfer(to: address, amount: int): bool {
    require(amount > 0, "amount must be positive")
    require(self.balances[caller] >= amount, "insufficient balance")
    self.balances[caller] -= amount
    self.balances[to] += amount
    return true
  }

  fn approve(spender: address, amount: int): bool {
    self.allowances[caller][spender] = amount
    return true
  }

  fn transfer_from(from: address, to: address, amount: int): bool {
    require(amount > 0, "amount must be positive")
    require(self.balances[from] >= amount, "insufficient balance")
    require(self.allowances[from][caller] >= amount, "insufficient allowance")
    self.balances[from] -= amount
    self.balances[to] += amount
    self.allowances[from][caller] -= amount
    return true
  }

  fn mint(to: address, amount: int): bool {
    require(caller == self.owner, "only owner can mint")
    require(amount > 0, "amount must be positive")
    self.balances[to] += amount
    self.total_supply += amount
    return true
  }

  fn burn(amount: int): bool {
    require(amount > 0, "amount must be positive")
    require(self.balances[caller] >= amount, "insufficient balance")
    self.balances[caller] -= amount
    self.total_supply -= amount
    return true
  }
}