Name: panda-tokens
Owner: ConsenSys
Description: A demo of smart contracts with metamask
Forked from: krisrandall/panda-tokens
Created: 2018-02-21 08:58:52.0
Updated: 2018-02-21 08:58:54.0
Pushed: 2017-10-24 05:32:05.0
Homepage: null
Size: 2778
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A DAPP to demonstrate the simplicity of smart contracts and Metamask.
It has the following functionality :
You can easily create a new account using Metamask (just remember to change to “Ropsten” first after installing it).
You will need some test Ether in order to donate, your can mine for it using Mist on testnet (see “Getting some test ether” below).
First start geth connected to the “Ropsten” testnet :
--fast --cache=1048 --testnet --rpc --rpcapi "eth,net,web3" --rpccorsdomain '*' --rpcaddr localhost --rpcport 8545 --unlock 0x4Fcb8b0a22461BB32A7B95Cd7D0dB64fd2767433
where the address at the end is one you have created (see 'Getting some Ropsten test ether' below)
Then :
uffle compile
uffle migrate --network ropsten
m run dev
See these instructions for creating a local node.
Start up your node with something like :
th --datadir /projects/local_ethereum_blockchain/node1 --networkid 61 console --rpc --rpcport 8545
Then : Create 3 addresses (personal.newAccount('password')
x 3) and copy them into the recepients file (recepient_descriptions) in app/javascripts/config.js
Also : Do personal.unlockAccount( eth.accounts[0], 'password' )
so the account is unlocked for the next steps, and also start mining miner.start(1)
Go to remix : https://remix.ethereum.org/
Open the PandaToken.sol and PandaProject.sol files
Start with the PandaToken, click “Compile” then “Details”, select the “WEB3DEPLOY” code and paste it into your geth
terminal (started above)
Note the contract address (copy it) - paste it into app/javascripts/config.js
as contract_locations.panda_token (but also keep it copied for the next step)
Now in remix open the PandaProject, click “Compile”, then “Details”, select the “WEB3DEPLOY” code, but before pasting it in to the geth
terminal set the following :
projectName = “whatever you like”
recipientAddresses = [ array of 3 “addresses” from testrpc
terminal ]
recipientShares = [ 50, 30, 20 ]
pandaTokenContractAddr = “address copied in step 4 above”
After you paste this into geth
grab the returned address and paste it into config.js
as the panda_project contract location
m run dev
and change Metamask to “Localhost 8545”
Note that to donate you will need some ether in your Metamask account - you can transfer to it by copying that address from Metamask and sending the ether from the geth
terminal : eth.sendTransaction({from: eth.accounts[0], to: "<Metamask account>", value: web3.toWei(1, "ether")})
“A bad HTTP response code (404) was received when fetching the script”.
https://github.com/vuejs-templates/webpack/issues/446#issuecomment-278503745
“Error: Error: VM Exception while executing eth_call: invalid opcode”.
This is a bug with “testrpc”, you cannot use “testrpc” for this
“Error: exceeds block gas limit undefined”
You need some more ether, allow the miner to work for a little while
Metamask Donate 0.1 ETH fails, and error says : “Error: invalid sender”.
Contract built with old ethereum client - upate your local ethereum client or backdate Metamask.
OR - ensure your network id matches the chainID in your genesis.json file
This project was started by doing a
$ truffle init webpack
and then adjusting the sample app created.