-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #300 from neonlabsorg/main
Align downsteam with production
- Loading branch information
Showing
39 changed files
with
711 additions
and
1,024 deletions.
There are no files selected for viewing
This file contains 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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,37 @@ | ||
--- | ||
title: "Configure Foundry" | ||
proofedDate: 20231116 | ||
iterationBy: na | ||
includedInSite: true | ||
approvedBy: na | ||
comment: Killing the ## What next? See the [tutorial on how to use Foundry](/docs/developing/deploy_facilities/using_foundry) to deploy to Neon EVM. as this is killing the build todo -- return this later | ||
--- | ||
|
||
Foundry is a blazing fast, portable,modular toolkit for Ethereum application development written in Rust. | ||
|
||
## Introduction | ||
|
||
This page details several parameters required to configure Foundry. The Foundry framework isn't described here; find that in the [Foundry documentation](https://book.getfoundry.sh). | ||
|
||
## Prerequisites | ||
- cURL | ||
|
||
## Foundry configuration | ||
|
||
Unlike other toolkits, Foundry doesn't have a config file to hold the chain parameters, instead, parameters are passed into commands. For example, this comand deploys a smart contract: | ||
|
||
``` | ||
forge create --rpc-url $RPC_URL_DEVNET \ | ||
--private-key $PRIVATE_KEY \ | ||
--constructor-args "Test ERC20 Token" "TERC20" --legacy \ | ||
src/TestERC20/TestERC20.sol:TestERC20 | ||
``` | ||
|
||
The parameters for `forge create` command include: | ||
* `--rpc-url`: RPC URL | ||
* `--private-key`: The private key of the transaction signer | ||
* `--constructor-args`: The constructor arguments to be passed to the contract that is being deployed | ||
* `--legacy`: This parameter is being passed to use legacy transactions _(Neon EVM currently [doesn't support EIP-1559 transactions](/docs/evm_compatibility/overview#shared-standards-and-features))_ | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains 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,99 @@ | ||
--- | ||
title: "Configure Hardhat" | ||
proofedDate: 20231116 | ||
iterationBy: na | ||
includedInSite: true | ||
approvedBy: na | ||
comment: | ||
--- | ||
|
||
import WhatHardHat from '../../single-source-snippets/_hardhat.mdx' | ||
|
||
import ConfigHardHat from '../../single-source-snippets/_hardhat_config.mdx' | ||
|
||
|
||
## Introduction | ||
|
||
<WhatHardHat/> | ||
|
||
The Hardhat framework isn't described here; find that in the [Hardhat documentation](https://hardhat.org/getting-started/#overview). | ||
|
||
## Prerequisites | ||
- `NodeJS` | ||
|
||
## The Hardhat Configuration File | ||
|
||
<ConfigHardHat/> | ||
|
||
We provide a full example of the `hardhat.config.js` configuration file for connecting Hardhat to a Devnet Proxy using the one-way library on Node.js: | ||
|
||
### hardhat.config.js | ||
|
||
```js | ||
require("@nomicfoundation/hardhat-toolbox"); | ||
require("dotenv").config(); | ||
|
||
/** @type import('hardhat/config').HardhatUserConfig */ | ||
module.exports = { | ||
solidity: "0.8.21", | ||
defaultNetwork: "neondevnet", | ||
etherscan: { | ||
apiKey: { | ||
neonevm: "test" | ||
}, | ||
customChains: [ | ||
{ | ||
network: "neonevm", | ||
chainId: 245022926, | ||
urls: { | ||
apiURL: "https://devnet-api.neonscan.org/hardhat/verify", | ||
browserURL: "https://devnet.neonscan.org" | ||
} | ||
}, | ||
{ | ||
network: "neonevm", | ||
chainId: 245022934, | ||
urls: { | ||
apiURL: "https://api.neonscan.org/hardhat/verify", | ||
browserURL: "https://neonscan.org" | ||
} | ||
} | ||
] | ||
}, | ||
networks: { | ||
neondevnet: { | ||
url: "https://devnet.neonevm.org", | ||
accounts: [process.env.PRIVATE_KEY_OWNER], | ||
chainId: 245022926 | ||
}, | ||
neonmainnet: { | ||
url: "https://neon-proxy-mainnet.solana.p2p.org", | ||
accounts: [process.env.PRIVATE_KEY_OWNER], | ||
chainId: 245022934 | ||
} | ||
} | ||
}; | ||
``` | ||
|
||
The parameters for `module.exports` include: | ||
* `solidity`: version of Solidity used | ||
* `defaultNetwork`: default chain (for deploying or testing) | ||
* `etherscan`: settings used to verify contracts on-chain [read more here](https://hardhat.org/hardhat-runner/docs/guides/verifying) | ||
* `networks`: the list of the supported networks | ||
* `neondevnet`: | ||
* `url`: RPC URL | ||
* `accounts`: an array of deployer's private keys; in the current example, PRIVATE_KEY_OWNER is stored inside .env file | ||
* `chainId`: the network's chain ID | ||
|
||
Note that `url` and `chainId` can be retrieved from the RPC endpoints table and/or [Chainlist](https://chainlist.org/?search=Neon+EVM&testnets=true). | ||
|
||
## What next? | ||
|
||
See the [tutorial on how to use Hardhat to deploy to Neon EVM](/docs/developing/deploy_facilities/using_hardhat). | ||
|
||
## Gotchas | ||
|
||
:::info | ||
Remember, the deployer wallet address needs to have enough tokens to cover the gas cost of a deployment. | ||
> Get [NEON for Devnet](developing/utilities/faucet.md). | ||
::: |
Oops, something went wrong.