This repository was archived by the owner on Aug 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
feat(ui): Funding Pool v0 #975
Closed
Closed
Changes from all commits
Commits
Show all changes
419 commits
Select commit
Hold shift + click to select a range
8bbc669
QRcode modal nit improvements
NunoAlexandre 6ebf8ac
Update added/removed Receiver styling
NunoAlexandre 1ede8f0
Don't set wallet as connecting until initialize
NunoAlexandre 47f6cee
Reduce transactions status updates polling
NunoAlexandre 0978ae4
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre e272ff0
Update upcoming support design
NunoAlexandre e5911c1
Redesign Wallet Panel
NunoAlexandre 441a82b
Fix screen layout and elements positioning
NunoAlexandre 1dfa927
Make the Incoming component dumber
NunoAlexandre c859bf7
wip: Update outgoing support style
NunoAlexandre 73f238b
Make Receiver(s) editable or view-only
NunoAlexandre 50b191d
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 3f5f306
Please the lint and fix broken pieces
NunoAlexandre 05d52f8
Drop "awaiting scan" section from QRCode modal
NunoAlexandre 2554b8a
Make wallet a singleton
NunoAlexandre 47c445a
Add 'link' icon
NunoAlexandre a153b4c
Add 'Socks' Illustration
NunoAlexandre 8574cdb
Add LinkAddress mock Modal
NunoAlexandre 21b2005
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 41fb295
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 8c3a9e6
Set up stub attestation flow
NunoAlexandre 0d4aa82
wip: New onboarding flow
NunoAlexandre f622ae1
Bind Onboarding sub-component values
NunoAlexandre a0d9c54
Drop Save button from Receivers
NunoAlexandre 8247360
Delete the now old onboarding
NunoAlexandre ac15369
Validate SetBudget input
NunoAlexandre bf610f0
fixup!
NunoAlexandre 39a9bcf
Validate Onboarding TopUp amount
NunoAlexandre 547f3a3
Create onboarding tx stub
NunoAlexandre 55aa2f8
Make onboarding review confirm button a TxButton
NunoAlexandre 2b26006
Fix onboarding stub and close onboarding on success
NunoAlexandre 6c60120
Add Support.svelte for the settled outgoing support
NunoAlexandre e8e2717
Set up basic editing mode for outgoing support
NunoAlexandre 25924cc
wip: Save support settings
NunoAlexandre e3d96ee
refactor: make 'receivers' a Map<Address, Weight>
NunoAlexandre b71bf43
Fix check around changes in receivers
NunoAlexandre c56c849
Only save changed receivers
NunoAlexandre f0b12d2
Add LinkAddress screen
NunoAlexandre 420a141
Make identity.linkedAddress a writable store
NunoAlexandre 1b5d555
Update 'Receiver' styling
NunoAlexandre 6368774
Disable Receivers '+' button on empty input
NunoAlexandre 36b3aba
fix: Refresh changeset on changes to "editing"
NunoAlexandre 7210177
Sort receivers in order of Added, Present, Removed
NunoAlexandre 58e1c48
Move Eth -> Radicle linking to separate component
NunoAlexandre cf1a2f6
Implement the complete attestation modal flow
NunoAlexandre ad691ea
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 501365f
Fix receivers overflow with flex-wrap
NunoAlexandre 779392a
Fix unremovable receivers on onboarding
NunoAlexandre 693c575
Clean up onboarding state check
NunoAlexandre 37d75e9
Fix Receivers horizontal padding
NunoAlexandre 75c0da1
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 2e77d57
Responsively display wallet balance as currency
NunoAlexandre f86c642
Implement wallet disconnect btn in dropdown
NunoAlexandre 637f6d0
Update wallet QRCode modal styling
NunoAlexandre 26ebe15
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 4cbe610
Extract the template out of the onboarding top up
NunoAlexandre be8a054
Use TopUp template in TopUp modal
NunoAlexandre 67e2c2a
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre c2214b3
Make the continue btn a slot in TopUp
NunoAlexandre 1ccc626
Redesign and re-implement the withdraw modal
NunoAlexandre f0a0135
Bump Radicle Contracts
NunoAlexandre 00963ba
Offer withdraw(x) or withdrawAll
NunoAlexandre e007588
Fix imports (#1314)
CodeSandwich 86c33d9
Fix broken reference to ./node_modules/.bin/ethers
NunoAlexandre c5aca6f
Bump Radicle Contracts
NunoAlexandre 0b19f90
Add missing errorMessage prop to TxButton
NunoAlexandre 1da251e
Use EthPool and EthPoolFactory
NunoAlexandre d1f08ad
Fix cash out modal styling
NunoAlexandre 19d153f
Redesign Collect modal
NunoAlexandre ea4d57f
Drop gas info from Transaction
NunoAlexandre ad4ba72
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre d2bf2f6
Persist the identity linkedAddress stub
NunoAlexandre 87b54e3
Update some copy
NunoAlexandre 8f41aa0
fixup!
NunoAlexandre b45e727
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre e552378
Fix Transaction modal closing when selecting other
NunoAlexandre 3ef91e7
Fix transaciton center stack closing on tx updates
NunoAlexandre 68a94c5
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 62d24be
Track yarn.lock changes
NunoAlexandre 3fdce3e
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 9386ea7
Delete obsolete Box component
NunoAlexandre 82cc003
Add WalletConnect icon
NunoAlexandre 6b016c9
Add the walletconnect icon to the QRModal
NunoAlexandre 26ac56a
Design-QA the attestation flow
NunoAlexandre f18a5ef
Design-QA the support onboarding flow
NunoAlexandre fb86099
Fix Withdraw input value validation
NunoAlexandre 1b03508
Drop fixed height for the TopUp modal
NunoAlexandre 10d117d
Fix missing '-' on negative DAI
NunoAlexandre 92711f8
Show custom onboarding text on no receivers
NunoAlexandre 7ae45e4
Namespace Transaction Center components
NunoAlexandre ade9918
Place negative symbol between dai symbol and value
NunoAlexandre 53007ff
Redesign the Transaction modal
NunoAlexandre 758fc38
Include changes to receivers in stored tx
NunoAlexandre 0cc1c63
Show changes to receivers in Transaction summary
NunoAlexandre 37474a4
Format Transaction date accordingly to Figma
NunoAlexandre 542eafa
Update Transaction id/hash style
NunoAlexandre d36bb1a
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 6fbec0d
Fix DAI negative/regular variants
NunoAlexandre 7d3d6a9
Refactor transaction model design
NunoAlexandre 04c0f70
Fix fatal error on withdrawing
NunoAlexandre c6daaa4
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre aca4a01
Use store to its full extent
NunoAlexandre ab85757
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 0d4eada
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre aa65e39
Bump and make radicle-contracts a local dep
NunoAlexandre f605e3f
Support setting multiple receivers in batch
NunoAlexandre 5dee7f9
Fix validation row on the Support screen
NunoAlexandre 2c8e86c
Fix attestation flow closing unexpectedly
NunoAlexandre e078db2
Fix Transaction Center collapse/expand button
NunoAlexandre fd40502
Don't set receivers if none to set
NunoAlexandre d501dd9
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 92789b4
Fix inlined Dai horizontal margins
NunoAlexandre 5b2b485
Center-align list of Receivers in the onboarding
NunoAlexandre 2fb6ad6
Only show Tx 'Amount' when sensible
NunoAlexandre 6276666
Delete Gwei component
NunoAlexandre 5e55607
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 7e5c31f
Fix tx chain run over
NunoAlexandre 4d28815
Drop attestation flow
NunoAlexandre 24040e6
Sort settings.ts types by hierarchy
NunoAlexandre b01eb5a
Add feature flags field to the Settings
NunoAlexandre bfb1889
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 5b95e4a
Actually update funding feature flag
NunoAlexandre 73024f7
Hide funding feat behind funding feature flag
NunoAlexandre 903a406
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre fc2d60a
wallet: Refresh connected account data every 3s
NunoAlexandre 77e1fd2
Say yes to setting up initial balance
NunoAlexandre a9d744b
Document the Funding feature and setup
NunoAlexandre cb6d47e
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre bd5a86f
fixup! Fix link to funding dev setup image
NunoAlexandre 6990691
Fix funding-dev-setup.svg missing bg color
NunoAlexandre d2fa7fc
Make funding-dev-setup.svg text more readable
NunoAlexandre 6b0a0b4
Fix link
NunoAlexandre c60cb11
Fix code snippet to clone wc test wallet repo
NunoAlexandre a40a925
Update docs on the new yarn command
NunoAlexandre a36d284
wip: Integrate all things ERC-20
NunoAlexandre 249e321
Fix erc20Allowance()
NunoAlexandre cca0e6b
Set dev account intial erc20 token balance
NunoAlexandre 16c71f9
Use the right erc20 pool contract address
NunoAlexandre 95a4078
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre a915393
Merge remote-tracking branch 'origin/feat/funding' into feat/funding-…
NunoAlexandre 8213608
Add new Erc20Allowance tx variant
NunoAlexandre f8a2ea1
Add ERC-20 approval step to the support onboarding
NunoAlexandre f1e1d18
Drop stub code to approve ERC-20
NunoAlexandre 2080ed2
Store tx record for the ERC-20 allowance
NunoAlexandre 6a95f7d
Add right illustration to Erc20Allowance modal
NunoAlexandre 5a3d931
Add node v12 to list of getting started steps
NunoAlexandre fd82170
Update QRCode modal style
NunoAlexandre 3fc3d3e
Drop Icon/WalletConnect
NunoAlexandre 6474bfc
Read user's balance from the ERC20 token contract
NunoAlexandre 5d76df3
Add 'get' method to remote Store
NunoAlexandre 533e2cc
Make erc20Allowance an attribute of PoolData
NunoAlexandre 56459f9
Make remote.Store.get -> unwrap
NunoAlexandre af24778
Read poolData.erc20Allowance to resolve onboarding
NunoAlexandre 6b71d19
Use remote store unwrap method in Withdraw too
NunoAlexandre 00b2989
Fix link to WalletConnect supported wallets
NunoAlexandre 4da121b
r/ganachi/ganache
NunoAlexandre d2f655f
Update FUNDING.md
NunoAlexandre 5a09bb1
Mention that the local ganache uses no real assets
NunoAlexandre f8e34b3
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 8e17df3
r/Ganachi/Ganache
NunoAlexandre c12dca7
Fix balance dai symbol color
NunoAlexandre 67dbdeb
Fix all "implicitly has an 'any' type"
NunoAlexandre 163d538
Drop tmp code
NunoAlexandre 23d57e5
Use Erc20 contract and factory instead of Rad
NunoAlexandre 478f2c2
Fix warning with parsing json file of dependency
NunoAlexandre 0f33af4
Fix circular dependency warning caused by Identity
NunoAlexandre 42e27a1
Ignore two specific 3rd-party warnings
NunoAlexandre deed9c7
Support onboarding in a batch tx
NunoAlexandre f5aae82
Reduce rollup warnings noise
NunoAlexandre 17a4dea
Update support plan in a batch transaction
NunoAlexandre 8392617
Store the new list of receivers instead of changes
NunoAlexandre 19db263
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 3ea5f37
Offer ergonomic in-between Pool Contract API
NunoAlexandre d928fd5
Store user inputed topUp amount
NunoAlexandre 3453fed
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 12d0a47
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 8c8af28
Document how to setup the Radicle Contracts locally
NunoAlexandre 0effe6b
Add ethers-cli dependency (#1493)
CodeSandwich 9e75784
Update contracts addresses
NunoAlexandre 22a72ea
Break free from node v12 for the ethereum setup
NunoAlexandre d515d9b
Drop 'currency' style element
NunoAlexandre c118793
Fix issue with transactions with the same hash
NunoAlexandre 12a844c
Undo styling changes to the notifications
NunoAlexandre a9dff3c
Fix QRCode modal on dark mode
NunoAlexandre 3c189fa
Update notification waiting for tx approval
NunoAlexandre 97f0d3b
Drop 'success' notification type
NunoAlexandre a1a260c
Address design QA part 1
NunoAlexandre 38d311f
Design QA part 2
NunoAlexandre e7c44a0
Design QA part 3
NunoAlexandre 7c325b9
Proceed funding onboarding by pressing enter
NunoAlexandre add358a
Fix Dai color bug when switching between txs
NunoAlexandre acd9b72
Improve Dai component coloring and styling
NunoAlexandre 5447b09
Validate valid Ethereum address input
NunoAlexandre 08d3860
Fix typo
NunoAlexandre 10852e9
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre ff97593
Have radicle-contracts as a git dependency
NunoAlexandre cad38e3
Make the radicle-contracts a git dependency again
NunoAlexandre 8e68240
Fix circular dependency warning
NunoAlexandre db092fd
Don't show TransactionCenter til session unsealed
NunoAlexandre e1420b7
Refactor Hotkeys disabled before session unsealed
NunoAlexandre cc7fb8d
Revert "Refactor Hotkeys disabled before session unsealed"
NunoAlexandre 6eb1517
Run prettier
NunoAlexandre 4610454
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 74db89e
Address all Svelte and Typescript errors
NunoAlexandre 61a5b07
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre af34d1d
Update ui/src/transaction.ts
NunoAlexandre 5f3f5be
Update ui/Modal/Transaction.svelte
NunoAlexandre d52146a
feat(ui): label default branch in RevisionSelector (#1503)
juliendonck 477210a
Address some of the review comments
NunoAlexandre af10e19
fixup!
NunoAlexandre 064a192
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre 55342e6
Address Rudolf's review part 1
NunoAlexandre 3fc787a
Delete all debug logs
NunoAlexandre c250fa0
s/_pool/fundingPool
NunoAlexandre b15e1ab
Drop new illustrations in favour of Emoji
NunoAlexandre 078b50a
Center Plus icon vertically
NunoAlexandre f0bf73e
Fix Funding feature flag toggle issue
NunoAlexandre 75292ae
Run prettier
NunoAlexandre e0c0fd3
Fix balance sufficiency check
NunoAlexandre ee4bb02
Handle network failures when updating tx statuses
NunoAlexandre 3aadc81
Make SidebarLayout better responsive
NunoAlexandre bd1ec2e
Move attestation sub-modals to Modal/Funding/
NunoAlexandre af40dc3
Move Onboarding sub-modals to Modals/
NunoAlexandre 6ec8e51
Move Funding Pool modals to Modal/Funding/Pool
NunoAlexandre e80cffe
Move LinkAddress screen to Screen/Funding/
NunoAlexandre 7a512b2
Move outgoing support screens under ui/Screen
NunoAlexandre 186120a
Periodically refresh the pool data
NunoAlexandre 744af5e
Simplify TxButton
NunoAlexandre 24d1ea6
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre edc0ad5
Fix Transaction Center z-index placement
NunoAlexandre 84170c4
Exodus from 'px' to 'rem'
NunoAlexandre f40a1ac
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre fbb3a47
Use the new notifications api
NunoAlexandre 3e40605
Update FUNDING.md
NunoAlexandre 06fdcf3
Address review round #2 part 1
NunoAlexandre c672bca
Merge remote-tracking branch 'origin/master' into feat/funding
NunoAlexandre bb0b4fa
Use BigNumber instead of BigNumberish
NunoAlexandre a911260
s/erc20/dai
NunoAlexandre f36ac82
Structure funding-related errors
NunoAlexandre dbf7eab
Prune docstring
NunoAlexandre 077053b
Move all funding things behind isExperimental
NunoAlexandre eb50360
Update FUNDING.md
NunoAlexandre e3d3085
Fix issue with inappropriate scrolling
NunoAlexandre 77b6f62
Delete unecessary tx.wait() calls
NunoAlexandre bace2c0
Update ui/Screen/Funding/Pool/Outgoing/GetStarted.svelte
NunoAlexandre d18d4d8
Update radicle-contract dependency
NunoAlexandre 9a3953b
Cap CurrencyDai long line
NunoAlexandre 74150fb
Fix wrong reference
NunoAlexandre 1226e87
Improve wallet error messages
NunoAlexandre cf3d026
fixup!
NunoAlexandre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
### Overview | ||
|
||
Three moving pieces back the Radicle Funding experiences: | ||
|
||
- An Ethereum wallet, owned by the user | ||
- A connection between the Radicle Upstream (the app) and said Ethereum wallet | ||
- The Radicle Contracts (Ethereum smart-contracts) | ||
|
||
The funding experiences provided in the Radicle Upstream are Ethereum-based, | ||
meaning that actions such as adding users to the list of receivers, collect | ||
incoming support funds, and others, translate into ethereum transactions. | ||
|
||
For users to approve those transactions originated in the app, they need to | ||
establish a connection between an Ethereum wallet and the app. We provide this | ||
capability through a WalletConnect integration. A substantial number of Ethereum | ||
wallets support WalletConnect. [You can find the complete list here][wcw]. | ||
|
||
Once a wallet is connected to the app, the funding experiences become available | ||
to the user. The user can now set up and edit their support, receive funds, etc. | ||
All of these actions translate into transactions the user must review, (i.e., | ||
approve or reject) on their connected wallet. | ||
|
||
These same transactions are provided and ran by the [Radicle Contracts][rc], our | ||
custom Ethereum smart-contracts. | ||
|
||
|
||
#### Development environment | ||
|
||
In the development environment, we set up these three pieces as follows: | ||
|
||
- A local WalletConnect test wallet instance | ||
|
||
This instance will play the role of a real wallet: | ||
- It provides a couple of test accounts that we use in development. | ||
- The transactions triggered in the app will be prompted here for the user | ||
to approve or reject. | ||
|
||
- A local ganache instance | ||
|
||
Ganache provides a local Ethereum RPC client for testing and development. The | ||
Radicle Contracts are deployed to this instance. Here, we also set an initial | ||
balance of the account we choose for development purposes. | ||
|
||
For piece of mind, note that this instance has no connection to other networks | ||
such as mainnet or testnet. Therefore, no real assets are ever used. Feel free | ||
to play around! | ||
|
||
![Radicle Funding Development Set up][dev-setup] | ||
|
||
**Getting started** | ||
|
||
- Install [walletconnect-test-wallet][wctw] | ||
|
||
- `git clone [email protected]:radicle-dev/walletconnect-test-wallet.git` | ||
- `cd walletconnect-test-wallet` | ||
- `npm install` | ||
|
||
- Set up the local test ethereum account | ||
|
||
- Run `npm run start` within `walletconnect-test-wallet`. It should open the | ||
test wallet in your browser at `localhost:3000`. | ||
|
||
- Copy the full Ethereum address provided at the top of the page. | ||
|
||
- Now, in `radicle-upstream`, run: | ||
|
||
- `yarn install` | ||
- `mkdir sandbox` | ||
- `touch sandbox/.local-eth-account` | ||
- Finally, paste the copied address in the previous step into this file. | ||
|
||
**Running** | ||
|
||
With everything installed and set up, run the following commands in different | ||
tabs: | ||
|
||
- `npm run start` within `walletconnect-test-wallet` | ||
- `yarn ethereum:start` within `radicle-upstream` | ||
`RADICLE_UPSTREAM_EXPERIMENTAL=true yarn start` within `radicle-upstream` | ||
- Once the app is running, enable the funding feature in the Upstream settings | ||
|
||
|
||
[wcw]:https://walletconnect.org/wallets/ | ||
[wctw]:https://github.com/radicle-dev/walletconnect-test-wallet | ||
[rc]:https://github.com/radicle-dev/radicle-contracts | ||
[dev-setup]:./funding-dev-setup.svg "Radicle Funding Development Set up" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env node | ||
|
||
const { deployAll } = require("radicle-contracts"); | ||
const ethers = require("ethers"); | ||
const fs = require("fs"); | ||
|
||
main().catch(e => { | ||
console.error(e); | ||
process.exit(1); | ||
}); | ||
|
||
async function main() { | ||
const provider = new ethers.providers.JsonRpcProvider( | ||
"http://localhost:8545" | ||
); | ||
const signer = provider.getSigner(0); | ||
const txCount = await signer.getTransactionCount(); | ||
if (txCount !== 0) { | ||
throw new Error( | ||
"Deployer account has non-zero transaction count. You need to reset your chain" | ||
); | ||
} | ||
|
||
console.log("\n### Deploying the Radicle Contracts...\n"); | ||
const contracts = await deployAll(signer); | ||
console.log(`Rad token deployed at ${contracts.rad.address.toLowerCase()}`); | ||
console.log(`ENS deployed at ${contracts.ens.address.toLowerCase()}`); | ||
console.log( | ||
`Eth Pool deployed at ${contracts.ethPool.address.toLowerCase()}` | ||
); | ||
console.log( | ||
`Erc20 Pool deployed at ${contracts.erc20Pool.address.toLowerCase()}` | ||
); | ||
console.log("Done.\n"); | ||
|
||
const devEthAccount = fs | ||
.readFileSync("sandbox/.local-eth-account", "utf-8") | ||
.trim(); | ||
|
||
// Set the initial balance of the used erc20 token for the development account. | ||
await (await contracts.rad.transfer(devEthAccount, 98765)).wait(); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Run a local ethereum node and deploy the latest contracts to it. | ||
# | ||
|
||
set -eumo pipefail | ||
|
||
node_modules/.bin/ganache-cli \ | ||
--mnemonic "image napkin cruise dentist name plunge crisp muscle nest floor vessel blush" \ | ||
--defaultBalanceEther 1000 \ | ||
"$@" & | ||
|
||
function stop_ganache() { | ||
kill %1 2>/dev/null || true | ||
fg %1 2>/dev/null || true | ||
} | ||
|
||
trap stop_ganache SIGINT EXIT SIGTERM | ||
|
||
sleep 4 | ||
|
||
echo "Deploying the Radicle Dev Contracts..." | ||
./scripts/deploy-dev-contracts.js; | ||
echo "Done" | ||
|
||
echo "Adding funds to your account..." | ||
ethers --rpc http://localhost:8545 --account-rpc 0 --yes send $(< ./sandbox/.local-eth-account) 10 | ||
echo "Done" | ||
|
||
fg %1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.