Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"arrowParens": "avoid"
}
32 changes: 16 additions & 16 deletions docs/about-settlemint/4_components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: Overview of the SettleMint components and tools available to build
sidebar_position: 1
---

import blockchainApplication from '@site/static/img/about-settlemint/blockchain-application.png';
import blockchainNetwork from '@site/static/img/about-settlemint/network-node.png';
import smartContract from '@site/static/img/about-settlemint/smart-contract.png';
import middleware from '@site/static/img/about-settlemint/middleware.png';
import storage from '@site/static/img/about-settlemint/storage.png';
import integration from '@site/static/img/about-settlemint/integration.png';
import blockchainApplication from "@site/static/img/about-settlemint/blockchain-application.png";
import blockchainNetwork from "@site/static/img/about-settlemint/network-node.png";
import smartContract from "@site/static/img/about-settlemint/smart-contract.png";
import middleware from "@site/static/img/about-settlemint/middleware.png";
import storage from "@site/static/img/about-settlemint/storage.png";
import integration from "@site/static/img/about-settlemint/integration.png";

This guide will explain each of the tools and services on SettleMint and how they connected to
build a blockchain application.
Expand All @@ -22,12 +22,12 @@ build a blockchain application.
alt="Blockchain Application"
width="70%"
height="70%"
style={{ display: 'block', margin: '0 auto' }}
style={{ display: "block", margin: "0 auto" }}
/>
The first step to building anything on SettleMint is to [create an application](../../using-platform/create-an-application).
You can think of an application as the collection of resources that you need to build
your blockchain application. This includes a blockchain network, smart contracts,
middleware, storage, and integrations.{' '}
middleware, storage, and integrations.{" "}

## Add a Blockchain Network and Node

Expand All @@ -36,13 +36,13 @@ middleware, storage, and integrations.{' '}
alt="Blockchain Network and Node"
width="70%"
height="70%"
style={{ display: 'block', margin: '0 auto' }}
style={{ display: "block", margin: "0 auto" }}
/>
After creating a blockchain application, you now need to [add a blockchain network](../../using-platform/add-a-network-to-an-application)
and node to your application. SettleMint offeres a variety of different [blockchain
networks](../supported-blockchains) to choose from whatever your usecase may be.
Networks need nodes to support the blockchain to run, once a [network is created](../../using-platform/add-a-node-to-a-network/)
then a node is also added automatically.{' '}
then a node is also added automatically.{" "}

## Create a Smart Contract

Expand All @@ -51,10 +51,10 @@ then a node is also added automatically.{' '}
alt="Add a Smart Contract"
width="70%"
height="70%"
style={{ display: 'block', margin: '0 auto' }}
style={{ display: "block", margin: "0 auto" }}
/>
Smart Contracts allow us to run code on the blockchain. Developing a smart contract
by [adding a smart contract set](../../using-platform/add_smart_contract_sets/create_smart_contract_set),
by [adding a smart contract set](../../using-platform/dev-tools/code-studio/smart-contract-sets),
is an important step to reaching the business and product goals of your blockchain
application.

Expand All @@ -65,12 +65,12 @@ application.
alt="Middleware"
width="70%"
height="70%"
style={{ display: 'block', margin: '0 auto' }}
style={{ display: "block", margin: "0 auto" }}
/>
Blockchain applications produce data that lives on the blockchain, but we need to
be able to access that data in order to use it. Creating a [middleware](../../using-platform/middleware/)
allows us SettleMint currently offers two middleware services: The Graph and Smart
Contract Portal Middleware.{' '}
Contract Portal Middleware.{" "}
Comment on lines 70 to +73
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (typo): This sentence appears to be grammatically incorrect or incomplete

Consider revising the sentence structure to clearly explain what SettleMint allows users to do with middleware services.

Suggested change
Blockchain applications produce data that lives on the blockchain, but we need to
be able to access that data in order to use it. Creating a [middleware](../../using-platform/middleware/)
allows us SettleMint currently offers two middleware services: The Graph and Smart
Contract Portal Middleware.{' '}
Contract Portal Middleware.{" "}
Blockchain applications produce data that lives on the blockchain, but we need to
be able to access that data in order to use it. [Middleware](../../using-platform/middleware/)
allows us to efficiently interact with and query blockchain data. SettleMint currently offers
two middleware services: The Graph and Smart Contract Portal Middleware.{" "}


## Add Storage

