Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D contracts #7

Merged
merged 83 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
10cfcd7
Init contracts project
d0rich Nov 11, 2023
1e20531
Only one contracts repository
d0rich Nov 11, 2023
52e9199
Init new contracts
d0rich Nov 11, 2023
d1cb514
Copy draft nft contracts
d0rich Nov 11, 2023
611fc4d
Move NFT functionality to the traits
d0rich Nov 12, 2023
38ed79b
Fix build errors
d0rich Nov 12, 2023
2feb74c
Restructure contracts, becuase upward import doesn't work
d0rich Nov 12, 2023
2a96213
Update node and fix lock file
d0rich Nov 12, 2023
6cfd0ea
Build contracts before test
d0rich Nov 12, 2023
6a1e497
Lint and test in single job
d0rich Nov 12, 2023
26b6b0b
Temporary hide tests
d0rich Nov 12, 2023
bf8e11d
Add build script
d0rich Nov 12, 2023
b6675ff
Leave only one test
d0rich Nov 12, 2023
61cde2d
Implement accounting trait
d0rich Nov 12, 2023
9ee6a6e
Implement royalty extention
d0rich Nov 12, 2023
d326838
Extraxt logic from transfer reciever
d0rich Nov 12, 2023
e1ad7cb
Move get functions to the top
d0rich Nov 12, 2023
10f152d
Add custom function to get individual content for NFT item.
d0rich Nov 12, 2023
f93e0ef
Add getNftCollectionContent function to
d0rich Nov 12, 2023
ef0cd44
Refactor accounting functions to use more
d0rich Nov 12, 2023
47cf390
Add virtual function to calculate NFT item initial
d0rich Nov 12, 2023
1a43443
Add requireEnoughTonForMinting function to
d0rich Nov 12, 2023
0bc6dce
Fix semicolon in calculateNftItemInitalBalance()
d0rich Nov 12, 2023
cb94ff4
Refactor DSocialNetworkAccount and NftCollection
d0rich Nov 12, 2023
3af330c
Master contract draft
d0rich Nov 12, 2023
6d80147
Fix build errors
d0rich Nov 12, 2023
306950e
Handle NFT custom internal content
d0rich Nov 12, 2023
a93c5a8
Handle account initialization
d0rich Nov 12, 2023
895a6de
Fix account registration
d0rich Nov 12, 2023
42f476e
Group NFT messages
d0rich Nov 12, 2023
68e654d
Try to store metadata on chain
d0rich Nov 13, 2023
4661102
Use emptyMap() for map initialization
d0rich Nov 13, 2023
ac319b0
Test accounts registration
d0rich Nov 14, 2023
4bfeee9
Create tests specifically for the account
d0rich Nov 14, 2023
c44108d
Change account parameters
d0rich Nov 14, 2023
502dc25
Create post
d0rich Nov 14, 2023
4d90290
Deploy test post to test how it looks like on getgems
d0rich Nov 14, 2023
cf7307e
Add master contract address to account info
d0rich Nov 15, 2023
be69efb
Update social links to be stored as a JSON string
d0rich Nov 17, 2023
5e3ad06
Update metadata arrays to use empty cells instead
d0rich Nov 17, 2023
161c434
Refactor metadata arrays to use empty cells
d0rich Nov 17, 2023
9ffa416
Store metadata in JSON string
d0rich Nov 17, 2023
30aa34d
Don't convert metadata to cell
d0rich Nov 17, 2023
6c2fce8
Reuse similar messages
d0rich Nov 17, 2023
01f238c
v0.0.1-metadata-as-struct-no-convertation-to-cell
d0rich Nov 17, 2023
0364403
v0.0.1-metadata-as-cells
d0rich Nov 17, 2023
ae4fef4
v0.0.1-no-maps-in-metadata
d0rich Nov 17, 2023
fc8f2f1
Test parser for onchain metadata
d0rich Nov 18, 2023
d0a8d1a
Correctly serialize metadata with native functions
d0rich Nov 18, 2023
dfd9237
Correctly serialize dict fields
d0rich Nov 18, 2023
2a30ab2
Serialize nft content in collection
d0rich Nov 19, 2023
a7b209d
Serialize nft collection metadata
d0rich Nov 19, 2023
4c4402d
Prevent NFT serialiozation from other collections
d0rich Nov 19, 2023
0da2ef2
Add index validation in serializeNftContent
d0rich Nov 19, 2023
7c962fa
Return standard metadata in 1 cell
d0rich Nov 19, 2023
a4c775d
Update version and remove content_url
d0rich Nov 19, 2023
7334225
Init d entities models
d0rich Nov 19, 2023
c99fe6d
Serialize post metadata to description
d0rich Nov 19, 2023
989b951
Rework tests
d0rich Nov 19, 2023
25afac7
Refactor serialization of individual content in
d0rich Nov 19, 2023
bdfc503
Refactor serializeIndividualContent function to
d0rich Nov 19, 2023
7a46a49
Comment test affected by library
d0rich Nov 19, 2023
ec28882
Resolve BitBuilder overflow issue
d0rich Nov 21, 2023
8ffdc8b
Slightly refactor test
d0rich Nov 21, 2023
91fec34
Refactor DPost content field to contentMd
d0rich Nov 21, 2023
6ab8a59
Init d.d0rich.me
d0rich Nov 21, 2023
23df565
Move models to frontend
d0rich Nov 21, 2023
8e21978
lintfix
d0rich Nov 21, 2023
759a76e
Refactor ignore-build.mjs files
d0rich Nov 21, 2023
cb8f6e8
Add build task for d.d0rich.me
d0rich Nov 21, 2023
fa160fd
Patch contracts wrappers imports
d0rich Nov 21, 2023
153574e
Add eslint-disable to new-imports.ts
d0rich Nov 21, 2023
1ca9a78
Update DPostModel import in test-fixtures.ts
d0rich Nov 21, 2023
5e20371
Rename account to blog
d0rich Nov 21, 2023
0842511
Update function name to get_blog_info()
d0rich Nov 21, 2023
744d227
Refactor blog initialization to use blog metadata
d0rich Nov 21, 2023
77ef512
Add static covers images
d0rich Nov 21, 2023
fdc86a1
Add manifest file and update favicon.ico
d0rich Nov 22, 2023
de7cf63
Fix sending amount calculation in contracts
d0rich Nov 22, 2023
25aa809
Fix initialization and editing of blog and post
d0rich Nov 22, 2023
81a2f27
Include additional fees for actions
d0rich Nov 22, 2023
2c48202
Add StorageController trait to contracts
d0rich Nov 22, 2023
09ef76f
Update version to v1
d0rich Nov 22, 2023
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
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.tact]
indent_size = 4

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
trim_trailing_whitespace = false
25 changes: 0 additions & 25 deletions .github/workflows/lint.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 16.x
- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 20.x

