lemons
domingo, 5 de fevereiro de 2023
quarta-feira, 14 de dezembro de 2022
lemons
import { task } from 'hardhat/config';
import { LensHub__factory } from '../typechain-types';
import { CreateProfileDataStruct } from '../typechain-types/LensHub';
import { waitForTx, initEnv, getAddrs, ZERO_ADDRESS } from './helpers/utils';
task('create-profile', 'creates a profile').setAction(async ({}, hre) => {
const [governance, , user] = await initEnv(hre);
const addrs = getAddrs();
const lensHub = LensHub__factory.connect(addrs['lensHub proxy'], governance);
await waitForTx(lensHub.whitelistProfileCreator(user.address, true));
const inputStruct: CreateProfileDataStruct = {
to: user.address,
handle: 'zer0dot',
imageURI: 'https://ipfs.io/ipfs/QmY9dUwYu67puaWBMxRKW98LPbXCznPwHUbhX5NeWnCJbX',
followModule: ZERO_ADDRESS,
followModuleInitData: [],
followNFTURI: 'https://ipfs.io/ipfs/QmTFLSXdEQ6qsSzaXaCSNtiv6wA56qq87ytXJ182dXDQJS',
};
await waitForTx(lensHub.connect(user).createProfile(inputStruct));
console.log(`Total supply (should be 1): ${await lensHub.totalSupply()}`);
console.log(
`Profile owner: ${await lensHub.ownerOf(1)}, user address (should be the same): ${user.address}`
);
console.log(`Profile ID by handle: ${await lensHub.getProfileIdByHandle('zer0dot')}`);
});
sábado, 26 de junho de 2021
sexta-feira, 25 de junho de 2021
Assinar:
Postagens (Atom)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi13QdR2W7fyzYMTNTjJogndLa1wV0fr0B0Hlg0jiU_xFu1tfCbN2OTW8_UuxJ388-yWrJQ3iHayJXNRsyJc7ARQVrcS_jUcBrX1ayRXmU5_ogQLiK_KgZ36ek33dVNUvAtOOPRZiqZcZ7XNe6mLlkiG0Y9meueNAYObcCj5saducEW-wjlgS8QlVBDA/s320/IMG_20230116_171627363_MP.jpg)