You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/blockchain-guides/arbitrum/connect-to-a-node.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,7 @@
1
1
---
2
-
title: "Arbitrum Connect To A Node"
2
+
title: "Connect to a node"
3
3
---
4
4
5
-
# Connect to a node
6
-
7
5
For a software application to interact with a blockchain (e.g. by sending transactions/data to the network, or even just by reading data), it must connect to a node. This section describes how to connect to your Arbitrum node.
8
6
9
7
## Backend APIs
@@ -32,7 +30,7 @@ If you want to connect to a node deployed on the SettleMint platform, go to the
32
30
33
31
### JSON-WS
34
32
35
-
To make RPC requests over WebSockets, you can use wscat, which is by definition a Node.js based command-line tool. First you will need to connect to your node’s WebSocket server using wscat, as follows: `wscat -c ws://<JSON-RPC-ws-endpoint:port>`. All the credentials are provided in the **Connect** tab on the **Node detail page** in the **Blockchain nodes** section of your application. After you have established a connection, the terminal should display a '>' prompt. You will then be able to send individual requests as a JSON data package, as above, for instance:
33
+
To make RPC requests over WebSockets, you can use wscat, which is by definition a Node.js based command-line tool. First you will need to connect to your node's WebSocket server using wscat, as follows: `wscat -c ws://<JSON-RPC-ws-endpoint:port>`. All the credentials are provided in the **Connect** tab on the **Node detail page** in the **Blockchain nodes** section of your application. After you have established a connection, the terminal should display a '>' prompt. You will then be able to send individual requests as a JSON data package, as above, for instance:
36
34
37
35
```json
38
36
{
@@ -46,11 +44,11 @@ To make RPC requests over WebSockets, you can use wscat, which is by definition
46
44
47
45
### GraphQL
48
46
49
-
GraphQL is a query language and server-side runtime for API’s. It is designed to make APIs fast, flexible, and developer-friendly.
47
+
GraphQL is a query language and server-side runtime for API's. It is designed to make APIs fast, flexible, and developer-friendly.
50
48
We have a GraphQL interface that can be used with many different queries. These queries can be tested out in our GraphQL playground. You can also test out the different graphql queries with cURL, those request would look like this:
51
49
52
50
```bash
53
-
curl -X POST -H "Content-Type: application/json" -H “x-auth-token: <AUTH_TOKEN>” --data
51
+
curl -X POST -H "Content-Type: application/json" -H "x-auth-token: <AUTH_TOKEN>" --data
You can launch a Smart Contract Set to significantly accelerate the development of your smart contracts.
8
6
9
7
[Learn here how to use Smart Contract Sets to deploy your smart contracts](../../using-platform/15_dev-tools/0_code-studio/1_smart-contract-sets/1_smart-contract-sets.md).
All nodes running in SettleMint are configured to be **archive nodes**, meaning they all include all previous states of a given blockchain since its origin.
8
6
9
7
[Learn here how to interact with your Arbitrum node.](3_arbitrum-connect-to-a-node.md)
Copy file name to clipboardExpand all lines: content/docs/blockchain-guides/arbitrum/template-library/erc-20.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,7 @@
1
1
---
2
-
title: "Arbitrum Erc 20"
2
+
title: "ERC-20 token"
3
3
---
4
4
5
-
# ERC-20 token
6
-
7
5
ERC-20 tokens are blockchain-based assets, issued on all EVM compatible blockchain networks such as Arbitrum, that have value and can be sent and received. These tokens are fungible, meaning they can be exchanged with another token of the same type because they have identical properties and there is an equal value. For example, the ERC-20 token of Alice is exactly the same as the ERC-20 token of Bob. They can exchange their token without consequences.
8
6
9
7
Examples of fungible assets are currencies, stocks of a company, bonds, gold and other precious metals.
@@ -21,19 +19,20 @@ The ERC-20 smart contract on the SettleMint platform has the following features:
21
19
- Pausable capabilities that let the admin pause the contract in case of emergency.
22
20
- Burnable capabilities that let users burn (i.e destroy) their token.
23
21
24
-
By default, the account that deploys the ERC-20 smart contract gets 1,000,000 tokens. You can change this behaviour by modifying the **“constructor”** in **“GenericToken.sol”**. If you do not mint tokens in the constructor, make sure to mint some after the deployment.
22
+
By default, the account that deploys the ERC-20 smart contract gets 1,000,000 tokens. You can change this behaviour by modifying the **"constructor"** in **"GenericToken.sol"**. If you do not mint tokens in the constructor, make sure to mint some after the deployment.
25
23
26
24
```solidity
27
25
contract GenericToken is ERC20, ERC20Burnable, Pausable, AccessControl {
To set the name and symbol for your token, go to the **“deploy”** folder and in **“00_Deploy_GenericToken.ts”**, change the values in **“args”** in the **“deploy”** function.
35
+
To set the name and symbol for your token, go to the **"deploy"** folder and in **"00_Deploy_GenericToken.ts"**, change the values in **"args"** in the **"deploy"** function.
37
36
38
37
```typescript
39
38
awaitdeploy('GenericToken', {
@@ -43,9 +42,9 @@ await deploy('GenericToken', {
43
42
});
44
43
```
45
44
46
-
As soon as you are happy with the changes you made, just click on **“deploy”** in the **“task runner”** of the IDE and after a few seconds, your ERC-20 smart contract should be deployed on the network of your choice.
45
+
As soon as you are happy with the changes you made, just click on **"deploy"** in the **"task runner"** of the IDE and after a few seconds, your ERC-20 smart contract should be deployed on the network of your choice.
47
46
48
-
The **“GenericToken.ts”** script in the **“test”** folder showcases all the functionalities of the ERC-20 standard. It shows you how to use the smart contract in your dapp.
47
+
The **"GenericToken.ts"** script in the **"test"** folder showcases all the functionalities of the ERC-20 standard. It shows you how to use the smart contract in your dapp.
1. We pass in the constructor an Ethereum address, the `trustedForwarder`, to the `ERC2771Context` constructor. This enables the smart contract to accept transactions coming from the `Trusted Forwarder`.
79
78
2.`_msgSender()` function is kind of an alias for `msg.sender`. When called it returns `msg.sender` for regular transactions, but for meta transactions it returns the end user (rather than the `relayer` or the `trusted forwarder`).
@@ -194,7 +193,7 @@ Validation refers to ensuring that the buyers meet certain conditions before the
194
193
195
194
Our templateset provides KYC / AML whitelisting capabilities out of the box. The buyers must be whitelisted before they can purchase tokens.
196
195
197
-
This is implemented using openzepellin’s `AccessControl`. The address with the `DEFAULT_ADMIN_ROLE` grants `WHITELISTED_ROLE` to buyers before they can purchase tokens.
196
+
This is implemented using openzepellin's `AccessControl`. The address with the `DEFAULT_ADMIN_ROLE` grants `WHITELISTED_ROLE` to buyers before they can purchase tokens.
198
197
199
198
#### Purchase of tokens
200
199
@@ -215,11 +214,11 @@ This can be done immediately after the tokens have been purchased or a certain a
215
214
216
215
To transfer the tokens immediately, set the `_vestingEndDate` field on the `CrowdSale` contract to `0` while deploying the contract.
217
216
218
-
When the vesting end date is not set, the tokens purchased get transferred immediately to the beneficiary’s address.
217
+
When the vesting end date is not set, the tokens purchased get transferred immediately to the beneficiary's address.
219
218
220
219
Transfering the tokens a certain amount of time after the purchase is achieved using two pieces:
221
220
Setting the `_vestingEndDate` on the contract to the timestamp at the end of the vesting period
222
-
Deploying a `VestingVault` contract and initializing `_vestingVault` field on the `CrowdSale` contract to it’s address
221
+
Deploying a `VestingVault` contract and initializing `_vestingVault` field on the `CrowdSale` contract to it's address
223
222
224
223
The beneficiary in this case is the `VestingVault` contract. All the tokens purchased by buyers get stored in the `VestingVault` contract.
ERC-721 tokens are blockchain-based assets, issued on issued on all EVM compatible blockchain networks such as Arbitrum, that have value and can be sent and received. Contrary to the ERC-20 tokens, these ERC-721 tokens are non- fungible, meaning that two tokens from the same smart contract are not equivalent.
6
+
7
+
Non-fungible tokens, or NFTs, are digitally unique, no two NFTs are the same. For example, if Alice and Bob exchange their NFTs, one of them might feel unlucky as their new token is worth less than their previous ones. NFTs give the ability to assign or claim ownership of any unique piece of digital data, trackable on the blockchain. It can be created from digital objects, as a representation of digital or non-digital assets.
8
+
9
+
Examples of what an NFT can represent are real estate properties, collectibles, event tickets, music videos, and artwork.
10
+
11
+
The SettleMint platform comes with three ERC-721 contract sets.
12
+
13
+
- The first one, simply called **ERC-721 Token**, has all the functionalities to create the token, but it has no specific asset attached to it. It is up to you to create one. The optimised **ERC-721a Token** provides significant gas savings for minting multiple NFTs in a single transaction.
14
+
- The second set, called **ERC-721 trading cards**, show you how you can create trading cards with different scarcities.
15
+
- Finally, the third set, called **ERC-721 Generative Art**, demonstrates how you can automatically create images by combining several layers of assets. This is the process that was used to create famous NFT collections such as the Bored Ape Yacht Club or the Cryptopunks.
16
+
17
+
The trading cards and the generative art sets are extensions of the ERC-721 Token set. The specific features related to these two sets are presented in their respective sections.
18
+
19
+
## ERC-721 smart contract features
20
+
21
+
An ERC-721 smart contract is used to create non-fungible tokens and bring them to the blockchain.
22
+
23
+
The process of creating an ERC-721 has a few distinct phases. The smart contract sets define one such a process which is what we describe below. This is by no means the only way to run your ERC-721 project, if you plan not to follow the playbook below, you can use it to setup your own flow easily.
24
+
25
+
### Phase 0: Image generation
26
+
27
+
#### Generative Art
28
+
29
+
The image generation code for the generative art set is based on the [Hashlips Art Engine](https://github.com/HashLips/hashlips_art_engine), please check out the
30
+
README file in the `art_engine` folder on the usage instructions.
31
+
32
+
In short, replace the images in the `art_engine/layers` folder, change the settings in the `art_engine/src/config.js` file, and run `yarn artengine:build` to generate your images. Rinse and repeat until you are happy with the result. Note that the generated images are randomized
33
+
to prevent streaks of similar images, this can be configured in the `art_engine/src/config.js` file.
34
+
35
+
If you want to use the engine to generate a preview image run `yarn artengine:preview` for a static image and `yarn artengine:preview_gif` for a gif.
36
+
37
+
Using `yarn artengine:rarity` you can check the rarity of each generated image.
38
+
39
+
If you want to pixelate your images, use `yarn artengine:pixelate`, the settings are again in the `art_engine/src/config.js` file.
40
+
41
+
Not that the generated metadata does not have a real base uri set, after we have uploaded everything to IPFS, we can set it in the `art_engine/src/config.js` file and update all the metadata using `yarn artengine:update_info`.
Copy file name to clipboardExpand all lines: content/docs/blockchain-guides/arbitrum/template-library/state-machine.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,7 @@
1
1
---
2
-
title: "Polygon State Machine"
2
+
title: "State machine"
3
3
---
4
4
5
-
# State Machine
6
-
7
5
This smart contract set implements a state machine. State machines are usually used to represent a system where an entity goes through several sequential states.
8
6
9
7
Each state has different functions and different roles associated with it. You can call certain functions only if the state you are in is associated with that function. The different roles associated with a state are the roles who are allowed to perform transition to the next state from the given state.
Copy file name to clipboardExpand all lines: content/docs/blockchain-guides/arbitrum/the-basics.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,12 @@
1
1
---
2
-
title: "Arbitrum The Basics"
2
+
title: "The basics"
3
3
---
4
4
5
-
# The basics
6
-
7
5
Arbitrum was launched in August 2021 by Offchain Labs, and has its own cryptocurrency since March 2023 called ARB. It is a layer 2 scaling solution for Ethereum that focusses on security, scalability and compatibility. Arbitrum uses optimistic rollup technology to process transactions off-chain, which allows it to offer significantly faster transaction speeds and lower fees than Ethereum mainnet. It uses AVM (Arbitrum Virtual Machine) which is a custom virtual machine that was created for the Arbitrum Layer 2 scaling solution. The AVM is designed to be fully compatible with the Ethereum Virtual Machine (EVM), but it also includes a number of optimizations that make it more efficient and scalable. In addition to scalability and compatibility, Arbitrum is also focused on decentralization. The Arbitrum network is secured by a decentralized network of validators, and it is governed by a DAO (decentralized autonomous organization). This ensures that Arbitrum is not controlled by any single entity.
8
6
9
7
## Mainnet and Testnet
10
8
11
-
SettleMint supports, the **Arbitrum One Mainnet** and the **Arbitrum Goerli Testnet** .
9
+
SettleMint supports, the **Arbitrum One Mainnet** and the **Arbitrum Testnet** .
12
10
13
11
The Mainnet is the primary public Arbitrum production blockchain, where actual-value transactions take place. Each transaction requires payment of a transaction fee, payable in the native coin ARB. The Testnet is an instance of the blockchain to be used for testing and experimentation. There are also coins used in the Testnet but they have no value, so there is no risk of real fund.
0 commit comments