diff --git a/src/Header.svelte b/src/Header.svelte index 60632da9a..0a35185e2 100644 --- a/src/Header.svelte +++ b/src/Header.svelte @@ -107,7 +107,7 @@ diff --git a/src/base/orgs/Org.ts b/src/base/orgs/Org.ts index 34dd06434..956213860 100644 --- a/src/base/orgs/Org.ts +++ b/src/base/orgs/Org.ts @@ -32,6 +32,8 @@ export class Org { } async setName(name: string, config: Config): Promise { + assert(config.signer); + const org = new ethers.Contract( this.address, orgAbi, @@ -78,6 +80,8 @@ export class Org { threshold: number, config: Config, ): Promise { + assert(config.signer); + const orgFactory = new ethers.Contract( config.orgFactory.address, orgFactoryAbi, @@ -93,6 +97,8 @@ export class Org { owner: string, config: Config, ): Promise { + assert(config.signer); + const orgFactory = new ethers.Contract( config.orgFactory.address, orgFactoryAbi, diff --git a/src/base/registrations/registrar.ts b/src/base/registrations/registrar.ts index 7637f5d45..4d3ef8dea 100644 --- a/src/base/registrations/registrar.ts +++ b/src/base/registrations/registrar.ts @@ -84,6 +84,8 @@ export async function registrationFee(config: Config) { } export async function registerName(name: string, owner: string, config: Config) { + assert(config.signer); + if (! name) return; let commitmentJson = window.localStorage.getItem('commitment'); @@ -119,6 +121,8 @@ async function commitAndRegister(name: string, owner: string, config: Config) { } async function commit(commitment: string, fee: BigNumber, minAge: number, config: Config) { + assert(config.signer); + state.set(State.Committing); const owner = config.signer; @@ -188,10 +192,10 @@ async function permitSignature( } async function register(name: string, owner: string, salt: Uint8Array, config: Config) { + assert(config.signer); state.set(State.Registering); - const signer = config.provider.getSigner(); - const tx = await registrar(config).connect(signer).register( + const tx = await registrar(config).connect(config.signer).register( name, owner, ethers.BigNumber.from(salt), { gasLimit: 150000 } ); console.log("Sent", tx); diff --git a/src/base/registrations/resolver.ts b/src/base/registrations/resolver.ts index 3900e0b42..1b26133ab 100644 --- a/src/base/registrations/resolver.ts +++ b/src/base/registrations/resolver.ts @@ -2,6 +2,7 @@ import type { TransactionResponse } from '@ethersproject/providers'; import type { EnsResolver } from '@ethersproject/providers'; import { ethers } from 'ethers'; import type { Config } from '@app/config'; +import { assert } from '@app/error'; const resolverAbi = [ "function multicall(bytes[] calldata data) returns(bytes[] memory results)", @@ -12,6 +13,8 @@ const resolverAbi = [ export type EnsRecord = { name: string, value: string }; export async function setRecords(name: string, records: EnsRecord[], resolver: EnsResolver, config: Config): Promise { + assert(config.signer); + const resolverContract = new ethers.Contract(resolver.address, resolverAbi, config.signer); const node = ethers.utils.namehash(`${name}.${config.registrar.domain}`);