-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove web3 dependency, fix deployments
- Loading branch information
Showing
5 changed files
with
24 additions
and
438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
// TODO: This is the same as the root folder scripts... fix it | ||
import ethUtil from 'ethereumjs-util'; | ||
import Web3 from 'web3'; | ||
import {ethers} from 'hardhat'; | ||
import {AbiCoder} from 'ethers'; | ||
|
||
export const ETH_ASSET_CLASS = '0xaaaebeba'; | ||
export const ERC20_ASSET_CLASS = '0x8ae85d84'; | ||
export const ERC721_ASSET_CLASS = '0x73ad2146'; | ||
|
||
export async function id(str: string) { | ||
return `0x${ethUtil | ||
return `0x${ethers | ||
.keccak256(Buffer.from(str)) | ||
.toString('hex') | ||
.substring(0, 8)}`; | ||
} | ||
|
||
export async function enc(token: string, tokenId: number) { | ||
const web3 = new Web3('http://localhost:8545'); // Mock Provider URL to eliminate warnings | ||
if (tokenId) { | ||
return web3.eth.abi.encodeParameters( | ||
return AbiCoder.defaultAbiCoder().encode( | ||
['address', 'uint256'], | ||
[token, tokenId] | ||
); | ||
} else { | ||
return web3.eth.abi.encodeParameter('address', token); | ||
return AbiCoder.defaultAbiCoder().encode(['address'], [token]); | ||
} | ||
} |
Oops, something went wrong.
e66bddc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage for this commit
Coverage Report