New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fishing Bot #1

Closed
austintgriffith opened this Issue May 12, 2018 · 7 comments

Comments

Projects
None yet
3 participants
@austintgriffith
Copy link
Owner

austintgriffith commented May 12, 2018

Galleass.io Fishing Bot

Summary

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.

image

Details

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)

image

  1. Embark! (Put your Dogger into the Sea): This means calling the embark(uint256 shipId) function in the Sea contract.

image

  1. 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);

image

  1. 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.

image

  1. 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.

image

  1. 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.

image

  1. If a fish is caught, sell it to the Fish Monger: Call the _sellFish(address _species,uint256 amount) function in the Fish Monger contract.

image

image

  1. 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.

image

Don't reinvent the wheel, there is already a test script that performs similar actions here:
https://github.com/austintgriffith/galleass/blob/master/tests/embarkAndGoFishing.js

All contracts are public and verified on Etherscan. Example:
https://ropsten.etherscan.io/address/0xC15fa062d898f89e943429D056200D08614DDF89#code

The script should be publicly available in the Galleass github repo for others to use and extend.

@gitcoinbot

This comment has been minimized.

Copy link

gitcoinbot commented May 12, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.5 ETH (334.15 USD @ $668.3/ETH) attached to it.

@gitcoinbot

This comment has been minimized.

Copy link

gitcoinbot commented May 12, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

  1. @darkdarkdragon (1st precedence)
  2. @kayabaNerve (2nd precedence)

has committed to working on this project to be completed 5 months, 4 weeks from now.

Please answer following questions/comments @austintgriffith:

plan to adopt code from mentioned test
Please answer following questions/comments @austintgriffith:

I'll write a script in NodeJS, to be later ported to the browser, that will accomplish all necessary tasks.

@kayabaNerve

This comment has been minimized.

Copy link

kayabaNerve commented May 13, 2018

Just fixing a couple of bugs. https://github.com/kayabaNerve/Galleass-Fishing

@gitcoinbot

This comment has been minimized.

Copy link

gitcoinbot commented May 13, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 0.5 ETH (368.01 USD @ $736.02/ETH) has been submitted by:

  1. @kayabaNerve

@austintgriffith please take a look at the submitted work:


@austintgriffith

This comment has been minimized.

Copy link
Owner Author

austintgriffith commented May 14, 2018

@kayabaNerve slaughtered this bounty with some gorgeous code.

@gitcoinbot

This comment has been minimized.

Copy link

gitcoinbot commented May 14, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 0.5 ETH (364.65 USD @ $729.31/ETH) attached to this issue has been approved & issued to @kayabaNerve.

@austintgriffith

This comment has been minimized.

Copy link
Owner Author

austintgriffith commented Jul 7, 2018

The original code for this fishing bot no longer works with the latest set of contracts. I forked the original version and updated it here: https://github.com/austintgriffith/Galleass-Fishing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment