Withdraw crab from idle game manually
This guide will show you steps to manually withdraw crabs manually from the crabada idle game by interacting with the idle contract using the remix tool.
For reference, you can look up your Crabada ID here from Idle game snapshot data (crab id and owner address):
- Avalanche C-chain: 0x82a85407bd612f52577909f4a58bfc6873f14da8
- Swimmer: 0x9ab9e81Be39b73de3CCd9408862b1Fc6D2144d2B
pragma solidity 0.8.3;
// SPDX-License-Identifier: MIT
contract IGame {
function settleGame(uint256 gameId) external {}
function closeGame(uint256 gameId) external {}
function withdraw(address to, uint256[] calldata crabadaIds) external {}
function setLendingPrice(uint256 crabadaId, uint256 price) external {}
function removeCrabadaFromTeam(uint256 teamId, uint256 position) external {}
function getTeamInfo(uint256 teamId) external view returns (
address owner,
uint256 crabadaId1,
uint256 crabadaId2,
uint256 crabadaId3,
uint16 battlePoint,
uint16 timePoint,
uint256 currentGameId,
uint128 lockTo
){}
function ownerOf(uint256 crabadaId) external view returns(address) { }
function lendingPool(uint256 crabadaId) external view returns(uint256) { }
}
- 1.
- 2.Click on (1)
- 3.Click on (2) then input the name (“idle-game.sol”)
- 4.Copy the above contract source code and paste it into the container on the right hand side
- 1.Click on (1)
- 2.Click on (2)
- 1.Click on (1)
- 2.Change the environment to Injected Provider - Metamask. (2)
- 3.Input the contract address to (3)
- 4.Click on (4)
- 5.You will see the contract instance at (5)
- 1.Click on the withdraw button
- 2.Input your wallet address into the “to” input form
- 3.Input your crab id to the “crabdabaIds” input form in the below format
- 1.Your crab id is 1000: [1000]
- 2.Your crab id are 99,200 and 300: [99,200,300]
- 4.Click the “transact” button, the Metamask popup will be shown, you need to click the “Confirm” button.
- 5.The crabs will be transferred to your address wallet when your tx is confirmed.
- Not in the tavern
- Not in any team
Set the price to 0 by calling setLendingPrice(crab id, 0)
Call remove crab from team function: removeCrabadaFromTeam(team id, position)