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

fix: duplicate variable in script #65

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
22 changes: 10 additions & 12 deletions smart-contracts-hardhat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,30 @@ This project is used as a guide to show how to setup HardHat to interact with **

**This Hardhat repository uses the [bun](https://bun.sh) package manager. Make sure to [install it](https://bun.sh/docs/installation) first.**

Install the dependencies
Follow the instructions below in your terminal to get started using the smart contracts and running the script examples.

> **Requirement:** Make sure to add the private key of an EOA for deployment. Optionally, you can provide a private key of a controller and a Universal Profile address to deploy contracts using your smart contract account.
> **Tips:** Add the `--verbose` and `--show-stack-traces` flags for further information.

```bash
# 1. Install the dependencies
bun install
```

Set the private environment variables

```bash
# 2. Set the private environment variables in your .env file
cp .env.example .env
```

> **INFO** Make sure to add the private key of an EOA for deployment. Optionally, you can provide a private key of a controller and a Universal Profile address to deploy contracts using your smart contract account.
# 3. Compile all smart contracts within `/contracts`:
bun run build
```

## Development

### Compile Contracts

Compile all smart contracts within `/contracts`:

```bash
npx hardhat compile
bun run build
```

> **INFO** Add the `--verbose` and `--show-stack-traces` flags for further information.

### Deploy Contracts

Deploy a sample LSP7 contract with an Externally Owned Account:
Expand Down
Binary file modified smart-contracts-hardhat/bun.lockb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ async function deployToken() {
throw new Error('Network URL is not defined in the Hardhat configuration.');
}

const erc725js = new ERC725(LSP4DigitalAssetSchema, customTokenAddress, networkUrl);
const erc725js = new ERC725(
LSP4DigitalAssetSchema,
customTokenAddress,
networkUrl,
);

// Read the token metadata
// https://docs.lukso.tech/tools/erc725js/classes/ERC725#getdata
Expand All @@ -43,11 +47,17 @@ async function deployToken() {

// Encode the new LSP4 metadata as Verifiable URI
// https://docs.lukso.tech/tools/erc725js/classes/ERC725#encodedata
const encodedLSP4Metadata = ERC725.encodeData(lsp4SampleMetadata, LSP4DigitalAssetSchema);
const encodedLSP4Metadata = ERC725.encodeData(
lsp4SampleMetadata,
LSP4DigitalAssetSchema,
);

// Write the new metadata into the ERC725Y storage
// https://docs.lukso.tech/contracts/contracts/ERC725/#setdatabatch
const tx = await token.setDataBatch(encodedLSP4Metadata.keys, encodedLSP4Metadata.values);
const tx = await token.setDataBatch(
encodedLSP4Metadata.keys,
encodedLSP4Metadata.values,
);

// Wait for the transaction to be included in a block
const receipt = await tx.wait();
Expand Down
2 changes: 0 additions & 2 deletions smart-contracts-hardhat/scripts/mintTickets.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ethers } from 'hardhat';

import EventTicketsNFT from '../artifacts/contracts/Tokens/EventTicketsNFT.sol/EventTicketsNFT.json';

import { EventTicketsNFT, EventTicketsNFT__factory } from '../typechain-types';

async function deployAndCreateTickets() {
Expand Down
Loading