Skip to content

Commit

Permalink
fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
MalteHerrmann committed Jan 23, 2024
1 parent 294054f commit f664540
Show file tree
Hide file tree
Showing 27 changed files with 206 additions and 128 deletions.
33 changes: 23 additions & 10 deletions docs/develop/api/ethereum-json-rpc/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ Find below a list of JSON-RPC methods supported on Evmos, sorted by namespaces.

## Curl Examples Explained

The curl options below might return a response where the node complains about the content type, this is because the `--data` option sets the content type to `application/x-www-form-urlencoded`. If your node does complain, manually set the header by placing `-H "Content-Type: application/json"` at the start of the call.
The curl options below might return a response where the node complains about the content type,
this is because the `--data` option sets the content type to `application/x-www-form-urlencoded`.
If your node does complain, manually set the header
by placing `-H "Content-Type: application/json"` at the start of the call.

The examples also do not include the URL/IP & port combination which must be the last argument given to curl e.x. `127.0.0.1:8545`

Expand Down Expand Up @@ -277,7 +280,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_protocolVersion","params":[]

### `eth_syncing`

The sync status object may need to be different depending on the details of Tendermint's sync protocol. However, the 'synced' result is simply a boolean, and can easily be derived from Tendermint's internal sync state.
The sync status object may need to be different depending on the details of Tendermint's sync protocol.
However, the 'synced' result is simply a boolean, and can easily be derived from Tendermint's internal sync state.

```json
// Request
Expand Down Expand Up @@ -468,15 +472,18 @@ Sends transaction from given account to a given account.

`to`: `DATA`, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.

`gas`: QUANTITY - (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas.
`gas`: QUANTITY - (optional, default: 90000) Integer of the gas provided for the transaction execution.
It will return unused gas.

`gasPrice`: QUANTITY - (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas

`value`: QUANTITY - value sent with this transaction

`data`: `DATA` - The compiled code of a contract OR the hash of the invoked method signature and encoded parameters. For details see Ethereum Contract ABI
`data`: `DATA` - The compiled code of a contract OR the hash of the invoked method signature and encoded parameters.
For details see Ethereum Contract ABI.

`nonce`: QUANTITY - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
`nonce`: QUANTITY - (optional) Integer of a nonce.
This allows to overwrite your own pending transactions that use the same nonce.

```json
// Request
Expand Down Expand Up @@ -515,13 +522,15 @@ Executes a new message call immediately without creating a transaction on the bl

`to`: `DATA`, 20 Bytes - The address the transaction is directed to.

`gas`: QUANTITY - gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.
`gas`: QUANTITY - gas provided for the transaction execution.
eth_call consumes zero gas, but this parameter may be needed by some executions.

`gasPrice`: QUANTITY - gasPrice used for each paid gas

`value`: QUANTITY - value sent with this transaction

`data`: `DATA` - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation
`data`: `DATA` - (optional) Hash of the method signature and encoded parameters.
For details see Ethereum Contract ABI in the Solidity documentation

- Block number or Block Hash ([EIP-1898](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1898.md))