Expand All @@ -79,7 +79,7 @@ Contract Portal Middleware.{' '}
alt="Storage"
width="70%"
height="70%"
style={{ display: 'block', margin: '0 auto' }}
style={{ display: "block", margin: "0 auto" }}
/>
Your blockchain application may need to store data. Blockchains are good for running
different processes in a decentralized way but can be costly to store large amounts
Expand All @@ -93,7 +93,7 @@ IPFS (decentralized) and MinIO (centralized) S3 storage.
alt="Integration"
width="70%"
height="70%"
style={{ display: 'block', margin: '0 auto' }}
style={{ display: "block", margin: "0 auto" }}
/>
Blockchains are not the only technology that your blockchain application may need
to interact with. SettleMint offers an [Integration Studio](../../using-platform/integration-studio)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ For example, to run the `smartcontract:deploy` task using the terminal, open a n

## Private key

To be able to deploy your smart contract set on the blockchain you need to have a private key enabled on your node to sign the transaction, and you need to fund this key with Ether to cover the cost for the transaction. You can create a private key and fund it in the **Private keys section** of your application. [More about private keys.](../../using-platform/17_private-keys.md)
To be able to deploy your smart contract set on the blockchain you need to have a private key enabled on your node to sign the transaction, and you need to fund this key with Ether to cover the cost for the transaction. You can create a private key and fund it in the **Private keys section** of your application. [More about private keys.](../../using-platform/12_private-keys.md)

## Template library

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To set the name and symbol for your token, go to the **“deploy”** folder and
await deploy('GenericToken', {
from: deployer,
args: ['GenericToken', 'GT'],
log: true,
log: true
});
```

Expand Down Expand Up @@ -86,14 +86,14 @@ const EIP712Domain = [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' },
{ name: 'verifyingContract', type: 'address' }
];

const domain = {
name: 'MinimalForwarder',
version: '0.0.1',
chainId: parseInt(await getChainId()),
verifyingContract: forwarderAddress,
verifyingContract: forwarderAddress
};
const types = {
EIP712Domain,
Expand All @@ -103,8 +103,8 @@ const types = {
{ name: 'value', type: 'uint256' },
{ name: 'gas', type: 'uint256' },
{ name: 'nonce', type: 'uint256' },
{ name: 'data', type: 'bytes' },
],
{ name: 'data', type: 'bytes' }
]
};
```

