Skip to content

Commit

Permalink
add docs and changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmgdr committed Mar 26, 2024
1 parent 74c7685 commit 3070be6
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-ears-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/celocli': patch
---

Add ability to build and view governance proposals which interact with contracts verified on celoscan
5 changes: 5 additions & 0 deletions .changeset/young-foxes-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/explorer': minor
---

Adds Celoscan as source for fetching verified contract metadata
1 change: 1 addition & 0 deletions packages/cli/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ oclif.manifest.json
src/generated
.devchain/
.devchain.tar.gz
transactions.json
transactions2.json
1 change: 0 additions & 1 deletion packages/cli/transactions.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ ___
**getContractMappingFromSourcify**(`address`): `Promise`\<`undefined` \| [`ContractMapping`](../interfaces/base.ContractMapping.md)\>

Returns the ContractMapping for the contract at that address, or undefined
by looking up the contract address in Sourcify.
by looking up the contract address on various contract verification services.

#### Parameters

Expand Down
29 changes: 20 additions & 9 deletions packages/docs/sdk/docs/explorer/classes/sourcify.Metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ light runtime verification.
- [abi](sourcify.Metadata.md#abi)
- [contractName](sourcify.Metadata.md#contractname)
- [fnMapping](sourcify.Metadata.md#fnmapping)
- [implementationAddress](sourcify.Metadata.md#implementationaddress)

### Accessors

Expand All @@ -42,15 +43,15 @@ light runtime verification.
| :------ | :------ |
| `connection` | `Connection` |
| `address` | `string` |
| `response` | `any` |
| `response` | [`MetadataResponse`](../interfaces/sourcify.MetadataResponse.md) |

#### Returns

[`Metadata`](sourcify.Metadata.md)

#### Defined in

[src/sourcify.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L73)
[src/sourcify.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L76)

## Properties

Expand All @@ -60,7 +61,7 @@ light runtime verification.

#### Defined in

[src/sourcify.ts:65](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L65)
[src/sourcify.ts:67](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L67)

___

Expand All @@ -70,7 +71,7 @@ ___

#### Defined in

[src/sourcify.ts:66](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L66)
[src/sourcify.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L68)

___

Expand All @@ -80,7 +81,17 @@ ___

#### Defined in

[src/sourcify.ts:67](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L67)
[src/sourcify.ts:70](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L70)

___

### implementationAddress

**implementationAddress**: ``null`` \| `string` = `null`

#### Defined in

[src/sourcify.ts:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L69)

## Accessors

Expand All @@ -100,7 +111,7 @@ ___

#### Defined in

[src/sourcify.ts:83](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L83)
[src/sourcify.ts:88](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L88)

## Methods

Expand All @@ -127,7 +138,7 @@ and array of AbiItems matching the query

#### Defined in

[src/sourcify.ts:152](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L152)
[src/sourcify.ts:158](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L158)

___

Expand All @@ -151,7 +162,7 @@ an AbiItem if found or null

#### Defined in

[src/sourcify.ts:136](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L136)
[src/sourcify.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L142)

___

Expand All @@ -167,4 +178,4 @@ Turn the ABI into a mapping of function selectors to ABI items.

#### Defined in

[src/sourcify.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L119)
[src/sourcify.ts:125](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L125)
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ ___
| Name | Type |
| :------ | :------ |
| `compilationTarget?` | `Record`\<`string`, `string`\> |
| `implementation?` | `string` |
| `name?` | `string` |

#### Defined in

Expand Down
8 changes: 4 additions & 4 deletions packages/docs/sdk/docs/explorer/modules/sourcify.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

**fetchMetadata**(`connection`, `contract`, `strict?`): `Promise`\<[`Metadata`](../classes/sourcify.Metadata.md) \| ``null``\>

Fetch the sourcify response and instantiate a Metadata wrapper class around it.
Try a full_match but fallback to partial_match when not strict.
Fetch the sourcify or celoscan response and instantiate a Metadata wrapper class around it.
Try a full_match but fallback to partial_match when not strict. (only valid for sourcify)

#### Parameters

Expand All @@ -42,7 +42,7 @@ Metadata or null

#### Defined in

[src/sourcify.ts:179](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L179)
[src/sourcify.ts:185](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L185)

___

Expand Down Expand Up @@ -73,4 +73,4 @@ the implementation address or null

#### Defined in

[src/sourcify.ts:228](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L228)
[src/sourcify.ts:301](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/explorer/src/sourcify.ts#L301)
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#### Defined in

[proposals.ts:466](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/governance/src/proposals.ts#L466)
[proposals.ts:464](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/governance/src/proposals.ts#L464)

## Methods

Expand All @@ -47,7 +47,7 @@

#### Defined in

[proposals.ts:468](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/governance/src/proposals.ts#L468)
[proposals.ts:466](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/governance/src/proposals.ts#L466)

___

Expand All @@ -61,4 +61,4 @@ ___

#### Defined in

[proposals.ts:473](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/governance/src/proposals.ts#L473)
[proposals.ts:471](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/governance/src/proposals.ts#L471)
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ ___

#### Defined in

[proposals.ts:460](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/governance/src/proposals.ts#L460)
[proposals.ts:458](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/governance/src/proposals.ts#L458)

___

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/governance/src/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ export class ProposalBuilder {
buildCallToExternalContract = async (
tx: ProposalTransactionJSON
): Promise<ProposalTransaction> => {
if (!tx.address || (!isValidAddress(tx.address) && !isValidAddress(tx.contract))) {
if (!tx.address || !isValidAddress(tx.address)) {
throw new Error(`${tx.contract} is not a core celo contract so address must be specified`)
}

Expand Down

0 comments on commit 3070be6

Please sign in to comment.