-
Notifications
You must be signed in to change notification settings - Fork 12
/
instructions.txt
80 lines (64 loc) · 7.36 KB
/
instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Install:
Go to : https://chrome.google.com/webstore/category/extension
Search for metamask
Open Metamase offered by `https://metamask.io/`
Add to chrome
Confirm by `add extention`
Set wallet:
Open `metamask` and click get started
If you already have a wallet then go for `import wallet`
To create a new wallet, go for `create wallet`
Agree with `privacy policy`
Put you password And create the wallet
reveal and Save your backup phrase in a secure place
select the word according to the phrase and Confirm
Your wallet is all set up, select `all for done`
You will get your address here
Configure for rinkeby network:
On top right, switch main ethereum network to rinkyby network
Since you have no ether, let's get some fake ether for rinkeby network
Go to `https://faucet.rinkeby.io/`
A proper instruction is given on the page,
go to `https://twitter.com/home`
create a tweet that has your wallet address
open the tweet in a new page and grab the page address
Put the tweet link in `` page and from the `Give me Ether` select a suitable package
Now open your metamask plugin and make sure rinkeby network is selected
You should have your expected ether
Deploy the contract:
Open `https://remix.ethereum.org/`
Select environment `Solidity`
Go to `file explorer tab` and create a file `Lottery.sol`
Get the contract code from `https://gist.github.com/bmshamsnahid/05005b4c1e9c402e521be8b56d8050f2` and paste
Go to `Solidity Compiler` tab and select compiler `0.4.17`
Your language should be Solidity
EVM version should be `compiler default`
In `Solidity Compiler` tab, click `Compile Lottery.sol`
You can also enable `auto compile` by click the checkbox
Go to `Deploy and run transaction` tab and deploy the contract
Your contract functionality will be available unde `Deployed Contracts` section
To deploy to the rinkeby network:
open the `metamask plugin` and put the password
Make sure you are in the `rinkeby` network
open the remix ide, from `file explorer` open `Lottery.sol`
In remix ide `deployed and run transaction` tab, set
Environment: Injected web3 (You may need confirmation from the metamask plugin)
Account: Your rinkeby wallet address (Automatically selected)
Now click `deploy` and confirm transaction from metamask
In the log section you should get a transaction hash like `0xb893fbe43e87d400ca24d4e5a338b34819d7e6a1ff50e80086ece857a49d4006`
Verify and publish your contract:
Go to `https://rinkeby.etherscan.io/` and search by your `transaction hash`
In the `to` section, you should found your `contract address` also link for more info
Contract address: 0xeda8dff34acbef179fed9a2cfe35440176f9db60
Click on the `contract address` and get details
In the contract details page, select `Contract tab`
Now click on `Verify and publish`
Set
Compiler type: Solidity (Single File)
Compiler version: 0.4.17
License Type: As you wish
Click Continue and enter the contract code
Now click `Verify and publish`
You should get your contract byte code and contract ABI
contract ABI: [{"constant":true,"inputs":[],"name":"manager","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pickWinner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"random","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getPlayers","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"enter","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"players","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
Contract bytecode: 6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061062c8061005e6000396000f30060606040523615610076576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063481c6a751461007b5780635d495aea146100d05780635ec01e4d146100e55780638b5b9ccc1461010e578063e97dcb6214610178578063f71d96cb14610182575b600080fd5b341561008657600080fd5b61008e6101e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100db57600080fd5b6100e361020a565b005b34156100f057600080fd5b6100f861034b565b6040518082815260200191505060405180910390f35b341561011957600080fd5b610121610381565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610164578082015181840152602081019050610149565b505050509050019250505060405180910390f35b610180610415565b005b341561018d57600080fd5b6101a3600480803590602001909190505061048f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561026757600080fd5b60018054905061027561034b565b81151561027e57fe5b06905060018181548110151561029057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561031257600080fd5b60006040518059106103215750595b9080825280602002602001820160405250600190805190602001906103479291906104ce565b5050565b60004442600180549050604051808481526020018381526020018281526020019350505050604051809103902060019004905090565b610389610558565b600180548060200260200160405190810160405280929190818152602001828054801561040b57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116103c1575b5050505050905090565b662386f26fc100003411151561042a57600080fd5b6001805480600101828161043e919061056c565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60018181548110151561049e57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b828054828255906000526020600020908101928215610547579160200282015b828111156105465782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906104ee565b5b5090506105549190610598565b5090565b602060405190810160405280600081525090565b8154818355818115116105935781836000526020600020918201910161059291906105db565b5b505050565b6105d891905b808211156105d457600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555060010161059e565b5090565b90565b6105fd91905b808211156105f95760008160009055506001016105e1565b5090565b905600a165627a7a72305820e55011ba9d7e51105bb3b9d66c0740dc3fd5ab963b74c5ad3d1717e7b65e356e0029