- name: Install Dependencies
run: npm ci
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js 16
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20

- name: Installing packages
run: npm ci

- name: Build
run: npm run build

- name: Lint
run: npm run lint

- name: Tests
run: npx turbo run test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ yarn-error.log*

# vercel
.vercel

# build output
build
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ node_modules
.output
.env
dist
*.md
build
*.md
12 changes: 11 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,15 @@
"semi": false,
"trailingComma": "none",
"singleQuote": true,
"endOfLine": "auto"
"endOfLine": "auto",
"overrides": [
{
"files": "*.tact",
"options": {
"parser": "typescript",
"semi": true,
"singleQuote": false
}
}
]
}
4 changes: 3 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"vue.volar",
"nuxt.mdc",
"bradlc.vscode-tailwindcss",
"antfu.iconify"
"antfu.iconify",
"tonwhales.func-vscode",
"ton-community.tact-vscode"
]
}
28 changes: 28 additions & 0 deletions apps/d.d0rich.me/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
46 changes: 46 additions & 0 deletions apps/d.d0rich.me/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# d.d0rich.me

This template should help get you started developing with Vue 3 in Vite.

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support for `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Type-Check, Compile and Minify for Production

```sh
npm run build
```

### Run Unit Tests with [Vitest](https://vitest.dev/)

```sh
npm run test:unit
```
1 change: 1 addition & 0 deletions apps/d.d0rich.me/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
3 changes: 3 additions & 0 deletions apps/d.d0rich.me/ignore-build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { ignoreDD0richMeBuild } from '../../ignore-builds-master.mjs'

process.exit(ignoreDD0richMeBuild ? 0 : 1)
14 changes: 14 additions & 0 deletions apps/d.d0rich.me/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="manifest" href="/app.webmanifest" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
33 changes: 33 additions & 0 deletions apps/d.d0rich.me/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "d.d0rich.me",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"test:unit": "vitest",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false"
},
"dependencies": {
"@d0rich/contracts": "*",
"pinia": "^2.1.7",
"vue": "^3.3.4",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@tsconfig/node18": "^18.2.2",
"@types/jsdom": "^21.1.3",
"@types/node": "^18.18.5",
"@vitejs/plugin-vue": "^4.4.0",
"@vue/test-utils": "^2.4.1",
"@vue/tsconfig": "^0.4.0",
"jsdom": "^22.1.0",
"npm-run-all2": "^6.1.1",
"typescript": "~5.2.0",
"vite": "^4.4.11",
"vitest": "^0.34.6",
"vue-tsc": "^1.8.19"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions apps/d.d0rich.me/public/app.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "D",
"short_name": "D",
"description": "Blogs on TON Blockchain",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Binary file added apps/d.d0rich.me/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/d.d0rich.me/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/d.d0rich.me/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/d.d0rich.me/public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions apps/d.d0rich.me/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/d.d0rich.me/public/metadata/covers/blog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/d.d0rich.me/public/metadata/covers/post.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/d.d0rich.me/public/og/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions apps/d.d0rich.me/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
</script>

<template>
<header>
<img
alt="Vue logo"
class="logo"
src="@/assets/logo.svg"
width="125"
height="125"
/>

<div class="wrapper">
<HelloWorld msg="You did it!" />

<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink>
</nav>
</div>
</header>

<RouterView />
</template>

<style scoped>
header {
line-height: 1.5;
max-height: 100vh;
}

.logo {
display: block;
margin: 0 auto 2rem;
}

nav {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 2rem;
}

nav a.router-link-exact-active {
color: var(--color-text);
}

nav a.router-link-exact-active:hover {
background-color: transparent;
}

nav a {
display: inline-block;
padding: 0 1rem;
border-left: 1px solid var(--color-border);
}

nav a:first-of-type {
border: 0;
}

@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}

.logo {
margin: 0 2rem 0 0;
}

header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}

nav {
text-align: left;
margin-left: -1rem;
font-size: 1rem;

padding: 1rem 0;
margin-top: 1rem;
}
}
</style>
Loading