Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
imhson committed Sep 12, 2024
1 parent 086ae99 commit 0484559
Show file tree
Hide file tree
Showing 5 changed files with 359 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/pages/ipassets/[ipassetSlug]/ipassetDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Context } from 'src/context'
import { useStory } from 'src/context/story'
import { Address } from 'viem/accounts'
import { http } from 'viem';
import { waitForTransactionReceipt } from '@wagmi/core'
import { waitForTransactionReceipt, readContract } from '@wagmi/core'
import { sepolia, mainnet } from 'viem/chains'
import { createConfig } from '@wagmi/core'

Expand Down
27 changes: 21 additions & 6 deletions src/pages/profile/launchpad/[id]/launchpadDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function LaunchpadDetail({
try {
idRef.current && clearTimeout(idRef.current)
idRef.current = setTimeout(() => handleDeploy(id), 100000)
// Register PIL term
console.log('Register PIL term')
let registerTermResponse
switch (launchpad.data?.license_info?.termId) {
case '1':
Expand Down Expand Up @@ -135,14 +135,13 @@ function LaunchpadDetail({
const attachLicenseresponse = await client.license.attachLicenseTerms({
licenseTermsId: registerTermResponse.licenseTermsId,
licenseTemplate: '0x260B6CB6284c89dbE660c0004233f7bB99B5edE7',

ipId: launchpad.data.ip_asset_id,
txOptions: { waitForTransaction: true },
})
console.log(`Attached License Terms to IP at tx hash ${attachLicenseresponse.txHash}`)
} catch (error) {
console.log(`Attached License Terms to IP`)
console.log(error)
console.error(`Attached License Terms to IP`)
console.error(error)
}
}

Expand All @@ -165,8 +164,8 @@ function LaunchpadDetail({
address,
launchpad.data?.ip_asset_id,
launchpad.data?.name,
moment(launchpad.data?.start_date).unix().toString(),
moment(launchpad.data?.end_date).unix().toString(),
moment(launchpad.data?.start_date).unix(),
moment(launchpad.data?.end_date).unix(),
launchpad.data?.max_supply,
launchpad.data?.max_mint_per_address,
],
Expand All @@ -180,6 +179,7 @@ function LaunchpadDetail({
address,
],
],
__mode: 'prepared',
})

if (hash) {
Expand All @@ -201,6 +201,21 @@ function LaunchpadDetail({
)
}
}

const licenseTermsIdChecking = async (licenseTermsId) => {
try {

} catch (error) {
console.error(error)
idRef.current && clearTimeout(idRef.current)
toast(
error?.message?.includes('last nft sale should be end')
? 'This license is being used for an ongoing launchpad'
: 'Something went wrong',
{ type: 'error' }
)
}
}

const handlePublish = async (id: string) => {
const res = await publish(id)
Expand Down
285 changes: 285 additions & 0 deletions src/pages/register_ip_asset/abi/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
export const abi = [
{
inputs: [
{ internalType: 'address', name: 'erc6551Registry', type: 'address' },
{ internalType: 'address', name: 'ipAccountImpl', type: 'address' },
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{
inputs: [{ internalType: 'address', name: 'authority', type: 'address' }],
name: 'AccessManagedInvalidAuthority',
type: 'error',
},
{
inputs: [
{ internalType: 'address', name: 'caller', type: 'address' },
{ internalType: 'uint32', name: 'delay', type: 'uint32' },
],
name: 'AccessManagedRequiredDelay',
type: 'error',
},
{
inputs: [{ internalType: 'address', name: 'caller', type: 'address' }],
name: 'AccessManagedUnauthorized',
type: 'error',
},
{ inputs: [{ internalType: 'address', name: 'target', type: 'address' }], name: 'AddressEmptyCode', type: 'error' },
{
inputs: [{ internalType: 'address', name: 'implementation', type: 'address' }],
name: 'ERC1967InvalidImplementation',
type: 'error',
},
{ inputs: [], name: 'ERC1967NonPayable', type: 'error' },
{ inputs: [], name: 'EnforcedPause', type: 'error' },
{ inputs: [], name: 'ExpectedPause', type: 'error' },
{ inputs: [], name: 'FailedInnerCall', type: 'error' },
{ inputs: [], name: 'IPAccountRegistry_ZeroIpAccountImpl', type: 'error' },
{ inputs: [], name: 'IPAssetRegistry__AlreadyRegistered', type: 'error' },
{
inputs: [
{ internalType: 'address', name: 'contractAddress', type: 'address' },
{ internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'IPAssetRegistry__InvalidToken',
type: 'error',
},
{
inputs: [{ internalType: 'address', name: 'contractAddress', type: 'address' }],
name: 'IPAssetRegistry__UnsupportedIERC721',
type: 'error',
},
{
inputs: [{ internalType: 'address', name: 'contractAddress', type: 'address' }],
name: 'IPAssetRegistry__UnsupportedIERC721Metadata',
type: 'error',
},
{ inputs: [], name: 'IPAssetRegistry__ZeroAccessManager', type: 'error' },
{ inputs: [], name: 'InvalidInitialization', type: 'error' },
{ inputs: [], name: 'NotInitializing', type: 'error' },
{
inputs: [
{ internalType: 'uint256', name: 'value', type: 'uint256' },
{ internalType: 'uint256', name: 'length', type: 'uint256' },
],
name: 'StringsInsufficientHexLength',
type: 'error',
},
{ inputs: [], name: 'UUPSUnauthorizedCallContext', type: 'error' },
{
inputs: [{ internalType: 'bytes32', name: 'slot', type: 'bytes32' }],
name: 'UUPSUnsupportedProxiableUUID',
type: 'error',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'address', name: 'authority', type: 'address' }],
name: 'AuthorityUpdated',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'address', name: 'account', type: 'address' },
{ indexed: true, internalType: 'address', name: 'implementation', type: 'address' },
{ indexed: true, internalType: 'uint256', name: 'chainId', type: 'uint256' },
{ indexed: false, internalType: 'address', name: 'tokenContract', type: 'address' },
{ indexed: false, internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'IPAccountRegistered',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: 'address', name: 'ipId', type: 'address' },
{ indexed: true, internalType: 'uint256', name: 'chainId', type: 'uint256' },
{ indexed: true, internalType: 'address', name: 'tokenContract', type: 'address' },
{ indexed: true, internalType: 'uint256', name: 'tokenId', type: 'uint256' },
{ indexed: false, internalType: 'string', name: 'name', type: 'string' },
{ indexed: false, internalType: 'string', name: 'uri', type: 'string' },
{ indexed: false, internalType: 'uint256', name: 'registrationDate', type: 'uint256' },
],
name: 'IPRegistered',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'uint64', name: 'version', type: 'uint64' }],
name: 'Initialized',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'address', name: 'account', type: 'address' }],
name: 'Paused',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'address', name: 'account', type: 'address' }],
name: 'Unpaused',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: true, internalType: 'address', name: 'implementation', type: 'address' }],
name: 'Upgraded',
type: 'event',
},
{
inputs: [],
name: 'ERC6551_PUBLIC_REGISTRY',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'IP_ACCOUNT_IMPL',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'IP_ACCOUNT_SALT',
outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'UPGRADE_INTERFACE_VERSION',
outputs: [{ internalType: 'string', name: '', type: 'string' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: 'accessManager', type: 'address' }],
name: '__ProtocolPausable_init',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [],
name: 'authority',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'getIPAccountImpl',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: 'accessManager', type: 'address' }],
name: 'initialize',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'uint256', name: 'chainId', type: 'uint256' },
{ internalType: 'address', name: 'tokenContract', type: 'address' },
{ internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'ipAccount',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint256', name: 'chainId', type: 'uint256' },
{ internalType: 'address', name: 'tokenContract', type: 'address' },
{ internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'ipId',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'isConsumingScheduledOp',
outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: 'id', type: 'address' }],
name: 'isRegistered',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
stateMutability: 'view',
type: 'function',
},
{ inputs: [], name: 'pause', outputs: [], stateMutability: 'nonpayable', type: 'function' },
{
inputs: [],
name: 'paused',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'proxiableUUID',
outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint256', name: 'chainid', type: 'uint256' },
{ internalType: 'address', name: 'tokenContract', type: 'address' },
{ internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'register',
outputs: [{ internalType: 'address', name: 'id', type: 'address' }],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'uint256', name: 'chainId', type: 'uint256' },
{ internalType: 'address', name: 'tokenContract', type: 'address' },
{ internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'registerIpAccount',
outputs: [{ internalType: 'address', name: 'ipAccountAddress', type: 'address' }],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: 'newAuthority', type: 'address' }],
name: 'setAuthority',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [],
name: 'totalSupply',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{ inputs: [], name: 'unpause', outputs: [], stateMutability: 'nonpayable', type: 'function' },
{
inputs: [
{ internalType: 'address', name: 'newImplementation', type: 'address' },
{ internalType: 'bytes', name: 'data', type: 'bytes' },
],
name: 'upgradeToAndCall',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
]
Loading

0 comments on commit 0484559

Please sign in to comment.