Skip to content

Commit

Permalink
1025 feat export common abis as const (#1034)
Browse files Browse the repository at this point in the history
* feat: adding erc20 and erc721 as const

* feat: adding erc20 from core in examples

* feat: adding ERC1155 abi const

---------

Co-authored-by: Fabio Rigamonti <[email protected]>
  • Loading branch information
Valazan and fabiorigam authored Jul 9, 2024
1 parent 31c09a7 commit 369a6a5
Show file tree
Hide file tree
Showing 13 changed files with 511 additions and 598 deletions.
2 changes: 1 addition & 1 deletion docs/contracts-erc20.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const signer = (await provider.getSigner(

// Creating the contract factory
const contractFactory = thorSoloClient.contracts.createContractFactory(
VIP180_ABI,
ERC20_ABI,
erc20ContractBytecode,
signer
);
Expand Down
4 changes: 2 additions & 2 deletions docs/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ const signer = (await provider.getSigner(
)) as VeChainSigner;

// Defining a function for deploying the ERC20 contract
const setupERC20Contract = async (): Promise<Contract<typeof VIP180_ABI>> => {
const setupERC20Contract = async (): Promise<Contract<typeof ERC20_ABI>> => {
const contractFactory = thorSoloClient.contracts.createContractFactory(
VIP180_ABI,
ERC20_ABI,
erc20ContractBytecode,
signer
);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/contracts/contract-create-ERC20-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
VeChainProvider,
type VeChainSigner
} from '@vechain/sdk-network';
import { unitsUtils, VIP180_ABI } from '@vechain/sdk-core';
import { unitsUtils, ERC20_ABI } from '@vechain/sdk-core';
import { expect } from 'expect';

// ERC20 contract bytecode
Expand Down Expand Up @@ -36,7 +36,7 @@ const signer = (await provider.getSigner(

// Creating the contract factory
const contractFactory = thorSoloClient.contracts.createContractFactory(
VIP180_ABI,
ERC20_ABI,
erc20ContractBytecode,
signer
);
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/contracts/contract-delegation-ERC20.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { VIP180_ABI } from '@vechain/sdk-core';
import { ERC20_ABI } from '@vechain/sdk-core';
import {
type Contract,
ProviderInternalBaseWallet,
Expand Down Expand Up @@ -50,9 +50,9 @@ const signer = (await provider.getSigner(
)) as VeChainSigner;

// Defining a function for deploying the ERC20 contract
const setupERC20Contract = async (): Promise<Contract<typeof VIP180_ABI>> => {
const setupERC20Contract = async (): Promise<Contract<typeof ERC20_ABI>> => {
const contractFactory = thorSoloClient.contracts.createContractFactory(
VIP180_ABI,
ERC20_ABI,
erc20ContractBytecode,
signer
);
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/contracts/contract-event-filter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { VIP180_ABI } from '@vechain/sdk-core';
import { ERC20_ABI } from '@vechain/sdk-core';
import {
type Contract,
ProviderInternalBaseWallet,
Expand Down Expand Up @@ -86,9 +86,9 @@ const signer = (await provider.getSigner(
)) as VeChainSigner;

// Defining a function for deploying the ERC20 contract
const setupERC20Contract = async (): Promise<Contract<typeof VIP180_ABI>> => {
const setupERC20Contract = async (): Promise<Contract<typeof ERC20_ABI>> => {
const contractFactory = thorSoloClient.contracts.createContractFactory(
VIP180_ABI,
ERC20_ABI,
erc20ContractBytecode,
signer
);
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/contracts/contract-transfer-ERC20-token.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { unitsUtils, VIP180_ABI } from '@vechain/sdk-core';
import { unitsUtils, ERC20_ABI } from '@vechain/sdk-core';
import {
type Contract,
ProviderInternalBaseWallet,
Expand Down Expand Up @@ -35,9 +35,9 @@ const signer = (await provider.getSigner(
)) as VeChainSigner;

// Defining a function for deploying the ERC20 contract
const setupERC20Contract = async (): Promise<Contract<typeof VIP180_ABI>> => {
const setupERC20Contract = async (): Promise<Contract<typeof ERC20_ABI>> => {
const contractFactory = thorSoloClient.contracts.createContractFactory(
VIP180_ABI,
ERC20_ABI,
erc20ContractBytecode,
signer
);
Expand Down
Loading

1 comment on commit 369a6a5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Coverage

Summary

Lines Statements Branches Functions
Coverage: 100%
100% (3472/3472) 100% (814/814) 100% (718/718)
Title Tests Skipped Failures Errors Time
core 503 0 💤 0 ❌ 0 🔥 1m 5s ⏱️
network 669 0 💤 0 ❌ 0 🔥 3m 42s ⏱️
errors 48 0 💤 0 ❌ 0 🔥 11.368s ⏱️

Please sign in to comment.