TRON GOBLIN
explorerv0.5-beta
MAINNET

Lottery · Verified Contract on Tron

Smart contract
VERIFIED · mainnet
{}
Lottery
CONTRACT Source verified Non-proxy 1
Address TGmAzMMH1nx2WgfcsbD3PDbvHgvGG78wMZ
Verification Verified
Standard CONTRACT
Creation tx e09b755d…64c03e
Deployed Aug 14, 2020
Proxy No
Contract balance 21,714TRX on-chain
Total calls 5.06K lifetime triggers
Functions 31 18 read · 13 write
Bytecode 21.08Kbytes runtime
Deployed Aug 14, 2020 verified
Contract interface
ABI · 31 fns
Source verified · ABI matches bytecode 31 functions · 9 events · 21,079 bytes
contract.abi.json
[
  {
    "outputs": [
      {
        "type": "bool"
      }
    ],
    "constant": true,
    "name": "paused",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "__owner",
        "type": "address"
      }
    ],
    "name": "removeOwnership",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "uint256"
      }
    ],
    "constant": true,
    "name": "ticketNumberRange",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "uint256"
      }
    ],
    "constant": true,
    "name": "transferredWeeks",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "name": "roundId",
        "type": "uint256"
      },
      {
        "name": "totalTicketCount",
        "type": "uint256"
      },
      {
        "name": "blockNumber",
        "type": "uint256"
      },
      {
        "name": "transferred",
        "type": "bool"
      },
      {
        "name": "bitcoinBlockHash",
        "type": "string"
      }
    ],
    "constant": true,
    "name": "currentRound",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "name": "roundId",
        "type": "uint256"
      },
      {
        "name": "totalTicketCount",
        "type": "uint256"
      },
      {
        "name": "blockNumber",
        "type": "uint256"
      },
      {
        "name": "transferred",
        "type": "bool"
      },
      {
        "name": "bitcoinBlockHash",
        "type": "string"
      }
    ],
    "constant": true,
    "inputs": [
      {
        "type": "uint256"
      }
    ],
    "name": "rounds",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "bool"
      }
    ],
    "constant": true,
    "name": "isOwner",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "uint256"
      }
    ],
    "constant": true,
    "name": "currentRoundId",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "_to",
        "type": "address"
      },
      {
        "name": "_amount",
        "type": "uint256"
      },
      {
        "name": "_token",
        "type": "address"
      }
    ],
    "name": "sendTRC20",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "_to",
        "type": "address"
      },
      {
        "name": "_amount",
        "type": "uint256"
      },
      {
        "name": "_gasForTransfer",
        "type": "uint256"
      }
    ],
    "name": "sendTRX",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "newOwner",
        "type": "address"
      }
    ],
    "name": "addOwnership",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "_winrContract",
        "type": "address"
      },
      {
        "name": "_routerContract",
        "type": "address"
      }
    ],
    "stateMutability": "Nonpayable",
    "type": "Constructor"
  },
  {
    "payable": true,
    "stateMutability": "Payable",
    "type": "Fallback"
  },
  {
    "inputs": [
      {
        "indexed": true,
        "name": "player",
        "type": "address"
      },
      {
        "indexed": true,
        "name": "roundId",
        "type": "uint256"
      },
      {
        "indexed": true,
        "name": "ticketHash",
        "type": "bytes32"
      },
      {
        "name": "numbers",
        "type": "uint256[5]"
      },
      {
        "name": "totalTickets",
        "type": "uint256"
      }
    ],
    "name": "TicketBuy",
    "type": "Event"
  },
  {
    "inputs": [
      {
        "indexed": true,
        "name": "roundId",
        "type": "uint256"
      },
      {
        "indexed": true,
        "name": "winnerLength",
        "type": "uint256"
      },
      {
        "indexed": true,
        "name": "winnerHash",
        "type": "bytes32"
      },
      {
        "name": "amount",
        "type": "uint256"
      },
      {
        "name": "numbers",
        "type": "uint256[5]"
      },
      {
        "name": "winners",
        "type": "address[]"
      },
      {
        "name": "amountsTRC20",
        "type": "uint256[]"
      }
    ],
    "name": "Drawn",
    "type": "Event"
  },
  {
    "inputs": [
      {
        "indexed": true,
        "name": "roundId",
        "type": "uint256"
      },
      {
        "indexed": true,
        "name": "blockNumber",
        "type": "uint256"
      }
    ],
    "name": "BlockNumber",
    "type": "Event"
  },
  {
    "inputs": [
      {
        "indexed": true,
        "name": "roundId",
        "type": "uint256"
      },
      {
        "indexed": true,
        "name": "prize",
        "type": "uint256"
      },
      {
        "indexed": true,
        "name": "player",
        "type": "address"
      }
    ],
    "name": "FailedPrizeTransfer",
    "type": "Event"
  },
  {
    "inputs": [
      {
        "indexed": true,
        "name": "roundId",
        "type": "uint256"
      },
      {
        "indexed": true,
        "name": "blockNumber",
        "type": "uint256"
      },
      {
        "name": "blockHash",
        "type": "string"
      }
    ],
    "name": "SetHash",
    "type": "Event"
  },
  {
    "inputs": [
      {
        "name": "account",
        "type": "address"
      }
    ],
    "name": "Paused",
    "type": "Event"
  },
  {
    "inputs": [
      {
        "name": "account",
        "type": "address"
      }
    ],
    "name": "Unpaused",
    "type": "Event"
  },
  {
    "inputs": [
      {
        "indexed": true,
        "name": "newOwner",
        "type": "address"
      }
    ],
    "name": "OwnershipGiven",
    "type": "Event"
  },
  {
    "inputs": [
      {
        "indexed": true,
        "name": "previousOwner",
        "type": "address"
      }
    ],
    "name": "OwnershipTaken",
    "type": "Event"
  },
  {
    "inputs": [
      {
        "name": "_gasForTransferAmount",
        "type": "uint256"
      }
    ],
    "name": "setGasForTRXTransfer",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "name": "pause",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "name": "unpause",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "address"
      }
    ],
    "constant": true,
    "name": "getWinrContract",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "uint256"
      }
    ],
    "constant": true,
    "inputs": [
      {
        "name": "_player",
        "type": "address"
      }
    ],
    "name": "getCurrentTicketsNumber",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "uint256[5]"
      },
      {
        "type": "bytes32"
      },
      {
        "type": "uint256"
      }
    ],
    "constant": true,
    "inputs": [
      {
        "name": "_player",
        "type": "address"
      },
      {
        "name": "_ticketIndex",
        "type": "uint256"
      }
    ],
    "name": "getCurrentTicket",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "uint256"
      }
    ],
    "constant": true,
    "inputs": [
      {
        "name": "_player",
        "type": "address"
      },
      {
        "name": "_roundId",
        "type": "uint256"
      }
    ],
    "name": "getTicketsNumber",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "uint256[5]"
      },
      {
        "type": "bytes32"
      },
      {
        "type": "uint256"
      }
    ],
    "constant": true,
    "inputs": [
      {
        "name": "_player",
        "type": "address"
      },
      {
        "name": "_roundId",
        "type": "uint256"
      },
      {
        "name": "_ticketIndex",
        "type": "uint256"
      }
    ],
    "name": "getTicket",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "uint256"
      },
      {
        "type": "uint256"
      },
      {
        "type": "address[]"
      },
      {
        "type": "uint256"
      },
      {
        "type": "uint256[5]"
      },
      {
        "type": "string"
      },
      {
        "type": "address[]"
      },
      {
        "type": "bool"
      }
    ],
    "constant": true,
    "name": "getCurrentRound",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "uint256"
      },
      {
        "type": "uint256"
      },
      {
        "type": "address[]"
      },
      {
        "type": "uint256"
      },
      {
        "type": "uint256[5]"
      },
      {
        "type": "string"
      },
      {
        "type": "address[]"
      },
      {
        "type": "bool"
      }
    ],
    "constant": true,
    "inputs": [
      {
        "name": "_roundId",
        "type": "uint256"
      }
    ],
    "name": "getRoundById",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "_contract",
        "type": "address"
      }
    ],
    "name": "changeWinrContract",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "type": "address"
      }
    ],
    "constant": true,
    "name": "getRouterContract",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "_contract",
        "type": "address"
      }
    ],
    "name": "changeRouterContract",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "name": "lastDrawTime",
        "type": "uint256"
      }
    ],
    "constant": true,
    "name": "getLastDrawTime",
    "stateMutability": "View",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "_numbers",
        "type": "uint256[5]"
      },
      {
        "name": "player",
        "type": "address"
      }
    ],
    "name": "buy",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "_blockNumber",
        "type": "uint256"
      }
    ],
    "name": "setBTCBlockNumber",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "_newRange",
        "type": "uint256"
      }
    ],
    "name": "setRange",
    "stateMutability": "Nonpayable",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "name": "numbers",
        "type": "uint256[5]"
      }
    ],
    "constant": true,
    "inputs": [
      {
        "name": "_bitcoinBlockHash",
        "type": "string"
      },
      {
        "name": "_range",
        "type": "uint256"
      }
    ],
    "name": "getRandomNumbersFromHash",
    "stateMutability": "Pure",
    "type": "Function"
  },
  {
    "outputs": [
      {
        "name": "number",
        "type": "uint256"
      }
    ],
    "constant": true,
    "inputs": [
      {
        "name": "_seedString",
        "type": "string"
      },
      {
        "name": "_range",
        "type": "uint256"
      },
      {
        "name": "_pointer",
        "type": "uint256"
      }
    ],
    "name": "getRandomNumberFromHash",
    "stateMutability": "Pure",
    "type": "Function"
  },
  {
    "inputs": [
      {
        "name": "_bitcoinBlockHash",
        "type": "string"
      }
    ],
    "name": "draw",
    "stateMutability": "Nonpayable",
    "type": "Function"
  }
]
About this contract
overview

Lottery is a verified smart contract on Tron, deployed from TG6xN5xY9p8QyPRjv1P8Vvgfm3pWhyXYs4 on Aug 14, 2020. It has been called 5.06K times.

The ABI matches the on-chain bytecode, so the Read tab above runs live view calls against the node (no gas, no signature). The verified Solidity source is viewable on TronScan ↗. Write calls require a signed wallet transaction — wallet support is coming soon.