GraphemeNFT / rarible-scaffold

MIT License
0 stars 0 forks source link

[FYI] funding local account #13

Closed dcsan closed 3 years ago

dcsan commented 3 years ago

with yarn account you can view your local "deployer" account status

that shows for me that the localhost account doesn't have any funds: I did add some on ropsten, but not sure how to get a localhost faucet

instead I used metamask to send to that local account.

this means I can use yarn mint to mint stuff not via the UI

➜  rarible-scaffold git:(rarible-local) βœ— yarn account
yarn run v1.22.10
$ yarn workspace @scaffold-eth/hardhat account
$ hardhat account

 β€πŸ“¬ Deployer Account is 0x4519d570f9bee8adbe0d84ec536ed325f4ba3dd6
 -- hardhat --  -- -- πŸ“‘
   balance: 0.0
   nonce: 0
 -- localhost --  -- -- πŸ“‘
   balance: 0.0
   nonce: 0
 -- rinkeby --  -- -- πŸ“‘
   balance: 0.0
   nonce: 0
 -- kovan --  -- -- πŸ“‘
   balance: 0.0
   nonce: 0
 -- mainnet --  -- -- πŸ“‘
   balance: 0.0
   nonce: 0
 -- ropsten --  -- -- πŸ“‘
   balance: 0.085882365496127877
   nonce: 14
 -- goerli --  -- -- πŸ“‘
   balance: 0.0
   nonce: 0
 -- xdai --  -- -- πŸ“‘
   balance: 0.0
   nonce: 0
 -- matic --  -- -- πŸ“‘
   balance: 0.0
   nonce: 0
✨  Done in 11.61s.
dcsan commented 3 years ago
eth_sendTransaction
  Contract call:       YourCollectible#rollToMint
  Transaction:         0xe770c5dd8641184f069b98b2f3b9c568e17b8cb926e76c5f377aff3b0f2aa321
  From:                0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
  To:                  0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9
  Value:               0 ETH
  Gas used:            400000 of 400000
  Block #10:           0x1515cf13e40611833722866e77c133688b37f3f7b0c9851c6f62be9380b295f2

  TransactionExecutionError: Transaction ran out of gas

remove gas limit on mint command

await yourCollectible.rollToMint(toAddress, { gasLimit: 400000 })

keepRunning commented 3 years ago

hardhat: { accounts: { mnemonic: mnemonic(), }, },

This will fund your mnemonic accounts when you run hardhat network(yarn chain command)

dcsan commented 3 years ago

actually i added a make command

fund-deployer:
    yarn run send --from 0 --amount 0.5 --to ${deployer}

balance-deployer:
    yarn run balance ${deployer}
dcsan commented 3 years ago
➜  rarible-scaffold git:(rarible-local) make balance-deployer
yarn run balance "0x4519d570f9bee8adbe0d84ec536ed325f4ba3dd6"
yarn run v1.22.10
$ yarn workspace @scaffold-eth/hardhat balance 0x4519d570f9bee8adbe0d84ec536ed325f4ba3dd6
$ hardhat balance 0x4519d570f9bee8adbe0d84ec536ed325f4ba3dd6
0.0 ETH
✨  Done in 1.69s.
➜  rarible-scaffold git:(rarible-local) make fund-deployer
yarn run send --from 0 --amount 0.5 --to "0x4519d570f9bee8adbe0d84ec536ed325f4ba3dd6"
yarn run v1.22.10
$ yarn workspace @scaffold-eth/hardhat send --from 0 --amount 0.5 --to 0x4519d570f9bee8adbe0d84ec536ed325f4ba3dd6
$ hardhat send --from 0 --amount 0.5 --to 0x4519d570f9bee8adbe0d84ec536ed325f4ba3dd6
✨  Done in 1.20s.
➜  rarible-scaffold git:(rarible-local) make balance-deployer
yarn run balance "0x4519d570f9bee8adbe0d84ec536ed325f4ba3dd6"
yarn run v1.22.10
$ yarn workspace @scaffold-eth/hardhat balance 0x4519d570f9bee8adbe0d84ec536ed325f4ba3dd6
$ hardhat balance 0x4519d570f9bee8adbe0d84ec536ed325f4ba3dd6
0.5 ETH