Skip to content

Commit

Permalink
Add API reference guide (#81)
Browse files Browse the repository at this point in the history
Sync API ref docs with smart contracts commit 71509c4c
  • Loading branch information
segfaultxavi authored Sep 20, 2023
1 parent 2a8820e commit 8bdcc06
Show file tree
Hide file tree
Showing 63 changed files with 36,597 additions and 9 deletions.
17 changes: 9 additions & 8 deletions docs/apis/index.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
section_icon: api-icon.svg
section_icon_type: filled-svg
hide:
- navigation
---

# APIs

Select one of the topics below:

## Access Nodes
## Flare API Documentation

* [Public RPC nodes](../dev/reference/network-config.md) for Flare, Songbird and Coston.
* [Public RPC nodes for connected chains](../dev/reference/network-config.md#connected-networks)
* [Flare API Portal](../tech/api-portal.md) (private nodes)
* [Smart Contracts API](./smart-contracts/index.md) (Work in progress)

## API Documentation
## External Documentation

* [Flare API](../dev/reference/index.md)
* [web3.js API](https://docs.web3js.org/api)
* [ethers.js API](https://docs.ethers.org)

!!! info "Access Nodes"

* [Public RPC nodes](../dev/reference/network-config.md) for Flare, Songbird and Coston.
* [Public RPC nodes for connected chains](../dev/reference/network-config.md#connected-networks)
* [Flare API Portal](../tech/api-portal.md) (private nodes)
109 changes: 109 additions & 0 deletions docs/apis/smart-contracts/AddressUpdatable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: AddressUpdatable
---

<!-- This is an autogenerated file. Do not edit! -->

# `AddressUpdatable` { #ct_addressupdatable }

<div class="api-node-source" markdown>
[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol) | Inherits from [IIAddressUpdatable](./IIAddressUpdatable.md)
</div>

<div class="api-node-internal" markdown>

Abstract base class for contracts that depend on other contracts whose addresses can change.

The [`AddressUpdater`](./AddressUpdater.md) contract keeps a list of addresses for all unique and special
platform contracts. By inheriting from [`AddressUpdatable`](./AddressUpdatable.md) a contract will receive updates
if any of the platform contract addresses change.

A contract's address changes when it is redeployed, so [`AddressUpdatable`](./AddressUpdatable.md) offers a way
to keep up to date with the latest address for all dependencies.

</div>

<div class="api-node-type" markdown>

## Functions

<div class="api-node" markdown>

### `getAddressUpdater` { #fn_getaddressupdater }

<div class="api-node-source" markdown>
Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)).
</div>

<div class="api-node-internal" markdown>

```solidity
function getAddressUpdater(
) public view returns (
address _addressUpdater);
```

Returns the configured address updater.

| Returns | Type | Description |
| ------- | ---- | ----------- |
| `_addressUpdater` | `address` | The `AddresUpdater` contract that can update our contract address list, as a response to a governance call. |
</div>
</div>

<div class="api-node" markdown>

### `updateContractAddresses` { #fn_updatecontractaddresses }

<div class="api-node-source" markdown>
Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)).
</div>

<div class="api-node-internal" markdown>

```solidity
function updateContractAddresses(
bytes32[] _contractNameHashes,
address[] _contractAddresses
) external;
```

External method called from [`AddressUpdater`](./AddressUpdater.md) only.

</div>
</div>

</div>

<div class="api-node-type" markdown>

## Modifiers

<div class="api-node" markdown>

### `onlyAddressUpdater` { #md_onlyaddressupdater }

<div class="api-node-source" markdown>
Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)).
</div>

<div class="api-node-internal" markdown>

```solidity
modifier onlyAddressUpdater()
```

Only the `AdressUpdater` contract can call this method.
Its address is set at construction time but it can also update itself.

</div>
</div>

</div>

<div class="api-node-type" markdown>

## Variables

</div>

Loading

0 comments on commit 8bdcc06

Please sign in to comment.