artonomous / artonomous-mvp

A Self-Owning, Self-Sustaining, Self-Improving Autonomous Artist Using the Ethereum Blockchain
158 stars 21 forks source link

Installation instructions completed #41

Open TimDaub opened 5 years ago

TimDaub commented 5 years ago

I tried running artonomous and ran into some problems. Here is what fixed it.

Do we need to update these instructions in all three generator branches?

TimDaub commented 5 years ago

I had to install the two specified packages with truffle install. In the truffle documentation they say this is the way to declare them: https://truffleframework.com/docs/truffle/getting-started/package-management-via-ethpm#package-configuration

On Fri, Aug 31, 2018, 10:34 Simon de la Rouviere notifications@github.com wrote:

@simondlr commented on this pull request.

In packages/contracts/ethpm.js https://github.com/artonomous/artonomous-mvp/pull/41#discussion_r214281101 :

@@ -0,0 +1,8 @@ +{

  • "package_name": "@artonomous/contracts"
  • "version": "0.1.0",
  • "dependencies": {
  • "zeppelin": "1.3.0",
  • "tokens": "1.0.0"
  • } +}

I'm not familiar with how ethpm works here. Is this needed atm to make our contracts work? I haven't run the full setup recently.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/artonomous/artonomous-mvp/pull/41#pullrequestreview-151303056, or mute the thread https://github.com/notifications/unsubscribe-auth/ACoXNYFysJhgE1m2T4ooL7apB6J0EIRxks5uWPUvgaJpZM4WSKa6 .

TimDaub commented 5 years ago

packages/front-end/contracts/Artonomous.json is replaced by the symlink in the installation instruction according to this drizzle tutorial: https://truffleframework.com/tutorials/getting-started-with-drizzle-and-react#link-up-our-build-artifacts

I had to fix a bunch of more things that the solidity compiler complained about when I did truffle migrate. Please give me guidance on the Solidity stuff. I'm a noob there.

simondlr commented 5 years ago

wrt ethpm.

I haven't used it extensively. So, I'm not sure why zeppelin or tokens or necessary. openzeppeling-solidity is installed via npm, which contains the necessary packages, not via ethpm.

Or am I missing something?

TimDaub commented 5 years ago

openzeppeling-solidity is installed via npm, which contains the necessary packages, not via ethpm.

You're right. I was able to remove "zeppelin" from ethpm.json and instead use openzeppelin-solidity. For all but https://github.com/artonomous/artonomous-mvp/blob/hardcoded/packages/contracts/contracts/EthBondingCurvedToken.sol#L6

This contract seems to be written with https://github.com/ConsenSys/Tokens/blob/master/contracts/eip20/EIP20.sol in mind. When I switch out EIP20 with openzeppelin-solidity's ERC20 token, the inheritance won't work anymore:

//import "tokens/eip20/EIP20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
 ✘ timdaub@kazoo  ~/artonomous-mvp/packages/contracts   generator ●  truffle compile
Compiling ./contracts/ArtonomousCurvedBond.sol...
Compiling ./contracts/EthBondingCurvedToken.sol...
Compiling ./contracts/EthPolynomialCurvedToken.sol...
Compiling openzeppelin-solidity/contracts/math/SafeMath.sol...
Compiling openzeppelin-solidity/contracts/token/ERC20/ERC20.sol...
Compiling openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol...

/Users/timdaub/artonomous-mvp/packages/contracts/contracts/EthBondingCurvedToken.sol:47:9: DeclarationError: Undeclared identifier. Did you mean "balanceOf"?
        balances[msg.sender] = balances[msg.sender].add(numTokens);
        ^------^
,/Users/timdaub/artonomous-mvp/packages/contracts/contracts/EthBondingCurvedToken.sol:47:32: DeclarationError: Undeclared identifier. Did you mean "balanceOf"?
        balances[msg.sender] = balances[msg.sender].add(numTokens);
                               ^------^
,/Users/timdaub/artonomous-mvp/packages/contracts/contracts/EthBondingCurvedToken.sol:59:17: DeclarationError: Undeclared identifier. Did you mean "balanceOf"?
        require(balances[msg.sender] >= numTokens);
                ^------^
,/Users/timdaub/artonomous-mvp/packages/contracts/contracts/EthBondingCurvedToken.sol:63:9: DeclarationError: Undeclared identifier. Did you mean "balanceOf"?
        balances[msg.sender] = balances[msg.sender].sub(numTokens);
        ^------^
,/Users/timdaub/artonomous-mvp/packages/contracts/contracts/EthBondingCurvedToken.sol:63:32: DeclarationError: Undeclared identifier. Did you mean "balanceOf"?
        balances[msg.sender] = balances[msg.sender].sub(numTokens);
                               ^------^
Compilation failed. See above.
ebaizel commented 5 years ago

great work @TimDaub.

fwiw with the minor tweaks i made (noted in my comments), i got the install to work and all the tests to pass. the tokens repo recommends using EPM for installation, if that's the repo that was intended to be used here.

TimDaub commented 5 years ago

@ebaizel I saw your comments late. I fixed everything now :) Thx for the review.