Check out the Issue Explorer
Looking to fund some work? You can submit a new Funded Issue here.
# Galleass.io Fishing Bot
Looking for a community member to design a bot that will demonstrate how to catch and sell fish for copper automatically on https://galleass.io.
Write a script that interfaces with the Galleass.io smart contracts currently deployed to Ropsten.
It should complete the following actions:
1. **Purchase a Dogger from the Harbor if one is not currently in your inventory:** This means calling the _buyShip(bytes32 model)_ function in the Harbor contract. Please load the Harbor contract address dynamically by calling _getContract(bytes32 name)_ in the Galleass contract. (The Galleass contract addresses can be found here: https://galleass.io/contracts.html)
2. **Embark! (Put your Dogger into the Sea):** This means calling the _embark(uint256 shipId)_ function in the Sea contract.
3. **Set sail toward the fish you wish to catch:** This means calling _setSail(bool direction)_ in the Sea contract. You can sail east (true) or west (false) depending on what fish are available to catch. You can parse events to determine which fish to catch.
First, look through all Fish events:
_event Fish(bytes32 id, uint256 timestamp, address species, bytes32 image);_
Then, remove any that have already been caught:
_event Catch(address account, bytes32 id, uint256 timestamp, address species);_
4. **After sailing to the target fish, drop anchor:** Your ship will sail a small distance with each block that is mined. You can get your location by calling _shipLocation(address owner)_ in the Sea contract. When you are ready, call _dropAnchor()_ in the Sea contract.
5. **Cast your line using a random bait hash:** Call the _castLine(bytes32 baitHash)_ function in the Sea contract. The contract uses a commit/reveal scheme for randomness so you will need to generate a random SHA256 called the "reveal" and then hash the reveal as your **baitHash**.
6. **Attempt to reel in the fish:** Call the _reelIn(bytes32 fish, bytes32 bait)_ function in the Sea contract. The **bait** is your "reveal" from the previous step.
7. **If a fish is caught, sell it to the Fish Monger:** Call the _sellFish(address _species,uint256 _amount)_ function in the Fish Monger contract.
8. **Return to the Harbor and Disembark:** Set sail toward the harbor and call the _disembark(uint256 shipId)_ function in the Sea contract when you are close enough. This will return the Dogger to your inventory.
Don't reinvent the wheel, there is already a test script that performs similar actions here:
All contracts are public and verified on Etherscan. Example:
The script should be publicly available in the Galleass github repo for others to use and extend.