Skip to content
Open
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
4 changes: 4 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# EVERSCALE MAINNET
MAINNET_NETWORK_ENDPOINT="https://mainnet.evercloud.dev/XXX/graphql"
MAINNET_GIVER_ADDRESS="0:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
MAINNET_GIVER_SEED="one two three four five six seven eight nine ten eleven twelve"
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tsol linguist-language=Solidity
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules/
.idea/
.env
migration-log.json

deployments/
.cache/

.DS_Store
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"tabWidth": 2,
"printWidth": 120,
"useTabs": false,
"semi": true,
"singleQuote": false,
"jsxSingleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "avoid"
}
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,54 @@
# eversite-contract
# Contracts for storing onchain sites

Script for deploying Eversite contract.
This contract could store html-sites in the Everscale blockchain.
Sites could be [linked to .ever domains](https://github.com/chumschat/eversite-uploader)
and accessed via the browser from [Chums](https://chums.chat/) messenger.

This scripts uses npm and node.js. Be sure you have them installed.

## Install dependencies

```shell
npm install
```

## Prepare the environment

`.env` is used to configure these scripts.
You should create it from [.env.template](.env.template) file.
Fill in the fields with your data.

| Field | Required | Description |
|----------------------------|----------|----------------------------------------------------------------|
| `MAINNET_NETWORK_ENDPOINT` | **yes** | URL of the mainnet GraphQL endpoint |
| `MAINNET_GIVER_ADDRESS` | **yes** | Giver wallet address: address where gas will be withdrawn from |
| `MAINNET_GIVER_SEED` | **yes** | Seed phrase of the giver wallet |

This script uses GraphQL transport.
To get the right endpoint url you should visit [evercloud](https://www.evercloud.dev/), register and create a new project.
Then you will get the endpoint url.


## Deploy site contract

After all preparations you could deploy the site contract.
You could use `deploy` feature from locklift.

```shell
npx locklift deploy --network main
```

Or you could run the script:

```shell
npx locklift run --network main --script scripts/1-deploy-site.ts
```

When you use `deploy` feature, locklift will remember the deployed contract address.
If you want to deploy the contract again to a new address, you should remove the `deployments` folder.
When you run the `1-deploy-site.ts` script, you will get a new address and a new deployment every time.

After deploying the contract you will get the contract address,
which you could fill with the data and link to the .ever domain.
Use [eversite-uploader](https://github.com/chumschat/eversite-uploader) tools for that.
85 changes: 85 additions & 0 deletions build/Eversite.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"ABI version": 2,
"version": "2.3",
"header": ["pubkey", "time", "expire"],
"functions": [
{
"name": "constructor",
"inputs": [
],
"outputs": [
]
},
{
"name": "upload",
"inputs": [
{"name":"part","type":"cell"},
{"name":"index","type":"uint8"}
],
"outputs": [
]
},
{
"name": "getDetails",
"inputs": [
],
"outputs": [
{"name":"value0","type":"map(uint8,cell)"}
]
},
{
"name": "destruct",
"inputs": [
{"name":"dest","type":"address"}
],
"outputs": [
]
},
{
"name": "transferOwnership",
"inputs": [
{"name":"newOwner","type":"uint256"}
],
"outputs": [
]
},
{
"name": "owner",
"inputs": [
],
"outputs": [
{"name":"owner","type":"uint256"}
]
},
{
"name": "_randomNonce",
"inputs": [
],
"outputs": [
{"name":"_randomNonce","type":"uint256"}
]
}
],
"data": [
{"key":1,"name":"_randomNonce","type":"uint256"}
],
"events": [
{
"name": "OwnershipTransferred",
"inputs": [
{"name":"previousOwner","type":"uint256"},
{"name":"newOwner","type":"uint256"}
],
"outputs": [
]
}
],
"fields": [
{"name":"_pubkey","type":"uint256"},
{"name":"_timestamp","type":"uint64"},
{"name":"_constructorFlag","type":"bool"},
{"name":"owner","type":"uint256"},
{"name":"_randomNonce","type":"uint256"},
{"name":"content","type":"map(uint8,cell)"}
]
}
1 change: 1 addition & 0 deletions build/Eversite.base64
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
te6ccgECHQEAA3cAAgE0AwEBAcACAEPQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgBCSK7VMg4wMgwP/jAiDA/uMC8gsaBQQcAsjtRNDXScMB+GYh2zzTAAGOIoMI1xgg+CjIzs7J+QAB0wABlNP/AwGTAvhC4iD4ZfkQ8qiV0wAB8nri0z8B+EMhufK0IPgjgQPoqIIIG3dAoLnytPhj0x8B+CO88rnTHwHbPPI8CQYDSu1E0NdJwwH4ZiLQ1wsDqTgA3CHHAOMCIdcNH/K8IeMDAds88jwZGQYCKCCCEDtTMx+74wIgghBotV8/u+MCDwcDPCCCEESMQ7264wIgghBYWpBkuuMCIIIQaLVfP7rjAg0KCANSMPhCbuMA+Ebyc9H4RSBukjBw3vhCuvLj6PgA+EUgbpIwcN7bPNs88gAJDBYBaO1E0NdJwgGOKXDtRND0BXBxIoBA9A5vkZPXC//ebfhs+Gv4aoBA9A7yvdcL//hicPhj4w0YAzQw+Eby4Ez4Qm7jACGT1NHQ3tP/0ds82zzyABgLFgEs+EUgbpIwcN74Srry4+gg8uPp+ADbPAwARvhKIfhqjQRwAAAAAAAAAAAAAAAAFNs0/KDIzsv/y//JcPsAAyow+Eby4Ez4Qm7jANTTB9HbPNs88gAYDhYALvhFIG6SMHDe+Eq68uPo+AD4THj0F/hsBE4gggujrde64wIgghANiw5nuuMCIIIQEXjpvbrjAiCCEDtTMx+64wIVEhEQAVAw0ds8+EshjhyNBHAAAAAAAAAAAAAAAAAu1MzH4MjOy//JcPsA3vIAGAFQMNHbPPhKIY4cjQRwAAAAAAAAAAAAAAAAJF46b2DIzsv/yXD7AN7yABgDaDD4RvLgTPhCbuMA0ds8IY4cI9DTAfpAMDHIz4cgzoIQjYsOZ88LgfQAyXD7AJEw4uMA8gAYFBMAKO1E0NP/0z8x+ENYyMv/yz/Oye1UAAT4TAM0MPhG8uBM+EJu4wAhk9TR0N76QNHbPNs88gAYFxYANPhM+Ev4SvhD+ELIy//LP8+Dy//L//QAye1UAD74RSBukjBw3vhKuvLj6PgAyM+FCM6Ab89AyYEAoPsAADbtRNDT/9M/0wAx0//T//QE0fhs+Gv4avhj+GIACvhG8uBMAhD0pCD0vfLAThwbABRzb2wgMC43MC4wAAA=
Loading