Expand Down Expand Up @@ -911,7 +920,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"personal_lockAccount","params":[
**Private**: Requires authentication.
:::

Generates a new private key and stores it in the key store directory. The key file is encrypted with the given passphrase. Returns the address of the new account.
Generates a new private key and stores it in the key store directory.
The key file is encrypted with the given passphrase.
It returns the address of the new account.

#### Parameters

Expand Down Expand Up @@ -1184,11 +1195,13 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setExtra","params":["data"
**Private**: Requires authentication.
:::

Sets the minimal gas price used to accept transactions. Any transaction below this limit is excluded from the validator block proposal process.
Sets the minimal gas price used to accept transactions.
Any transaction below this limit is excluded from the validator block proposal process.

This method requires a `node` restart after being called because it changes the configuration file.

Make sure your `evmosd start` call is not using the flag `minimum-gas-prices` because this value will be used instead of the one set on the configuration file.
Make sure your `evmosd start` call is not using the flag `minimum-gas-prices`,
because this value will be used instead of the one set on the configuration file.

#### Parameters

Expand Down
9 changes: 7 additions & 2 deletions docs/develop/api/tendermint-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ More on Events:

### Subscribing to Events via Websocket

Tendermint Core provides a [Websocket](https://docs.tendermint.com/v0.34/tendermint-core/subscription.html) connection to subscribe or unsubscribe to Tendermint `Events`. To start a connection with the Tendermint websocket you need to define the address with the `--rpc.laddr` flag when starting the node (default `tcp://127.0.0.1:26657`):
Tendermint Core provides a [Websocket](https://docs.tendermint.com/v0.34/tendermint-core/subscription.html) connection
to subscribe or unsubscribe to Tendermint `Events`.
To start a connection with the Tendermint websocket you need to
define the address with the `--rpc.laddr` flag when starting the node
(default `tcp://127.0.0.1:26657`):

```bash
evmosd start --rpc.laddr="tcp://127.0.0.1:26657"
Expand Down Expand Up @@ -98,7 +102,8 @@ The main events you can subscribe to are:
- `ValidatorSetUpdates`: Contains validator set updates for the block.
:::tip
👉 The list of events types and values for each Cosmos SDK module can be found in the [Modules Specification](./../../../../protocol/modules/) section.
👉 The list of events types and values for each Cosmos SDK module
can be found in the [Modules Specification](./../../../../protocol/modules/) section.
Check the `Events` page to obtain the event list of each supported module on Evmos.
:::
Expand Down
1 change: 1 addition & 0 deletions docs/develop/graphs-indexers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ find all transactions that include a specific token. This type of indexing can g
of decentralized applications and make it easier for users to access and analyze the data stored on the blockchain.

## List of Graph Indexers

### Mainnet

| Service | Description | Support | Links & Features |
Expand Down
15 changes: 10 additions & 5 deletions docs/develop/oracles/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,15 @@ This enables smart contracts to respond to real-world events, trigger automated

In this diagram:

* External Data Source refers to a source of data outside the blockchain network, such as a stock market, weather service, or other external API.
* Oracle Service is a third-party service that acts as a bridge between the external data source and the smart contract. It retrieves the data from the external source and provides it to the smart contract.
* Smart Contract is a self-executing contract that is deployed on the blockchain network. It uses the data provided by the oracle to perform certain actions, such as releasing funds or triggering events.
* External Data Source refers to a source of data outside the blockchain network,
such as a stock market, weather service, or other external API.
* Oracle Service is a third-party service that acts as a bridge between the external data source and the smart contract.
It retrieves the data from the external source and provides it to the smart contract.
* Smart Contract is a self-executing contract that is deployed on the blockchain network.
It uses the data provided by the oracle to perform certain actions, such as releasing funds or triggering events.
* API Call refers to the request made by the smart contract to the oracle service, asking for the required external data.
* Retrieve External Data refers to the process of retrieving the requested data from the external data source via the API call.
* Use External Data refers to the process of using the retrieved data in the smart contract to perform actions, such as condition checking and state changes.
* Retrieve External Data refers to the process of retrieving the requested data
from the external data source via the API call.
* Use External Data refers to the process of using the retrieved data in the smart contract to perform actions,
such as condition checking and state changes.
* Return Result refers to the process of returning the result of the action performed in the smart contract back to the oracle.
3 changes: 2 additions & 1 deletion docs/develop/smart-contracts/evm-extensions/ibc-transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ sidebar_position: 5

## Solidity Interface & ABI

`ICS20.sol` - previously known as `IBCTransfer.sol` - is an interface through which Solidity contracts can interact with the IBC protocol on Evmos chain.
`ICS20.sol` - previously known as `IBCTransfer.sol` -
is an interface through which Solidity contracts can interact with the IBC protocol on Evmos chain.
This is convenient for developers as they don’t need to know the implementation details behind the `transfer` module in [IBC-go](https://ibc.cosmos.network/).
Instead, they can perform IBC transfers using the Ethereum interface they are familiar with.
An example of a simple implementation can be found in the [evmos/extensions repo](https://github.com/evmos/extensions/tree/main/examples/simple-ibc-transfer).
Expand Down
3 changes: 2 additions & 1 deletion docs/develop/smart-contracts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ implementation, such as hashing, elliptic curve cryptography, and modular expone

By adding custom EVM extensions to Ethereum's basic feature set,
Evmos allows developers to use previously unavailable functionality in smart contracts, like staking and governance operations.
This will allow more complex smart contracts to be built on Evmos and further improves the interoperability between Cosmos and Ethereum.
This will allow more complex smart contracts to be built on Evmos
and further improves the interoperability between Cosmos and Ethereum.
It also is a key feature to achieve Evmos' vision of being the definitive dApp
chain, where any dApp can be deployed once and users can interact with
a wide range of different blockchains natively.
Expand Down
34 changes: 28 additions & 6 deletions docs/develop/tools/tools-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,37 @@ sidebar_position: 4

## Smart Contract Development Tools

- [Remix](https://remix.ethereum.org/#optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.17+commit.8df45f5f.js) is a free, browser-based Integrated Development Environment (IDE) for writing, testing, and deploying smart contracts on the Ethereum blockchain. It is designed to make it easier for developers to get started with building decentralized applications (dapps) by providing a simple and user-friendly interface for writing and deploying smart contracts. With Remix, you can write, test, and deploy smart contracts written in Solidity. It also includes debugging tools and a simulation environment for testing contracts before deploying them to the blockchain. The tool provides plugins as well.
- [Truffle Suite](https://trufflesuite.com/docs/) contains a suite of comprehensive tools to streamline the process of building and testing smart contracts, and deploying them to any EVM network, like EVMOS network in Javascript/Typescript. The suite contains [Truffle](https://trufflesuite.com/docs/truffle/) to make compiling, testing, debugging, and deploying smart contract development. [Ganache](https://trufflesuite.com/docs/ganache/) provides easy and fast local blockchain development environment with UI and CLI functionalities. [Drizzle](https://trufflesuite.com/docs/drizzle/) packs frontend libraries that enables standard-compliant wallet connection, account, and contract state management through React components.
- [Foundry](https://getfoundry.sh/) is RUST toolkit that enables fast, portable, and modular application development for Ethereum and EVM-compatible chains.
- [Hardhat](https://hardhat.org/) is a JS/TS library that allow comprehensive testing, development, and deploying smart contracts. Hardhat contains many [plugins](https://hardhat.org/hardhat-runner/plugins) to aid further developments.
- [Remix](https://remix.ethereum.org/#optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.17+commit.8df45f5f.js)
is a free, browser-based Integrated Development Environment (IDE)
for writing, testing, and deploying smart contracts on the Ethereum blockchain.
It is designed to make it easier for developers to get started with building decentralized applications (dapps)
by providing a simple and user-friendly interface for writing and deploying smart contracts.
With Remix, you can write, test, and deploy smart contracts written in Solidity.
It also includes debugging tools and a simulation environment
for testing contracts before deploying them to the blockchain.
The tool provides plugins as well.
- [Truffle Suite](https://trufflesuite.com/docs/) contains a suite of comprehensive tools
to streamline the process of building and testing smart contracts,
and deploying them to any EVM network, like EVMOS network in Javascript/Typescript.
The suite contains [Truffle](https://trufflesuite.com/docs/truffle/)
to make compiling, testing, debugging, and deploying smart contract development.
[Ganache](https://trufflesuite.com/docs/ganache/) provides easy and fast local blockchain development environment
with UI and CLI functionalities.
[Drizzle](https://trufflesuite.com/docs/drizzle/) packs frontend libraries
that enables standard-compliant wallet connection, account,
and contract state management through React components.
- [Foundry](https://getfoundry.sh/) is RUST toolkit that enables fast, portable,
and modular application development for Ethereum and EVM-compatible chains.
- [Hardhat](https://hardhat.org/) is a JS/TS library that allow comprehensive testing, development, and deploying smart contracts.
Hardhat contains many [plugins](https://hardhat.org/hardhat-runner/plugins) to aid further developments.

## Open Sourced Contracts

- [OpenZeppelin](https://www.openzeppelin.com/contracts) contains battle-tested libraries of smart contracts for Ethereum-compatible chains and includes the most used ERC standards.
- [OpenZeppelin](https://www.openzeppelin.com/contracts) contains battle-tested libraries of smart contracts
for Ethereum-compatible chains and includes the most used ERC standards.

## IDE

- [Truffle for VSCode](https://trufflesuite.com/docs/vscode-ext/) is a Visual Studio Code extension that simplifies how you create, build, debug, and deploy smart contracts on Ethereum and EVM-compatible blockchains.
- [Truffle for VSCode](https://trufflesuite.com/docs/vscode-ext/) is a Visual Studio Code extension
that simplifies how you create, build, debug,
and deploy smart contracts on Ethereum and EVM-compatible blockchains.
10 changes: 7 additions & 3 deletions docs/protocol/concepts/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Creating a mnemonic phrase gives you control of many accounts,
all accessible with that same phrase.

Cosmos blockchains, like Evmos, support creating accounts with mnemonic phrases,
otherwise known as [hierarchical deterministic key generation](https://github.com/confio/cosmos-hd-key-derivation-spec) (HD keys).
otherwise known as
[hierarchical deterministic key generation](https://github.com/confio/cosmos-hd-key-derivation-spec) (HD keys).
This allows the user to create accounts on multiple blockchains
without having to manage multiple secrets.

Expand Down Expand Up @@ -117,7 +118,8 @@ There are 3 main types of HRP for the `Addresses`/`PubKeys` available by default

### Address formats for clients

`EthAccount` can be represented in both [Bech32](https://en.bitcoin.it/wiki/Bech32) (`evmos1...`) and hex (`0x...`) formats for Ethereum's Web3 tooling compatibility.
`EthAccount` can be represented in both [Bech32](https://en.bitcoin.it/wiki/Bech32) (`evmos1...`)
and hex (`0x...`) formats for Ethereum's Web3 tooling compatibility.

The Bech32 format is the default format for Cosmos-SDK queries and transactions through CLI and REST
clients. The hex format on the other hand, is the Ethereum `common.Address` representation of a
Expand Down Expand Up @@ -213,7 +215,9 @@ curl -X GET "http://localhost:10337/cosmos/auth/v1beta1/accounts/evmos14au322k9m

### JSON-RPC

To retrieve the Ethereum hex address using Web3, use the JSON-RPC [`eth_accounts`](./../../develop/api/ethereum-json-rpc/methods#eth-accounts) or [`personal_listAccounts`](./../../develop/api/ethereum-json-rpc/methods#personal-listAccounts) endpoints:
To retrieve the Ethereum hex address using Web3,
use the JSON-RPC [`eth_accounts`](./../../develop/api/ethereum-json-rpc/methods#eth-accounts)
or [`personal_listAccounts`](./../../develop/api/ethereum-json-rpc/methods#personal-listAccounts) endpoints:

```bash
# query against a local node
Expand Down
6 changes: 4 additions & 2 deletions docs/protocol/concepts/encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ support Amino in the EVM module, but it is supported for all other Cosmos SDK mo

### RLP

Recursive Length Prefix ([RLP](https://eth.wiki/en/fundamentals/rlp)), is an encoding/decoding algorithm that serializes a message and
Recursive Length Prefix ([RLP](https://eth.wiki/en/fundamentals/rlp)),
is an encoding/decoding algorithm that serializes a message and
allows for quick reconstruction of encoded data. Evmos uses RLP to encode/decode Ethereum
messages for JSON-RPC handling to conform messages to the proper Ethereum format. This allows
messages to be encoded and decoded in the exact format as Ethereum's.

The `x/evm` transactions (`MsgEthereumTx`) encoding is performed by casting the message to a go-ethereum's `Transaction` and then marshaling the transaction data using RLP:
The `x/evm` transactions (`MsgEthereumTx`) encoding is performed by casting the message to a go-ethereum's `Transaction`
and then marshaling the transaction data using RLP:

```go
// TxEncoder overwrites sdk.TxEncoder to support MsgEthereumTx
Expand Down
8 changes: 4 additions & 4 deletions docs/protocol/concepts/keyring.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 7
Create, import, export and delete keys using the CLI keyring.

The keyring holds the private/public keypairs used to interact with the node. For instance, a validator key needs to be
set up before running the node, so that blocks can be correctly signed. The private key can be stored in different
set up before running the node, so that blocks can be correctly signed. The private key can be stored in different
locations, called ["backends"](#keyring-backends), such as a file or the operating system's own key storage.

:::tip
Expand Down Expand Up @@ -38,14 +38,14 @@ MY_VALIDATOR_ADDRESS=$(evmosd keys show dev0 -a)
```

This command generates a new 24-word mnemonic phrase, persists it to the relevant backend, and outputs information about
the keypair. If this keypair will be used to hold value-bearing tokens, be sure to write down the mnemonic phrase
the keypair. If this keypair will be used to hold value-bearing tokens, be sure to write down the mnemonic phrase
somewhere safe!

By default, the keyring generates a `eth_secp256k1` key. The keyring also supports `ed25519` keys, which may be created
By default, the keyring generates a `eth_secp256k1` key. The keyring also supports `ed25519` keys, which may be created
by passing the `--algo` flag. A keyring can of course hold both types of keys simultaneously.

:::tip
**Note**: The Ethereum address associated with a public key can be derived by taking the full Ethereum public key of type
**Note**: The Ethereum address associated with a public key can be derived by taking the full Ethereum public key of type
`eth_secp256k1`, computing the `Keccak-256` hash, and truncating the first twelve bytes.
:::

Expand Down
Loading

0 comments on commit f664540

Please sign in to comment.