Expand All @@ -117,22 +117,27 @@ The name and version of domain have to match those of the forwarder (see the con
Then, we need to generate the function data as follows:

```typescript
const functionData = token.interface.encodeFunctionData('transfer', [walletTwoAddress, ethers.utils.parseUnits('10')]);
const functionData = token.interface.encodeFunctionData('transfer', [
walletTwoAddress,
ethers.utils.parseUnits('10')
]);
```

In that expression, `transfer` is the ERC-20 function we want to execute, `walletTwoAddress` is the account that will receive the tokens and the last parameter is the amount of tokens to be transferred.

The last step before sending the meta transaction is to create and sign the message containing the underlying transaction as follows:

```typescript
const walletOneNonce = Number(await read('Forwarder', 'getNonce', walletOneAddress));
const walletOneNonce = Number(
await read('Forwarder', 'getNonce', walletOneAddress)
);
const req = {
from: walletOneAddress,
to: token.address,
value: '0',
gas: '100000',
nonce: walletOneNonce,
data: functionData,
data: functionData
};

const signedData = ethSigUtil.signTypedData({
Expand All @@ -141,9 +146,9 @@ const signedData = ethSigUtil.signTypedData({
types: types,
domain: domain,
primaryType: 'ForwardRequest',
message: req,
message: req
},
version: ethSigUtil.SignTypedDataVersion.V4,
version: ethSigUtil.SignTypedDataVersion.V4
});
```

Expand Down Expand Up @@ -261,4 +266,4 @@ Here we are going to deploy:

## Integration with the Middleware

Working with complex or large data in your dApp can be a challenge. In the SettleMint platform we provide you with a [middleware solution](../../../using-platform/11_middleware.md) that allows you to index and query this data easily and efficiently.
Working with complex or large data in your dApp can be a challenge. In the SettleMint platform we provide you with a [middleware solution](../../../using-platform/7_middleware.md) that allows you to index and query this data easily and efficiently.
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ yarn smartcontract:deploy:reveal

## Integration with the Middleware

Working with complex or large data in your dApp can be a challenge. In the SettleMint platform we provide you with a [middleware solution](../../../using-platform/11_middleware.md) that allows you to index and query this data easily and efficiently.
Working with complex or large data in your dApp can be a challenge. In the SettleMint platform we provide you with a [middleware solution](../../../using-platform/7_middleware.md) that allows you to index and query this data easily and efficiently.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ For example, to run the `smartcontract:deploy` task using the terminal, open a n

## Private key

To be able to deploy your smart contract set on the blockchain you need to have a private key enabled on your node to sign the transaction, and you need to fund this key with Ether to cover the cost for the transaction. You can create a private key and fund it in the **Private keys section** of your application. [More about private keys.](../../using-platform/17_private-keys.md)
To be able to deploy your smart contract set on the blockchain you need to have a private key enabled on your node to sign the transaction, and you need to fund this key with Ether to cover the cost for the transaction. You can create a private key and fund it in the **Private keys section** of your application. [More about private keys.](../../using-platform/12_private-keys.md)

## Template library

Expand All @@ -67,4 +67,4 @@ Here are some prompts to get you started:
- Write a Solidity ERC721 token representing real estate, based on OpenZeppelin and allow fractional ownership of this NFT in the form of ERC20 tokens.
- Write The Graph indexing code that indexes an ERC721 token on the Ethereum Mainnet.

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/-e4weLqbYjk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/-e4weLqbYjk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To set the name and symbol for your token, go to the **“deploy”** folder and
await deploy('GenericToken', {
from: deployer,
args: ['GenericToken', 'GT'],
log: true,
log: true
});
```

Expand Down Expand Up @@ -86,14 +86,14 @@ const EIP712Domain = [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' },
{ name: 'verifyingContract', type: 'address' }
];

const domain = {
name: 'MinimalForwarder',
version: '0.0.1',
chainId: parseInt(await getChainId()),
verifyingContract: forwarderAddress,
verifyingContract: forwarderAddress
};
const types = {
EIP712Domain,
Expand All @@ -103,8 +103,8 @@ const types = {
{ name: 'value', type: 'uint256' },
{ name: 'gas', type: 'uint256' },
{ name: 'nonce', type: 'uint256' },
{ name: 'data', type: 'bytes' },
],
{ name: 'data', type: 'bytes' }
]
};
```

Expand All @@ -117,22 +117,27 @@ The name and version of domain have to match those of the forwarder (see the con
Then, we need to generate the function data as follows:

```typescript
const functionData = token.interface.encodeFunctionData('transfer', [walletTwoAddress, ethers.utils.parseUnits('10')]);
const functionData = token.interface.encodeFunctionData('transfer', [
walletTwoAddress,
ethers.utils.parseUnits('10')
]);
```

In that expression, `transfer` is the ERC-20 function we want to execute, `walletTwoAddress` is the account that will receive the tokens and the last parameter is the amount of tokens to be transferred.

The last step before sending the meta transaction is to create and sign the message containing the underlying transaction as follows:

```typescript
const walletOneNonce = Number(await read('Forwarder', 'getNonce', walletOneAddress));
const walletOneNonce = Number(
await read('Forwarder', 'getNonce', walletOneAddress)
);
const req = {
from: walletOneAddress,
to: token.address,
value: '0',
gas: '100000',
nonce: walletOneNonce,
data: functionData,
data: functionData
};

const signedData = ethSigUtil.signTypedData({
Expand All @@ -141,9 +146,9 @@ const signedData = ethSigUtil.signTypedData({
types: types,
domain: domain,
primaryType: 'ForwardRequest',
message: req,
message: req
},
version: ethSigUtil.SignTypedDataVersion.V4,
version: ethSigUtil.SignTypedDataVersion.V4
});
```

Expand Down Expand Up @@ -261,4 +266,4 @@ Here we are going to deploy:

## Integration with the Middleware

Working with complex or large data in your dApp can be a challenge. In the SettleMint platform we provide you with a [middleware solution](../../../using-platform/11_middleware.md) that allows you to index and query this data easily and efficiently.
Working with complex or large data in your dApp can be a challenge. In the SettleMint platform we provide you with a [middleware solution](../../../using-platform/7_middleware.md) that allows you to index and query this data easily and efficiently.
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ yarn smartcontract:deploy:reveal

## Integration with the Middleware

Working with complex or large data in your dApp can be a challenge. In the SettleMint platform we provide you with a [middleware solution](../../../using-platform/11_middleware.md) that allows you to index and query this data easily and efficiently.
Working with complex or large data in your dApp can be a challenge. In the SettleMint platform we provide you with a [middleware solution](../../../using-platform/7_middleware.md) that allows you to index and query this data easily and efficiently.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ For example, to run the `smartcontract:deploy` task using the terminal, open a n

## Private key

To be able to deploy your smart contract set on the blockchain you need to have a private key enabled on your node to sign the transaction, and you need to fund this key with Ether to cover the cost for the transaction. You can create a private key and fund it in the **Private keys section** of your application. [More about private keys.](../../using-platform/17_private-keys.md)
To be able to deploy your smart contract set on the blockchain you need to have a private key enabled on your node to sign the transaction, and you need to fund this key with Ether to cover the cost for the transaction. You can create a private key and fund it in the **Private keys section** of your application. [More about private keys.](../../using-platform/12_private-keys.md)

## Template library

Expand Down
Loading