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

Add NFT launchpad template (contract only) #26

Merged
merged 30 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
node_modules
.DS_Store
.DS_Store
.idea
72 changes: 41 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions templates/nft-template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Aptos related files
.aptos
.env

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Empty file.
1 change: 1 addition & 0 deletions templates/nft-template/contract_address.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xc9d6f25bb6d465476ebfed667fa465975aedabb9664a26c261637d0d7e2b443a
18 changes: 18 additions & 0 deletions templates/nft-template/frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions templates/nft-template/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
13 changes: 13 additions & 0 deletions templates/nft-template/frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/aptos.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Aptos dapp boilerplate</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
30 changes: 30 additions & 0 deletions templates/nft-template/frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "frontend",
"version": "0.0.0",
"license": "Apache-2.0",
"dependencies": {
"@aptos-labs/wallet-adapter-ant-design": "^2.3.0",
"@aptos-labs/wallet-adapter-react": "^2.4.0",
"@pontem/wallet-adapter-plugin": "^0.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"devDependencies": {
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.3",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"typescript": "^5.0.2",
"vite": "^4.4.5"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions templates/nft-template/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { WalletSelector } from "@aptos-labs/wallet-adapter-ant-design";
import "@aptos-labs/wallet-adapter-ant-design/dist/index.css";
import logo from "./assets/aptos.png";

function App() {
return (
<>
<div className="navbar">
<div className="navbar-text">Create Aptos Dapp</div>
<div>
<WalletSelector />
</div>
</div>
<div className="center-container">
<img className="center-image" src={logo} alt="aptos" />
</div>
</>
);
}

export default App;
1 change: 1 addition & 0 deletions templates/nft-template/frontend/src/abi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ABI = {"address":"0x8f838ee41b0cc142e46dfeac5a68e50be1488594b91ca8eefd17682e8e86c3f2","name":"todolist","friends":[],"exposed_functions":[{"name":"complete_task","visibility":"public","is_entry":true,"is_view":false,"generic_type_params":[],"params":["&signer","u64"],"return":[]},{"name":"create_list","visibility":"public","is_entry":true,"is_view":false,"generic_type_params":[],"params":["&signer"],"return":[]},{"name":"create_task","visibility":"public","is_entry":true,"is_view":false,"generic_type_params":[],"params":["&signer","0x1::string::String"],"return":[]}],"structs":[{"name":"Task","is_native":false,"abilities":["copy","drop","store"],"generic_type_params":[],"fields":[{"name":"address","type":"address"},{"name":"content","type":"0x1::string::String"},{"name":"completed","type":"bool"}]},{"name":"TodoList","is_native":false,"abilities":["key"],"generic_type_params":[],"fields":[{"name":"tasks","type":"vector<0x8f838ee41b0cc142e46dfeac5a68e50be1488594b91ca8eefd17682e8e86c3f2::todolist::Task>"},{"name":"set_task_event","type":"0x1::event::EventHandle<0x8f838ee41b0cc142e46dfeac5a68e50be1488594b91ca8eefd17682e8e86c3f2::todolist::Task>"}]}]} as const
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions templates/nft-template/frontend/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #333;
color: #fff;
padding: 10px 20px;
}

.navbar-text {
font-size: 20px;
}

.center-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh; /* Adjust this to control vertical centering */
}

.center-image {
max-width: 100%;
max-height: 100%;
}
28 changes: 28 additions & 0 deletions templates/nft-template/frontend/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react";
import ReactDOM from "react-dom/client";
// wallet adapter
import { AptosWalletAdapterProvider } from "@aptos-labs/wallet-adapter-react";
// wallets
import { PontemWallet } from "@pontem/wallet-adapter-plugin";

import App from "./App";
import "./index.css";

const wallets = [new PontemWallet()];

const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
);
root.render(
<React.StrictMode>
<AptosWalletAdapterProvider
plugins={wallets}
autoConnect={true}
onError={(error) => {
console.log("Custom error handling", error);
}}
>
<App />
</AptosWalletAdapterProvider>
</React.StrictMode>
);
1 change: 1 addition & 0 deletions templates/nft-template/frontend/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
25 changes: 25 additions & 0 deletions templates/nft-template/frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
10 changes: 10 additions & 0 deletions templates/nft-template/frontend/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
13 changes: 13 additions & 0 deletions templates/nft-template/frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
build: {
outDir: "build",
},
server: {
open: true,
},
plugins: [react()],
});
2 changes: 2 additions & 0 deletions templates/nft-template/move/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
.aptos
19 changes: 19 additions & 0 deletions templates/nft-template/move/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "launchpad"
version = "1.0.0"
authors = []

[addresses]
launchpad_addr = "_"
minter = "_"

[dev-addresses]
launchpad_addr = "0x100"
minter = "0x101"

[dependencies]
AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "mainnet", subdir = "aptos-move/framework/aptos-framework"}
AptosTokenObjects = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "mainnet", subdir = "aptos-move/framework/aptos-token-objects"}
TokenMinter = { git = "https://github.com/aptos-labs/token-minter.git", rev = "main", subdir = "token-minter"}

[dev-dependencies]
Loading
Loading