Syscoin

Syscoin Core Developer Portal

Welcome to the Syscoin Core developer portal. You'll find comprehensive guides and documentation to help you start working with Syscoin as quickly as possible, as well as support if you get stuck.

Get Started

Manual Withdrawing Deposit via Geth

When running an agent, a deposit of 3 ETH is place in the contract. On rare occasion, when you decide to stop running the agent, the ETH may not be withdrawn automatically. In this scenario, follow the guide below to withdraw the ETH from the contract.

Assumptions:
Default data directory at ~/.syscoin/geth

This guide provides manual instruction on withdrawing ETH locked in SyscoinClaimManager contract.

# Run Geth
sysgeth.nod attach -datadir ~/.syscoin/geth

# Once you're in Geth's interactive shell, jut paste the following.
# Replace eth.accounts[0] with your address if it's not the first address in your geth wallet

var abi = [{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositBonded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"who","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositMade","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositUnbonded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"who","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"err","type":"uint256"}],"name":"ErrorClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"address","name":"loser","type":"address"}],"name":"SuperblockBattleDecided","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"challenger","type":"address"}],"name":"SuperblockClaimChallenged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"submitter","type":"address"},{"indexed":false,"internalType":"uint256","name":"processCounter","type":"uint256"}],"name":"SuperblockClaimCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"challenger","type":"address"},{"indexed":false,"internalType":"uint256","name":"processCounter","type":"uint256"}],"name":"SuperblockClaimFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"submitter","type":"address"}],"name":"SuperblockClaimPending","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"submitter","type":"address"},{"indexed":false,"internalType":"uint256","name":"processCounter","type":"uint256"}],"name":"SuperblockClaimSuccessful","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"submitter","type":"address"},{"indexed":false,"internalType":"address","name":"challenger","type":"address"}],"name":"VerificationGameStarted","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"claims","outputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"internalType":"address","name":"submitter","type":"address"},{"internalType":"address","name":"challenger","type":"address"},{"internalType":"uint256","name":"createdAt","type":"uint256"},{"internalType":"uint256","name":"challengeTimeout","type":"uint256"},{"internalType":"bool","name":"verificationOngoing","type":"bool"},{"internalType":"bool","name":"decided","type":"bool"},{"internalType":"bool","name":"invalid","type":"bool"},{"internalType":"bool","name":"challengeDefended","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"getDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"inProcessCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"makeDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"minProposalDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"superblockConfirmations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"superblockDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"superblockTimeout","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"trustedSuperblocks","outputs":[{"internalType":"contract SyscoinSuperblocksI","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"trustedSyscoinBattleManager","outputs":[{"internalType":"contract SyscoinBattleManagerI","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract SyscoinSuperblocksI","name":"_superblocks","type":"address"},{"internalType":"contract SyscoinBattleManagerI","name":"_syscoinBattleManager","type":"address"},{"internalType":"uint256","name":"_superblockDelay","type":"uint256"},{"internalType":"uint256","name":"_superblockTimeout","type":"uint256"},{"internalType":"uint256","name":"_superblockConfirmations","type":"uint256"}],"name":"init","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"bondDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"getBondedDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"_blocksMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256","name":"_mtpTimestamp","type":"uint256"},{"internalType":"bytes32","name":"_lastHash","type":"bytes32"},{"internalType":"uint32","name":"_lastBits","type":"uint32"},{"internalType":"bytes32","name":"_parentHash","type":"bytes32"}],"name":"proposeSuperblock","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"}],"name":"challengeSuperblock","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"internalType":"bytes32","name":"descendantId","type":"bytes32"}],"name":"confirmClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"}],"name":"rejectClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"}],"name":"checkClaimFinished","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"address","name":"loser","type":"address"}],"name":"sessionDecided","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"}],"name":"getInBattleAndSemiApprovable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"}],"name":"getClaimSubmitter","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"}],"name":"getNewSuperblockEventTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"}],"name":"getClaimExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"}],"name":"getClaimDecided","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"}],"name":"getClaimInvalid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"superblockHash","type":"bytes32"}],"name":"getClaimChallenger","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
var contract = web3.eth.contract(abi).at("0x2590095e7f9e654098FE4fbB1bA883915Bab0e4B")

// To show how much deposit you can withdraw, run the following
// eth.accounts[0] refers to the first account in the account list
contract.getDeposit(eth.accounts[0])

// To withdraw all your deposit, run the following.  Notice the first argument is just the previous command
contract.withdrawDeposit(contract.getDeposit(eth.accounts[0]), {"from":eth.accounts[0]})

// Or if you want a specifici amount of eth... say 9 eth you can do the following
contract.withdrawDeposit(web3.toWei(9, "ether"), {"from":eth.accounts[0]})

For the curious minds wondering how to get that ABI blob above:

git clone https://www.github.com/syscoin/sysethereum-contracts
cd sysethereum-contracts
git checkout testnet
cat build/contracts/SyscoinClaimManager.json | jq -c ''.abi
cat build/contracts/SyscoinClaimManager.json | jq -c '.networks["4"]'.address


# Keep in mind that the content of the build directory changes every time you run truffle compile.
# The .json is only accurate because Jag uploaded it after he push the contract

Updated 29 days ago

Manual Withdrawing Deposit via Geth


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.