diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b5bc3e358..e4278adc9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,7 +50,7 @@ Install [linkchecker-markdown](https://github.com/scivision/linkchecker-markdown pip install linkcheckmd ``` -And run `linkcheckmarkdown -r docs` before submitting PRs to verify you are not introducing broken links. +And run `linkcheckmarkdown --recurse --sync docs` before submitting PRs to verify you are not introducing broken links. These are currently false positives which can be safely ignored: diff --git a/docs/apis/REST/attestation-client.md b/docs/apis/REST/attestation-client.md deleted file mode 100644 index 1bfc54c86..000000000 --- a/docs/apis/REST/attestation-client.md +++ /dev/null @@ -1,9 +0,0 @@ - - -# Attestation Client - -{% import "openapi.md" as openapi with context %} -{{ openapi.embed("attestation-client-api.json") }} \ No newline at end of file diff --git a/docs/apis/REST/btcverifier.md b/docs/apis/REST/btcverifier.md deleted file mode 100644 index b78aa57d8..000000000 --- a/docs/apis/REST/btcverifier.md +++ /dev/null @@ -1,9 +0,0 @@ - - -# BTC Verifier - -{% import "openapi.md" as openapi with context %} -{{ openapi.embed("btc-api.json") }} \ No newline at end of file diff --git a/docs/apis/REST/dogeverifier.md b/docs/apis/REST/dogeverifier.md deleted file mode 100644 index c85c4b74b..000000000 --- a/docs/apis/REST/dogeverifier.md +++ /dev/null @@ -1,9 +0,0 @@ - - -# DOGE Verifier - -{% import "openapi.md" as openapi with context %} -{{ openapi.embed("doge-api.json") }} \ No newline at end of file diff --git a/docs/apis/REST/evmverifier.md b/docs/apis/REST/evmverifier.md deleted file mode 100644 index 50b0f393d..000000000 --- a/docs/apis/REST/evmverifier.md +++ /dev/null @@ -1,9 +0,0 @@ - - -# EVM Verifier - -{% import "openapi.md" as openapi with context %} -{{ openapi.embed("evm-api.json") }} \ No newline at end of file diff --git a/docs/apis/REST/index.md b/docs/apis/REST/index.md deleted file mode 100644 index 03cc9e3ff..000000000 --- a/docs/apis/REST/index.md +++ /dev/null @@ -1,11 +0,0 @@ -# OpenAPI REST API - -## State Connector - -These are the APIs needed to interact with the different parts of the State Connector. - -* [Attestation Client](./attestation-client.md) -* [BTC Verifier](./btcverifier.md) -* [DOGE Verifier](./dogeverifier.md) -* [EVM Verifier](./evmverifier.md) -* [XRP Verifier](./xrpverifier.md) diff --git a/docs/apis/REST/openapispec/attestation-client-api.json b/docs/apis/REST/openapispec/attestation-client-api.json deleted file mode 100644 index f0dd641ba..000000000 --- a/docs/apis/REST/openapispec/attestation-client-api.json +++ /dev/null @@ -1,324 +0,0 @@ -{ - "openapi": "3.0.0", - "paths": { - "/attestation-client/api/proof/votes-for-round/{roundId}": { - "get": { - "operationId": "ProofController_votesForRound", - "summary": "", - "description": "Returns all vote data of the attestation provider for the voting round @param roundId\nthat was included into its Merkle tree. The data contains attestation responses, requests, the hash in\nMerkle tree and the Merkle proof. The data can be used to fully assemble the Merkle tree used in the vote.", - "parameters": [ - { - "name": "roundId", - "description": "The ID number of the attestation round. It corresponds to the buffer number of the Collect phase of the round.", - "required": true, - "in": "path", - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Returns all vote data for the specified voting round", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiResponseWrapper" - }, - { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VotingRoundResult" - } - } - } - } - ] - } - } - } - } - }, - "tags": [ - "Proof" - ] - } - }, - "/attestation-client/api/proof/get-specific-proof": { - "post": { - "operationId": "ProofController_getSpecificProofController", - "summary": "", - "description": "Returns proof data for specific attestation request.\nAttestation request is identified by the request data and round id in which it was submitted.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SpecificProofRequest" - } - } - } - }, - "responses": { - "200": { - "description": "A verified attestation proof.", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiResponseWrapper" - }, - { - "properties": { - "data": { - "$ref": "#/components/schemas/VotingRoundResult" - } - } - } - ] - } - } - } - } - }, - "tags": [ - "Proof" - ] - } - }, - "/attestation-client/api/proof/requests-for-round/{roundId}": { - "get": { - "operationId": "ProofController_requestsForRound", - "summary": "", - "description": "Lists all requests received by attestation client.\nEach request includes its processing status.", - "parameters": [ - { - "name": "roundId", - "required": true, - "in": "path", - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Attestation requests received in the specified round", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiResponseWrapper" - }, - { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VotingRoundRequest" - } - } - } - } - ] - } - } - } - } - }, - "tags": [ - "Proof" - ] - } - }, - "/attestation-client/api/proof/status": { - "get": { - "operationId": "ProofController_systemStatus", - "summary": "", - "description": "Get current status of the system", - "parameters": [], - "responses": { - "200": { - "description": "System status, ID number for the current round in the Request phase, and ID number for the latest finished round.", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiResponseWrapper" - }, - { - "properties": { - "data": { - "$ref": "#/components/schemas/SystemStatus" - } - } - } - ] - } - } - } - } - }, - "tags": [ - "Proof" - ] - } - } - }, - "info": { - "title": "Attestation Client Public Server", - "description": "Public server for attestation client providing data about attestations by round, and attestation status metrics.", - "version": "1.0", - "contact": {} - }, - "tags": [], - "servers": [ - { - "url": "https://attestation-coston.flare.network" - } - ], - "components": { - "schemas": { - "VotingRoundResult": { - "type": "object", - "properties": { - "roundId": { - "type": "number" - }, - "hash": { - "type": "string" - }, - "requestBytes": { - "type": "string" - }, - "request": { - "type": "object" - }, - "response": { - "type": "object" - }, - "merkleProof": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "roundId", - "hash", - "requestBytes", - "request", - "response", - "merkleProof" - ] - }, - "ApiValidationErrorDetails": { - "type": "object", - "properties": { - "className": { - "type": "string" - }, - "fieldErrors": { - "type": "object" - } - } - }, - "ApiResponseWrapper": { - "type": "object", - "properties": { - "errorMessage": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "OK", - "ERROR", - "REQUEST_BODY_ERROR", - "VALIDATION_ERROR", - "TOO_MANY_REQUESTS", - "UNAUTHORIZED", - "AUTH_ERROR", - "UPSTREAM_HTTP_ERROR", - "INVALID_REQUEST", - "NOT_IMPLEMENTED", - "PENDING" - ] - }, - "validationErrorDetails": { - "$ref": "#/components/schemas/ApiValidationErrorDetails" - } - }, - "required": [ - "status" - ] - }, - "SpecificProofRequest": { - "type": "object", - "properties": { - "roundId": { - "type": "number", - "description": "Round of the attestation request submission" - }, - "requestBytes": { - "type": "string", - "description": "Attestation request data as submitted to State Connector smart contract" - } - }, - "required": [ - "roundId", - "requestBytes" - ] - }, - "VotingRoundRequest": { - "type": "object", - "properties": { - "roundId": { - "type": "number" - }, - "requestBytes": { - "type": "string" - }, - "verificationStatus": { - "type": "string" - }, - "attestationStatus": { - "type": "string" - }, - "exceptionError": { - "type": "string" - } - }, - "required": [ - "roundId", - "requestBytes", - "verificationStatus" - ] - }, - "SystemStatus": { - "type": "object", - "properties": { - "currentBufferNumber": { - "type": "number" - }, - "latestAvailableRoundId": { - "type": "number" - } - }, - "required": [ - "currentBufferNumber", - "latestAvailableRoundId" - ] - } - } - } -} \ No newline at end of file diff --git a/docs/apis/REST/openapispec/btc-api.json b/docs/apis/REST/openapispec/btc-api.json deleted file mode 100644 index 34d5f4949..000000000 --- a/docs/apis/REST/openapispec/btc-api.json +++ /dev/null @@ -1,1840 +0,0 @@ -{ - "openapi": "3.0.0", - "paths": { - "/verifier/btc/api/indexer/state": { - "get": { - "description": "Gets the state entries from the indexer database.", - "operationId": "BTCIndexerController_indexerState", - "parameters": [], - "responses": { - "200": { - "description": "The state of the Bitcoin indexer." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/api/indexer/block-range": { - "get": { - "description": "Gets the range of available confirmed blocks in the indexer database.", - "operationId": "BTCIndexerController_blockRange", - "parameters": [], - "responses": { - "200": { - "description": "Range of available confirmed blocks.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string", - "example": "OK" - }, - "data": { - "type": "object", - "properties": { - "first": { - "type": "number", - "description": "The number of the first block in the range.", - "example": 5706001 - }, - "last": { - "type": "number", - "description": "The number of the last block in the range.", - "example": 5953106 - } - } - } - } - } - } - } - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/api/indexer/transaction/{txHash}": { - "get": { - "description": "Gets the transaction for a given transaction ID (hash).", - "operationId": "BTCIndexerController_transaction", - "parameters": [ - { - "name": "txHash", - "description": "The identifier of the transaction to be retrieved.", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Transaction information for the specified identifier." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/api/indexer/block/{blockHash}": { - "get": { - "description": "Gets a block with given hash from the indexer database", - "operationId": "BTCIndexerController_block", - "parameters": [ - { - "name": "blockHash", - "description": "The identifier of the block to be retrieved.", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Block information for the specified identifier." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/api/indexer/confirmed-block-at/{blockNumber}": { - "get": { - "description": "Gets confirmed block with the given block number. Blocks that are not confirmed yet cannot be obtained using this route.", - "operationId": "BTCIndexerController_confirmedBlockAt", - "parameters": [ - { - "name": "blockNumber", - "description": "The number of the block for which you want to retrieve confirmation status.", - "required": true, - "in": "path", - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Data about the requested block, if it is confirmed. A `null` object otherwise." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/api/indexer/block-height": { - "get": { - "description": "Gets the indexed block height.", - "operationId": "BTCIndexerController_blockHeight", - "parameters": [], - "responses": { - "200": { - "description": "Indexed block height." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/api/indexer/transaction-block/{txHash}": { - "get": { - "description": "Returns block header data for the transaction with the given transaction ID.", - "operationId": "BTCIndexerController_transactionBlock", - "parameters": [ - { - "name": "txHash", - "description": "The identifier of the transaction whose block number is to be retrieved.", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Block header data for the block where the given transaction was included." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/api/indexer/transactions": { - "get": { - "description": "Paged query for confirmed transactions subject to conditions from query parameters. Transactions are sorted first by block number and then by transaction ID", - "operationId": "BTCIndexerController_transactionsWithinBlockRange", - "parameters": [ - { - "name": "from", - "required": false, - "in": "query", - "description": "Minimal block number of query range", - "schema": { - "type": "number" - } - }, - { - "name": "to", - "required": false, - "in": "query", - "description": "Maximal block number of the query range", - "schema": { - "type": "number" - } - }, - { - "name": "paymentReference", - "required": false, - "in": "query", - "description": "0x-prefixed lowercase hex string representing 32-bytes", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "required": false, - "in": "query", - "description": "Query limit. Capped by server config settings", - "schema": { - "type": "number" - } - }, - { - "name": "offset", - "required": false, - "in": "query", - "description": "Query offset", - "schema": { - "type": "number" - } - }, - { - "name": "returnResponse", - "required": false, - "in": "query", - "description": "Whether response from node stored in the indexer database should be returned", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "List of processed transactions in the block range." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/AddressValidity": { - "post": { - "operationId": "BTCAddressValidityVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Contains:\n\n* The status of the request.\n* Indication of validity.\n* The validated address.\n * The hash of the validated address." - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/AddressValidity/prepareResponse": { - "post": { - "operationId": "BTCAddressValidityVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressValidity_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status, the address, and the address hash for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_AddressValidity_Response" - } - } - } - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/AddressValidity/mic": { - "post": { - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "operationId": "BTCAddressValidityVerifierController_mic", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressValidity_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string", - "example": "VALID" - }, - "messageIntegrityCode": { - "type": "string" - } - } - } - } - } - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/AddressValidity/prepareRequest": { - "post": { - "operationId": "BTCAddressValidityVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressValidity_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/BalanceDecreasingTransaction": { - "post": { - "operationId": "BTCBalanceDecreasingTransactionVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Contains:\n\n* The number and the timestamp of the block that contains the transaction.\n* The standard address hash.\n* The amount spent.\n* The standard payment reference." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/BalanceDecreasingTransaction/prepareResponse": { - "post": { - "operationId": "BTCBalanceDecreasingTransactionVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Indicates attestation request status." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/BalanceDecreasingTransaction/mic": { - "post": { - "operationId": "BTCBalanceDecreasingTransactionVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/BalanceDecreasingTransaction/prepareRequest": { - "post": { - "operationId": "BTCBalanceDecreasingTransactionVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/ConfirmedBlockHeightExists": { - "post": { - "operationId": "BTCConfirmedBlockHeightExistsVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Contains:\n\n * The timestamp of the block number the request wants to confirm.\n * The number of confirmations required to confirm a block.\n * The number of the latest block that has a timestamp smaller than `blockTimestamp` minus `queryWindow`.\n * The timestamp of `lowestQueryWindowBlockNumber`." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/ConfirmedBlockHeightExists/prepareResponse": { - "post": { - "operationId": "BTCConfirmedBlockHeightExistsVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status of the request." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/ConfirmedBlockHeightExists/mic": { - "post": { - "operationId": "BTCConfirmedBlockHeightExistsVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/ConfirmedBlockHeightExists/prepareRequest": { - "post": { - "operationId": "BTCConfirmedBlockHeightExistsVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/Payment": { - "post": { - "operationId": "BTCPaymentVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Status of the request." - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/Payment/prepareResponse": { - "post": { - "operationId": "BTCPaymentVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Payment_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_Payment_Response" - } - } - } - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/Payment/mic": { - "post": { - "operationId": "BTCPaymentVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Payment_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MicResponse" - } - } - } - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/Payment/prepareRequest": { - "post": { - "operationId": "BTCPaymentVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Payment_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/ReferencedPaymentNonexistence": { - "post": { - "operationId": "BTCReferencedPaymentNonexistenceVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Returns attestation request status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_ReferencedPaymentNonexistence_Response" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/ReferencedPaymentNonexistence/prepareResponse": { - "post": { - "operationId": "BTCReferencedPaymentNonexistenceVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status of the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_ReferencedPaymentNonexistence_Response" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/ReferencedPaymentNonexistence/mic": { - "post": { - "operationId": "BTCReferencedPaymentNonexistenceVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MicResponse" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/btc/ReferencedPaymentNonexistence/prepareRequest": { - "post": { - "operationId": "BTCReferencedPaymentNonexistenceVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - } - }, - "info": { - "title": "Verifier and indexer server (testBTC)", - "description": "Verifier and indexer server over an indexer database.", - "version": "1.0", - "contact": {} - }, - "tags": [], - "servers": [ - { - "url": "https://attestation-coston.flare.network" - } - ], - "components": { - "securitySchemes": { - "X-API-KEY": { - "type": "apiKey", - "in": "header", - "name": "X-API-KEY" - } - }, - "schemas": { - "EncodedRequest": { - "type": "object", - "properties": { - "abiEncodedRequest": { - "type": "string", - "description": "Abi encoded request object see this for more info: https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/encoding-decoding.md" - } - }, - "required": [ - "abiEncodedRequest" - ] - }, - "AddressValidity_RequestBody": { - "type": "object", - "properties": { - "addressStr": { - "type": "string", - "description": "Address to be verified.", - "example": "Example string" - } - }, - "required": [ - "addressStr" - ] - }, - "AddressValidity_ResponseBody": { - "type": "object", - "properties": { - "isValid": { - "type": "boolean", - "description": "Boolean indicator of the address validity.", - "example": true - }, - "standardAddress": { - "type": "string", - "description": "If 'isValid', standard form of the validated address. Otherwise an empty string.", - "example": "Example string" - }, - "standardAddressHash": { - "type": "string", - "description": "If 'isValid', standard address hash of the validated address. Otherwise a zero bytes32 string.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "isValid", - "standardAddress", - "standardAddressHash" - ] - }, - "AddressValidity_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4164647265737356616c69646974790000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/AddressValidity_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/AddressValidity_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_AddressValidity_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/AddressValidity_Response" - } - }, - "required": [ - "status" - ] - }, - "AddressValidity_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x4164647265737356616c69646974790000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Id of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/AddressValidity_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "MicResponse": { - "type": "object", - "properties": { - "status": { - "description": "Verification status.", - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "messageIntegrityCode": { - "type": "string", - "description": "Message integrity code" - } - }, - "required": [ - "status" - ] - }, - "EncodedRequestResponse": { - "type": "object", - "properties": { - "status": { - "description": "Verification status.", - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "abiEncodedRequest": { - "type": "string", - "description": "Abi encoded request object see this for more info: https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/encoding-decoding.md" - } - }, - "required": [ - "status" - ] - }, - "BalanceDecreasingTransaction_RequestBody": { - "type": "object", - "properties": { - "transactionId": { - "type": "string", - "description": "ID of the payment transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "sourceAddressIndicator": { - "type": "string", - "description": "The indicator of the address whose balance has been decreased.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "transactionId", - "sourceAddressIndicator" - ] - }, - "BalanceDecreasingTransaction_ResponseBody": { - "type": "object", - "properties": { - "blockNumber": { - "type": "string", - "description": "The number of the block in which the transaction is included.", - "example": "123" - }, - "blockTimestamp": { - "type": "string", - "description": "The timestamp of the block in which the transaction is included.", - "example": "123" - }, - "sourceAddressHash": { - "type": "string", - "description": "Standard address hash of the address indicated by the 'sourceAddressIndicator'.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "spentAmount": { - "type": "string", - "description": "Amount spent by the source address in minimal units.", - "example": "123" - }, - "standardPaymentReference": { - "type": "string", - "description": "Standard payment reference of the transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "blockNumber", - "blockTimestamp", - "sourceAddressHash", - "spentAmount", - "standardPaymentReference" - ] - }, - "BalanceDecreasingTransaction_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x42616c616e636544656372656173696e675472616e73616374696f6e00000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered. This is a security measure to prevent a collision of attestation hashes.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_BalanceDecreasingTransaction_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_Response" - } - }, - "required": [ - "status" - ] - }, - "BalanceDecreasingTransaction_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x42616c616e636544656372656173696e675472616e73616374696f6e00000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "ConfirmedBlockHeightExists_RequestBody": { - "type": "object", - "properties": { - "blockNumber": { - "type": "string", - "description": "The number of the block the request wants a confirmation of.", - "example": "123" - }, - "queryWindow": { - "type": "string", - "description": "The length of the period in which the block production rate is to be computed.", - "example": "123" - } - }, - "required": [ - "blockNumber", - "queryWindow" - ] - }, - "ConfirmedBlockHeightExists_ResponseBody": { - "type": "object", - "properties": { - "blockTimestamp": { - "type": "string", - "description": "The timestamp of the block with 'blockNumber'.", - "example": "123" - }, - "numberOfConfirmations": { - "type": "string", - "description": "The depth at which a block is considered confirmed depending on the chain. All attestation providers must agree on this number.", - "example": "123" - }, - "lowestQueryWindowBlockNumber": { - "type": "string", - "description": "The block number of the latest block that has a timestamp strictly smaller than 'blockTimestamp' - 'queryWindow'.", - "example": "123" - }, - "lowestQueryWindowBlockTimestamp": { - "type": "string", - "description": "The timestamp of the block at height 'lowestQueryWindowBlockNumber'.", - "example": "123" - } - }, - "required": [ - "blockTimestamp", - "numberOfConfirmations", - "lowestQueryWindowBlockNumber", - "lowestQueryWindowBlockTimestamp" - ] - }, - "ConfirmedBlockHeightExists_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x436f6e6669726d6564426c6f636b486569676874457869737473000000000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_ConfirmedBlockHeightExists_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_Response" - } - }, - "required": [ - "status" - ] - }, - "ConfirmedBlockHeightExists_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x436f6e6669726d6564426c6f636b486569676874457869737473000000000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "Payment_RequestBody": { - "type": "object", - "properties": { - "transactionId": { - "type": "string", - "description": "ID of the payment transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "inUtxo": { - "type": "string", - "description": "For UTXO chains, this is the index of the transaction input with source address. Always 0 for the non-utxo chains.", - "example": "123" - }, - "utxo": { - "type": "string", - "description": "For UTXO chains, this is the index of the transaction output with receiving address. Always 0 for the non-utxo chains.", - "example": "123" - } - }, - "required": [ - "transactionId", - "inUtxo", - "utxo" - ] - }, - "Payment_ResponseBody": { - "type": "object", - "properties": { - "blockNumber": { - "type": "string", - "description": "Number of the block in which the transaction is included.", - "example": "123" - }, - "blockTimestamp": { - "type": "string", - "description": "The timestamp of the block in which the transaction is included.", - "example": "123" - }, - "sourceAddressHash": { - "type": "string", - "description": "Standard address hash of the source address.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "receivingAddressHash": { - "type": "string", - "description": "Standard address hash of the receiving address. The zero 32-byte string if there is no receivingAddress (if 'status' is not success).", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "intendedReceivingAddressHash": { - "type": "string", - "description": "Standard address hash of the intended receiving address. Relevant if the transaction is unsuccessful.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "spentAmount": { - "type": "string", - "description": "Amount in minimal units spent by the source address.", - "example": "123" - }, - "intendedSpentAmount": { - "type": "string", - "description": "Amount in minimal units to be spent by the source address. Relevant if the transaction status is unsuccessful.", - "example": "123" - }, - "receivedAmount": { - "type": "string", - "description": "Amount in minimal units received by the receiving address.", - "example": "123" - }, - "intendedReceivedAmount": { - "type": "string", - "description": "Amount in minimal units intended to be received by the receiving address. Relevant if the transaction is unsuccessful.", - "example": "123" - }, - "standardPaymentReference": { - "type": "string", - "description": "[Standard payment reference](/specs/attestations/external-chains/standardPaymentReference.md) of the transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "oneToOne": { - "type": "boolean", - "description": "Indicator whether only one source and one receiver are involved in the transaction.", - "example": true - }, - "status": { - "type": "string", - "description": "[Succes status](/specs/attestations/external-chains/transactions.md#transaction-success-status) of the transaction: 0 - success, 1 - failed by sender's fault,x 2 - failed by receiver's fault.", - "example": "123" - } - }, - "required": [ - "blockNumber", - "blockTimestamp", - "sourceAddressHash", - "receivingAddressHash", - "intendedReceivingAddressHash", - "spentAmount", - "intendedSpentAmount", - "receivedAmount", - "intendedReceivedAmount", - "standardPaymentReference", - "oneToOne", - "status" - ] - }, - "Payment_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x5061796d656e7400000000000000000000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/Payment_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/Payment_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_Payment_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/Payment_Response" - } - }, - "required": [ - "status" - ] - }, - "Payment_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x5061796d656e7400000000000000000000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/Payment_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "ReferencedPaymentNonexistence_RequestBody": { - "type": "object", - "properties": { - "minimalBlockNumber": { - "type": "string", - "description": "The start block of the search range.", - "example": "123" - }, - "deadlineBlockNumber": { - "type": "string", - "description": "The blockNumber to be included in the search range.", - "example": "123" - }, - "deadlineTimestamp": { - "type": "string", - "description": "The timestamp to be included in the search range.", - "example": "123" - }, - "destinationAddressHash": { - "type": "string", - "description": "The standard address hash of the address to which the payment had to be done.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "amount": { - "type": "string", - "description": "The requested amount in minimal units that had to be payed.", - "example": "123" - }, - "standardPaymentReference": { - "type": "string", - "description": "The requested standard payment reference.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "minimalBlockNumber", - "deadlineBlockNumber", - "deadlineTimestamp", - "destinationAddressHash", - "amount", - "standardPaymentReference" - ] - }, - "ReferencedPaymentNonexistence_ResponseBody": { - "type": "object", - "properties": { - "minimalBlockTimestamp": { - "type": "string", - "description": "The timestamp of the minimalBlock.", - "example": "123" - }, - "firstOverflowBlockNumber": { - "type": "string", - "description": "The height of the firstOverflowBlock.", - "example": "123" - }, - "firstOverflowBlockTimestamp": { - "type": "string", - "description": "The timestamp of the firstOverflowBlock.", - "example": "123" - } - }, - "required": [ - "minimalBlockTimestamp", - "firstOverflowBlockNumber", - "firstOverflowBlockTimestamp" - ] - }, - "ReferencedPaymentNonexistence_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_ReferencedPaymentNonexistence_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_Response" - } - }, - "required": [ - "status" - ] - }, - "ReferencedPaymentNonexistence_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - } - } - } -} \ No newline at end of file diff --git a/docs/apis/REST/openapispec/doge-api.json b/docs/apis/REST/openapispec/doge-api.json deleted file mode 100644 index 99ab20b35..000000000 --- a/docs/apis/REST/openapispec/doge-api.json +++ /dev/null @@ -1,1840 +0,0 @@ -{ - "openapi": "3.0.0", - "paths": { - "/verifier/doge/api/indexer/state": { - "get": { - "description": "Gets the state entries from the indexer database.", - "operationId": "DOGEIndexerController_indexerState", - "parameters": [], - "responses": { - "200": { - "description": "The state of the DOGE indexer." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/api/indexer/block-range": { - "get": { - "description": "Gets the range of available confirmed blocks in the indexer database.", - "operationId": "DOGEIndexerController_blockRange", - "parameters": [], - "responses": { - "200": { - "description": "Range of available confirmed blocks.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string", - "example": "OK" - }, - "data": { - "type": "object", - "properties": { - "first": { - "type": "number", - "description": "The number of the first block in the range.", - "example": 5706001 - }, - "last": { - "type": "number", - "description": "The number of the last block in the range.", - "example": 5953106 - } - } - } - } - } - } - } - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/api/indexer/transaction/{txHash}": { - "get": { - "description": "Gets the transaction for a given transaction ID (hash).", - "operationId": "DOGEIndexerController_transaction", - "parameters": [ - { - "name": "txHash", - "description": "The identifier of the transaction to be retrieved.", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Transaction information for the specified identifier." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/api/indexer/block/{blockHash}": { - "get": { - "description": "Gets a block with given hash from the indexer database", - "operationId": "DOGEIndexerController_block", - "parameters": [ - { - "name": "blockHash", - "description": "The identifier of the block to be retrieved.", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Block information for the specified identifier." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/api/indexer/confirmed-block-at/{blockNumber}": { - "get": { - "description": "Gets confirmed block with the given block number. Blocks that are not confirmed yet cannot be obtained using this route.", - "operationId": "DOGEIndexerController_confirmedBlockAt", - "parameters": [ - { - "name": "blockNumber", - "description": "The number of the block for which you want to retrieve confirmation status.", - "required": true, - "in": "path", - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Data about the requested block, if it is confirmed. A `null` object otherwise." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/api/indexer/block-height": { - "get": { - "description": "Gets the indexed block height.", - "operationId": "DOGEIndexerController_blockHeight", - "parameters": [], - "responses": { - "200": { - "description": "Indexed block height." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/api/indexer/transaction-block/{txHash}": { - "get": { - "description": "Returns block header data for the transaction with the given transaction ID.", - "operationId": "DOGEIndexerController_transactionBlock", - "parameters": [ - { - "name": "txHash", - "description": "The identifier of the transaction whose block number is to be retrieved.", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Block header data for the block where the given transaction was included." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/api/indexer/transactions": { - "get": { - "description": "Paged query for confirmed transactions subject to conditions from query parameters. Transactions are sorted first by block number and then by transaction ID", - "operationId": "DOGEIndexerController_transactionsWithinBlockRange", - "parameters": [ - { - "name": "from", - "required": false, - "in": "query", - "description": "Minimal block number of query range", - "schema": { - "type": "number" - } - }, - { - "name": "to", - "required": false, - "in": "query", - "description": "Maximal block number of the query range", - "schema": { - "type": "number" - } - }, - { - "name": "paymentReference", - "required": false, - "in": "query", - "description": "0x-prefixed lowercase hex string representing 32-bytes", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "required": false, - "in": "query", - "description": "Query limit. Capped by server config settings", - "schema": { - "type": "number" - } - }, - { - "name": "offset", - "required": false, - "in": "query", - "description": "Query offset", - "schema": { - "type": "number" - } - }, - { - "name": "returnResponse", - "required": false, - "in": "query", - "description": "Whether response from node stored in the indexer database should be returned", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "List of processed transactions in the block range." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/AddressValidity": { - "post": { - "operationId": "DOGEAddressValidityVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Contains:\n\n* The status of the request.\n* Indication of validity.\n* The validated address.\n * The hash of the validated address." - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/AddressValidity/prepareResponse": { - "post": { - "operationId": "DOGEAddressValidityVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressValidity_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status, the address, and the address hash for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_AddressValidity_Response" - } - } - } - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/AddressValidity/mic": { - "post": { - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "operationId": "DOGEAddressValidityVerifierController_mic", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressValidity_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string", - "example": "VALID" - }, - "messageIntegrityCode": { - "type": "string" - } - } - } - } - } - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/AddressValidity/prepareRequest": { - "post": { - "operationId": "DOGEAddressValidityVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressValidity_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/BalanceDecreasingTransaction": { - "post": { - "operationId": "DOGEBalanceDecreasingTransactionVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Contains:\n\n* The number and the timestamp of the block that contains the transaction.\n* The standard address hash.\n* The amount spent.\n* The standard payment reference." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/BalanceDecreasingTransaction/prepareResponse": { - "post": { - "operationId": "DOGEBalanceDecreasingTransactionVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Indicates attestation request status." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/BalanceDecreasingTransaction/mic": { - "post": { - "operationId": "DOGEBalanceDecreasingTransactionVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/BalanceDecreasingTransaction/prepareRequest": { - "post": { - "operationId": "DOGEBalanceDecreasingTransactionVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/ConfirmedBlockHeightExists": { - "post": { - "operationId": "DOGEConfirmedBlockHeightExistsVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Contains:\n\n * The timestamp of the block number the request wants to confirm.\n * The number of confirmations required to confirm a block.\n * The number of the latest block that has a timestamp smaller than `blockTimestamp` minus `queryWindow`.\n * The timestamp of `lowestQueryWindowBlockNumber`." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/ConfirmedBlockHeightExists/prepareResponse": { - "post": { - "operationId": "DOGEConfirmedBlockHeightExistsVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status of the request." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/ConfirmedBlockHeightExists/mic": { - "post": { - "operationId": "DOGEConfirmedBlockHeightExistsVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/ConfirmedBlockHeightExists/prepareRequest": { - "post": { - "operationId": "DOGEConfirmedBlockHeightExistsVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/Payment": { - "post": { - "operationId": "DOGEPaymentVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Status of the request." - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/Payment/prepareResponse": { - "post": { - "operationId": "DOGEPaymentVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Payment_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_Payment_Response" - } - } - } - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/Payment/mic": { - "post": { - "operationId": "DOGEPaymentVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Payment_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MicResponse" - } - } - } - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/Payment/prepareRequest": { - "post": { - "operationId": "DOGEPaymentVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Payment_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/ReferencedPaymentNonexistence": { - "post": { - "operationId": "DOGEReferencedPaymentNonexistenceVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Returns attestation request status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_ReferencedPaymentNonexistence_Response" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/ReferencedPaymentNonexistence/prepareResponse": { - "post": { - "operationId": "DOGEReferencedPaymentNonexistenceVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status of the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_ReferencedPaymentNonexistence_Response" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/ReferencedPaymentNonexistence/mic": { - "post": { - "operationId": "DOGEReferencedPaymentNonexistenceVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MicResponse" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/doge/ReferencedPaymentNonexistence/prepareRequest": { - "post": { - "operationId": "DOGEReferencedPaymentNonexistenceVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - } - }, - "info": { - "title": "Verifier and indexer server (testDOGE)", - "description": "Verifier and indexer server over an indexer database.", - "version": "1.0", - "contact": {} - }, - "tags": [], - "servers": [ - { - "url": "https://attestation-coston.flare.network" - } - ], - "components": { - "securitySchemes": { - "X-API-KEY": { - "type": "apiKey", - "in": "header", - "name": "X-API-KEY" - } - }, - "schemas": { - "EncodedRequest": { - "type": "object", - "properties": { - "abiEncodedRequest": { - "type": "string", - "description": "Abi encoded request object see this for more info: https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/encoding-decoding.md" - } - }, - "required": [ - "abiEncodedRequest" - ] - }, - "AddressValidity_RequestBody": { - "type": "object", - "properties": { - "addressStr": { - "type": "string", - "description": "Address to be verified.", - "example": "Example string" - } - }, - "required": [ - "addressStr" - ] - }, - "AddressValidity_ResponseBody": { - "type": "object", - "properties": { - "isValid": { - "type": "boolean", - "description": "Boolean indicator of the address validity.", - "example": true - }, - "standardAddress": { - "type": "string", - "description": "If 'isValid', standard form of the validated address. Otherwise an empty string.", - "example": "Example string" - }, - "standardAddressHash": { - "type": "string", - "description": "If 'isValid', standard address hash of the validated address. Otherwise a zero bytes32 string.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "isValid", - "standardAddress", - "standardAddressHash" - ] - }, - "AddressValidity_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4164647265737356616c69646974790000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/AddressValidity_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/AddressValidity_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_AddressValidity_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/AddressValidity_Response" - } - }, - "required": [ - "status" - ] - }, - "AddressValidity_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x4164647265737356616c69646974790000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Id of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/AddressValidity_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "MicResponse": { - "type": "object", - "properties": { - "status": { - "description": "Verification status.", - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "messageIntegrityCode": { - "type": "string", - "description": "Message integrity code" - } - }, - "required": [ - "status" - ] - }, - "EncodedRequestResponse": { - "type": "object", - "properties": { - "status": { - "description": "Verification status.", - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "abiEncodedRequest": { - "type": "string", - "description": "Abi encoded request object see this for more info: https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/encoding-decoding.md" - } - }, - "required": [ - "status" - ] - }, - "BalanceDecreasingTransaction_RequestBody": { - "type": "object", - "properties": { - "transactionId": { - "type": "string", - "description": "ID of the payment transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "sourceAddressIndicator": { - "type": "string", - "description": "The indicator of the address whose balance has been decreased.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "transactionId", - "sourceAddressIndicator" - ] - }, - "BalanceDecreasingTransaction_ResponseBody": { - "type": "object", - "properties": { - "blockNumber": { - "type": "string", - "description": "The number of the block in which the transaction is included.", - "example": "123" - }, - "blockTimestamp": { - "type": "string", - "description": "The timestamp of the block in which the transaction is included.", - "example": "123" - }, - "sourceAddressHash": { - "type": "string", - "description": "Standard address hash of the address indicated by the 'sourceAddressIndicator'.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "spentAmount": { - "type": "string", - "description": "Amount spent by the source address in minimal units.", - "example": "123" - }, - "standardPaymentReference": { - "type": "string", - "description": "Standard payment reference of the transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "blockNumber", - "blockTimestamp", - "sourceAddressHash", - "spentAmount", - "standardPaymentReference" - ] - }, - "BalanceDecreasingTransaction_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x42616c616e636544656372656173696e675472616e73616374696f6e00000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered. This is a security measure to prevent a collision of attestation hashes.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_BalanceDecreasingTransaction_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_Response" - } - }, - "required": [ - "status" - ] - }, - "BalanceDecreasingTransaction_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x42616c616e636544656372656173696e675472616e73616374696f6e00000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "ConfirmedBlockHeightExists_RequestBody": { - "type": "object", - "properties": { - "blockNumber": { - "type": "string", - "description": "The number of the block the request wants a confirmation of.", - "example": "123" - }, - "queryWindow": { - "type": "string", - "description": "The length of the period in which the block production rate is to be computed.", - "example": "123" - } - }, - "required": [ - "blockNumber", - "queryWindow" - ] - }, - "ConfirmedBlockHeightExists_ResponseBody": { - "type": "object", - "properties": { - "blockTimestamp": { - "type": "string", - "description": "The timestamp of the block with 'blockNumber'.", - "example": "123" - }, - "numberOfConfirmations": { - "type": "string", - "description": "The depth at which a block is considered confirmed depending on the chain. All attestation providers must agree on this number.", - "example": "123" - }, - "lowestQueryWindowBlockNumber": { - "type": "string", - "description": "The block number of the latest block that has a timestamp strictly smaller than 'blockTimestamp' - 'queryWindow'.", - "example": "123" - }, - "lowestQueryWindowBlockTimestamp": { - "type": "string", - "description": "The timestamp of the block at height 'lowestQueryWindowBlockNumber'.", - "example": "123" - } - }, - "required": [ - "blockTimestamp", - "numberOfConfirmations", - "lowestQueryWindowBlockNumber", - "lowestQueryWindowBlockTimestamp" - ] - }, - "ConfirmedBlockHeightExists_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x436f6e6669726d6564426c6f636b486569676874457869737473000000000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_ConfirmedBlockHeightExists_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_Response" - } - }, - "required": [ - "status" - ] - }, - "ConfirmedBlockHeightExists_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x436f6e6669726d6564426c6f636b486569676874457869737473000000000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "Payment_RequestBody": { - "type": "object", - "properties": { - "transactionId": { - "type": "string", - "description": "ID of the payment transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "inUtxo": { - "type": "string", - "description": "For UTXO chains, this is the index of the transaction input with source address. Always 0 for the non-utxo chains.", - "example": "123" - }, - "utxo": { - "type": "string", - "description": "For UTXO chains, this is the index of the transaction output with receiving address. Always 0 for the non-utxo chains.", - "example": "123" - } - }, - "required": [ - "transactionId", - "inUtxo", - "utxo" - ] - }, - "Payment_ResponseBody": { - "type": "object", - "properties": { - "blockNumber": { - "type": "string", - "description": "Number of the block in which the transaction is included.", - "example": "123" - }, - "blockTimestamp": { - "type": "string", - "description": "The timestamp of the block in which the transaction is included.", - "example": "123" - }, - "sourceAddressHash": { - "type": "string", - "description": "Standard address hash of the source address.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "receivingAddressHash": { - "type": "string", - "description": "Standard address hash of the receiving address. The zero 32-byte string if there is no receivingAddress (if 'status' is not success).", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "intendedReceivingAddressHash": { - "type": "string", - "description": "Standard address hash of the intended receiving address. Relevant if the transaction is unsuccessful.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "spentAmount": { - "type": "string", - "description": "Amount in minimal units spent by the source address.", - "example": "123" - }, - "intendedSpentAmount": { - "type": "string", - "description": "Amount in minimal units to be spent by the source address. Relevant if the transaction status is unsuccessful.", - "example": "123" - }, - "receivedAmount": { - "type": "string", - "description": "Amount in minimal units received by the receiving address.", - "example": "123" - }, - "intendedReceivedAmount": { - "type": "string", - "description": "Amount in minimal units intended to be received by the receiving address. Relevant if the transaction is unsuccessful.", - "example": "123" - }, - "standardPaymentReference": { - "type": "string", - "description": "[Standard payment reference](/specs/attestations/external-chains/standardPaymentReference.md) of the transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "oneToOne": { - "type": "boolean", - "description": "Indicator whether only one source and one receiver are involved in the transaction.", - "example": true - }, - "status": { - "type": "string", - "description": "[Succes status](/specs/attestations/external-chains/transactions.md#transaction-success-status) of the transaction: 0 - success, 1 - failed by sender's fault,x 2 - failed by receiver's fault.", - "example": "123" - } - }, - "required": [ - "blockNumber", - "blockTimestamp", - "sourceAddressHash", - "receivingAddressHash", - "intendedReceivingAddressHash", - "spentAmount", - "intendedSpentAmount", - "receivedAmount", - "intendedReceivedAmount", - "standardPaymentReference", - "oneToOne", - "status" - ] - }, - "Payment_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x5061796d656e7400000000000000000000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/Payment_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/Payment_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_Payment_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/Payment_Response" - } - }, - "required": [ - "status" - ] - }, - "Payment_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x5061796d656e7400000000000000000000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/Payment_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "ReferencedPaymentNonexistence_RequestBody": { - "type": "object", - "properties": { - "minimalBlockNumber": { - "type": "string", - "description": "The start block of the search range.", - "example": "123" - }, - "deadlineBlockNumber": { - "type": "string", - "description": "The blockNumber to be included in the search range.", - "example": "123" - }, - "deadlineTimestamp": { - "type": "string", - "description": "The timestamp to be included in the search range.", - "example": "123" - }, - "destinationAddressHash": { - "type": "string", - "description": "The standard address hash of the address to which the payment had to be done.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "amount": { - "type": "string", - "description": "The requested amount in minimal units that had to be payed.", - "example": "123" - }, - "standardPaymentReference": { - "type": "string", - "description": "The requested standard payment reference.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "minimalBlockNumber", - "deadlineBlockNumber", - "deadlineTimestamp", - "destinationAddressHash", - "amount", - "standardPaymentReference" - ] - }, - "ReferencedPaymentNonexistence_ResponseBody": { - "type": "object", - "properties": { - "minimalBlockTimestamp": { - "type": "string", - "description": "The timestamp of the minimalBlock.", - "example": "123" - }, - "firstOverflowBlockNumber": { - "type": "string", - "description": "The height of the firstOverflowBlock.", - "example": "123" - }, - "firstOverflowBlockTimestamp": { - "type": "string", - "description": "The timestamp of the firstOverflowBlock.", - "example": "123" - } - }, - "required": [ - "minimalBlockTimestamp", - "firstOverflowBlockNumber", - "firstOverflowBlockTimestamp" - ] - }, - "ReferencedPaymentNonexistence_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_ReferencedPaymentNonexistence_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_Response" - } - }, - "required": [ - "status" - ] - }, - "ReferencedPaymentNonexistence_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - } - } - } -} \ No newline at end of file diff --git a/docs/apis/REST/openapispec/evm-api.json b/docs/apis/REST/openapispec/evm-api.json deleted file mode 100644 index 8dd8c2077..000000000 --- a/docs/apis/REST/openapispec/evm-api.json +++ /dev/null @@ -1,777 +0,0 @@ -{ - "openapi": "3.0.0", - "paths": { - "/verifier/eth/EVMTransaction": { - "post": { - "operationId": "ETHEVMTransactionVerifierController_verify", - "summary": "", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the validity status of the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_EVMTransaction_Response" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/eth/EVMTransaction/prepareResponse": { - "post": { - "operationId": "ETHEVMTransactionVerifierController_prepareResponse", - "summary": "", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EVMTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_EVMTransaction_Response" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/eth/EVMTransaction/mic": { - "post": { - "operationId": "ETHEVMTransactionVerifierController_mic", - "summary": "", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EVMTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the validity status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MicResponse" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/eth/EVMTransaction/prepareRequest": { - "post": { - "operationId": "ETHEVMTransactionVerifierController_prepareRequest", - "summary": "", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EVMTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the validity status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/flr/EVMTransaction": { - "post": { - "operationId": "FLREVMTransactionVerifierController_verify", - "summary": "", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the validity status of the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_EVMTransaction_Response" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/flr/EVMTransaction/prepareResponse": { - "post": { - "operationId": "FLREVMTransactionVerifierController_prepareResponse", - "summary": "", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EVMTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the validity status of the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_EVMTransaction_Response" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/flr/EVMTransaction/mic": { - "post": { - "operationId": "FLREVMTransactionVerifierController_mic", - "summary": "", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EVMTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MicResponse" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/flr/EVMTransaction/prepareRequest": { - "post": { - "operationId": "FLREVMTransactionVerifierController_prepareRequest", - "summary": "", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EVMTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/sgb/EVMTransaction": { - "post": { - "operationId": "SGBEVMTransactionVerifierController_verify", - "summary": "", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the validity status of the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_EVMTransaction_Response" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/sgb/EVMTransaction/prepareResponse": { - "post": { - "operationId": "SGBEVMTransactionVerifierController_prepareResponse", - "summary": "", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EVMTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the validity status of the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_EVMTransaction_Response" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/sgb/EVMTransaction/mic": { - "post": { - "operationId": "SGBEVMTransactionVerifierController_mic", - "summary": "", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EVMTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the validity status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MicResponse" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/sgb/EVMTransaction/prepareRequest": { - "post": { - "operationId": "SGBEVMTransactionVerifierController_prepareRequest", - "summary": "", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EVMTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the validity status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "EVMTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - } - }, - "info": { - "title": "Verifier server template", - "description": "The template to verifier server", - "version": "1.0", - "contact": {} - }, - "tags": [], - "servers": [], - "components": { - "securitySchemes": { - "X-API-KEY": { - "type": "apiKey", - "in": "header", - "name": "X-API-KEY" - } - }, - "schemas": { - "EncodedRequest": { - "type": "object", - "properties": { - "abiEncodedRequest": { - "type": "string", - "description": "Abi encoded request object see this for more info: https://gitlab.com/flarenetwork/state-connector-protocol/-/blob/main/attestation-objects/request-encoding-decoding.md" - } - }, - "required": [ - "abiEncodedRequest" - ] - }, - "EVMTransaction_RequestBody": { - "type": "object", - "properties": { - "transactionHash": { - "type": "string", - "description": "Hash of the transaction(transactionHash).", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "requiredConfirmations": { - "type": "string", - "description": "The height at which a block is considered confirmed by the requestor.", - "example": "123" - }, - "provideInput": { - "type": "boolean", - "description": "If true, \"input\" field is included in the response.", - "example": true - }, - "listEvents": { - "type": "boolean", - "description": "If true, events indicated by 'logIndices' are included in the response. Otherwise, no events are included in the response.", - "example": true - }, - "logIndices": { - "description": "If listEvents is false, this should be an empty list, otherwise, the request is rejected. If listEvents is true, this is the list of indices (logIndex) of the events to be relayed (sorted by the requestor). The array should contain at most 50 indices. If empty, it indicates all events in order capped by 50.", - "example": [ - "123" - ], - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "transactionHash", - "requiredConfirmations", - "provideInput", - "listEvents", - "logIndices" - ] - }, - "EVMTransaction_Event": { - "type": "object", - "properties": { - "logIndex": { - "type": "string", - "description": "The consecutive number of the event in block.", - "example": "123" - }, - "emitterAddress": { - "type": "string", - "description": "The address of the contract that emitted the event.", - "example": "0x5d4BEB38B6b71aaF6e30D0F9FeB6e21a7Ac40b3a" - }, - "topics": { - "description": "An array of up to 4 32-byte strings of indexed log arguments. The first string is the signature of the event.", - "example": [ - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "type": "array", - "items": { - "type": "string" - } - }, - "data": { - "type": "string", - "description": "Concatenated 32-byte strings of non-indexed log arguments. At least 32 bytes long.", - "example": "0x1234abcd" - }, - "removed": { - "type": "boolean", - "description": "It is true if log was removed due to a chain reorganization and false if it is a valid log.", - "example": true - } - }, - "required": [ - "logIndex", - "emitterAddress", - "topics", - "data", - "removed" - ] - }, - "EVMTransaction_ResponseBody": { - "type": "object", - "properties": { - "blockNumber": { - "type": "string", - "description": "Number of the block in which the transaction is included.", - "example": "123" - }, - "timestamp": { - "type": "string", - "description": "Timestamp of the block in which the transaction is included.", - "example": "123" - }, - "sourceAddress": { - "type": "string", - "description": "The address (from) that signed the transaction.", - "example": "0x5d4BEB38B6b71aaF6e30D0F9FeB6e21a7Ac40b3a" - }, - "isDeployment": { - "type": "boolean", - "description": "Indicate whether it is a contract creation transaction.", - "example": true - }, - "receivingAddress": { - "type": "string", - "description": "The address (to) of the receiver of the initial transaction. Zero address if 'isDeployment' is true.", - "example": "0x5d4BEB38B6b71aaF6e30D0F9FeB6e21a7Ac40b3a" - }, - "value": { - "type": "string", - "description": "The value transferred by the initial transaction in wei.", - "example": "123" - }, - "input": { - "type": "string", - "description": "If 'provideInput', this is the data send along with the initial transaction. Otherwise it is the default value '0x00'.", - "example": "0x1234abcd" - }, - "status": { - "type": "string", - "description": "Status of the transaction 1 - success, 0 - failure.", - "example": "123" - }, - "events": { - "description": "If 'listEvents' is true, an array of the requested events. Sorted by the logIndex in the same order as 'logIndices'. Otherwise, an empty array.", - "type": "array", - "items": { - "$ref": "#/components/schemas/EVMTransaction_Event" - } - } - }, - "required": [ - "blockNumber", - "timestamp", - "sourceAddress", - "isDeployment", - "receivingAddress", - "value", - "input", - "status", - "events" - ] - }, - "EVMTransaction_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x45564d5472616e73616374696f6e000000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The id of the state connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/EVMTransaction_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/EVMTransaction_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_EVMTransaction_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/EVMTransaction_Response" - } - }, - "required": [ - "status" - ] - }, - "EVMTransaction_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Attestation type id as defined for each attestation type on [this repo](https://gitlab.com/flarenetwork/state-connector-protocol/)", - "example": "0x45564d5472616e73616374696f6e000000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Id of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/EVMTransaction_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "MicResponse": { - "type": "object", - "properties": { - "status": { - "description": "Verification status.", - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "messageIntegrityCode": { - "type": "string", - "description": "Message integrity code" - } - }, - "required": [ - "status" - ] - }, - "EncodedRequestResponse": { - "type": "object", - "properties": { - "status": { - "description": "Verification status.", - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "abiEncodedRequest": { - "type": "string", - "description": "Abi encoded request object see this for more info: https://gitlab.com/flarenetwork/state-connector-protocol/-/blob/main/attestation-objects/request-encoding-decoding.md" - } - }, - "required": [ - "status" - ] - } - } - } -} \ No newline at end of file diff --git a/docs/apis/REST/openapispec/xrp-api.json b/docs/apis/REST/openapispec/xrp-api.json deleted file mode 100644 index 457d2c538..000000000 --- a/docs/apis/REST/openapispec/xrp-api.json +++ /dev/null @@ -1,1840 +0,0 @@ -{ - "openapi": "3.0.0", - "paths": { - "/verifier/xrp/api/indexer/state": { - "get": { - "description": "Gets the state entries from the indexer database.", - "operationId": "XRPIndexerController_indexerState", - "parameters": [], - "responses": { - "200": { - "description": "The state of the XRP indexer." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/api/indexer/block-range": { - "get": { - "description": "Gets the range of available confirmed blocks in the indexer database.", - "operationId": "XRPIndexerController_blockRange", - "parameters": [], - "responses": { - "200": { - "description": "Range of available confirmed blocks.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string", - "example": "OK" - }, - "data": { - "type": "object", - "properties": { - "first": { - "type": "number", - "description": "The number of the first block in the range.", - "example": 5706001 - }, - "last": { - "type": "number", - "description": "The number of the last block in the range.", - "example": 5953106 - } - } - } - } - } - } - } - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/api/indexer/transaction/{txHash}": { - "get": { - "description": "Gets the transaction for a given transaction ID (hash).", - "operationId": "XRPIndexerController_transaction", - "parameters": [ - { - "name": "txHash", - "description": "The identifier of the transaction to be retrieved.", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Transaction information for the specified identifier." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/api/indexer/block/{blockHash}": { - "get": { - "description": "Gets a block with given hash from the indexer database", - "operationId": "XRPIndexerController_block", - "parameters": [ - { - "name": "blockHash", - "description": "The identifier of the block to be retrieved.", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Block information for the specified identifier." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/api/indexer/confirmed-block-at/{blockNumber}": { - "get": { - "description": "Gets confirmed block with the given block number. Blocks that are not confirmed yet cannot be obtained using this route.", - "operationId": "XRPIndexerController_confirmedBlockAt", - "parameters": [ - { - "name": "blockNumber", - "description": "The number of the block for which you want to retrieve confirmation status.", - "required": true, - "in": "path", - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Data about the requested block, if it is confirmed. A `null` object otherwise." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/api/indexer/block-height": { - "get": { - "description": "Gets the indexed block height.", - "operationId": "XRPIndexerController_blockHeight", - "parameters": [], - "responses": { - "200": { - "description": "Indexed block height." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/api/indexer/transaction-block/{txHash}": { - "get": { - "description": "Returns block header data for the transaction with the given transaction ID.", - "operationId": "XRPIndexerController_transactionBlock", - "parameters": [ - { - "name": "txHash", - "description": "The identifier of the transaction whose block number is to be retrieved.", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Block header data for the block where the given transaction was included." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/api/indexer/transactions": { - "get": { - "description": "Paged query for confirmed transactions subject to conditions from query parameters. Transactions are sorted first by block number and then by transaction ID", - "operationId": "XRPIndexerController_transactionsWithinBlockRange", - "parameters": [ - { - "name": "from", - "required": false, - "in": "query", - "description": "Minimal block number of query range", - "schema": { - "type": "number" - } - }, - { - "name": "to", - "required": false, - "in": "query", - "description": "Maximal block number of the query range", - "schema": { - "type": "number" - } - }, - { - "name": "paymentReference", - "required": false, - "in": "query", - "description": "0x-prefixed lowercase hex string representing 32-bytes", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "required": false, - "in": "query", - "description": "Query limit. Capped by server config settings", - "schema": { - "type": "number" - } - }, - { - "name": "offset", - "required": false, - "in": "query", - "description": "Query offset", - "schema": { - "type": "number" - } - }, - { - "name": "returnResponse", - "required": false, - "in": "query", - "description": "Whether response from node stored in the indexer database should be returned", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "List of processed transactions in the block range." - } - }, - "tags": [ - "Indexer" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/AddressValidity": { - "post": { - "operationId": "XRPAddressValidityVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Contains:\n\n* The status of the request.\n* Indication of validity.\n* The validated address.\n * The hash of the validated address." - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/AddressValidity/prepareResponse": { - "post": { - "operationId": "XRPAddressValidityVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressValidity_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status, the address, and the address hash for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_AddressValidity_Response" - } - } - } - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/AddressValidity/mic": { - "post": { - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "operationId": "XRPAddressValidityVerifierController_mic", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressValidity_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string", - "example": "VALID" - }, - "messageIntegrityCode": { - "type": "string" - } - } - } - } - } - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/AddressValidity/prepareRequest": { - "post": { - "operationId": "XRPAddressValidityVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddressValidity_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "AddressValidity" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/BalanceDecreasingTransaction": { - "post": { - "operationId": "XRPBalanceDecreasingTransactionVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Contains:\n\n* The number and the timestamp of the block that contains the transaction.\n* The standard address hash.\n* The amount spent.\n* The standard payment reference." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/BalanceDecreasingTransaction/prepareResponse": { - "post": { - "operationId": "XRPBalanceDecreasingTransactionVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Indicates attestation request status." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/BalanceDecreasingTransaction/mic": { - "post": { - "operationId": "XRPBalanceDecreasingTransactionVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/BalanceDecreasingTransaction/prepareRequest": { - "post": { - "operationId": "XRPBalanceDecreasingTransactionVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification." - } - }, - "tags": [ - "BalanceDecreasingTransaction" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/ConfirmedBlockHeightExists": { - "post": { - "operationId": "XRPConfirmedBlockHeightExistsVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Contains:\n\n * The timestamp of the block number the request wants to confirm.\n * The number of confirmations required to confirm a block.\n * The number of the latest block that has a timestamp smaller than `blockTimestamp` minus `queryWindow`.\n * The timestamp of `lowestQueryWindowBlockNumber`." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/ConfirmedBlockHeightExists/prepareResponse": { - "post": { - "operationId": "XRPConfirmedBlockHeightExistsVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status of the request." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/ConfirmedBlockHeightExists/mic": { - "post": { - "operationId": "XRPConfirmedBlockHeightExistsVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/ConfirmedBlockHeightExists/prepareRequest": { - "post": { - "operationId": "XRPConfirmedBlockHeightExistsVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification." - } - }, - "tags": [ - "ConfirmedBlockHeightExists" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/Payment": { - "post": { - "operationId": "XRPPaymentVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Status of the request." - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/Payment/prepareResponse": { - "post": { - "operationId": "XRPPaymentVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Payment_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_Payment_Response" - } - } - } - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/Payment/mic": { - "post": { - "operationId": "XRPPaymentVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Payment_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MicResponse" - } - } - } - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/Payment/prepareRequest": { - "post": { - "operationId": "XRPPaymentVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Payment_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "Payment" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/ReferencedPaymentNonexistence": { - "post": { - "operationId": "XRPReferencedPaymentNonexistenceVerifierController_verify", - "description": "Tries to verify encoded attestation request without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Returns attestation request status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_ReferencedPaymentNonexistence_Response" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/ReferencedPaymentNonexistence/prepareResponse": { - "post": { - "operationId": "XRPReferencedPaymentNonexistenceVerifierController_prepareResponse", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful it returns response.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status of the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AttestationResponseDTO_ReferencedPaymentNonexistence_Response" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/ReferencedPaymentNonexistence/mic": { - "post": { - "operationId": "XRPReferencedPaymentNonexistenceVerifierController_mic", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code, and if successful, it returns the correct message integrity code.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the message integrity code for the submitted attestation request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MicResponse" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - }, - "/verifier/xrp/ReferencedPaymentNonexistence/prepareRequest": { - "post": { - "operationId": "XRPReferencedPaymentNonexistenceVerifierController_prepareRequest", - "description": "Tries to verify attestation request (given in JSON) without checking message integrity code.\nIf successful, it returns the encoding of the attestation request with the correct message integrity code, which can be directly submitted to the State Connector contract.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestNoMic" - } - } - } - }, - "responses": { - "200": { - "description": "Validation status and the request encoded according to the ABI specification.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EncodedRequestResponse" - } - } - } - } - }, - "tags": [ - "ReferencedPaymentNonexistence" - ], - "security": [ - { - "X-API-KEY": [] - } - ] - } - } - }, - "info": { - "title": "Verifier and indexer server (testXRP)", - "description": "Verifier and indexer server over an indexer database.", - "version": "1.0", - "contact": {} - }, - "tags": [], - "servers": [ - { - "url": "https://attestation-coston.flare.network" - } - ], - "components": { - "securitySchemes": { - "X-API-KEY": { - "type": "apiKey", - "in": "header", - "name": "X-API-KEY" - } - }, - "schemas": { - "EncodedRequest": { - "type": "object", - "properties": { - "abiEncodedRequest": { - "type": "string", - "description": "Abi encoded request object see this for more info: https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/encoding-decoding.md" - } - }, - "required": [ - "abiEncodedRequest" - ] - }, - "AddressValidity_RequestBody": { - "type": "object", - "properties": { - "addressStr": { - "type": "string", - "description": "Address to be verified.", - "example": "Example string" - } - }, - "required": [ - "addressStr" - ] - }, - "AddressValidity_ResponseBody": { - "type": "object", - "properties": { - "isValid": { - "type": "boolean", - "description": "Boolean indicator of the address validity.", - "example": true - }, - "standardAddress": { - "type": "string", - "description": "If 'isValid', standard form of the validated address. Otherwise an empty string.", - "example": "Example string" - }, - "standardAddressHash": { - "type": "string", - "description": "If 'isValid', standard address hash of the validated address. Otherwise a zero bytes32 string.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "isValid", - "standardAddress", - "standardAddressHash" - ] - }, - "AddressValidity_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4164647265737356616c69646974790000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/AddressValidity_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/AddressValidity_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_AddressValidity_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/AddressValidity_Response" - } - }, - "required": [ - "status" - ] - }, - "AddressValidity_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x4164647265737356616c69646974790000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Id of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/AddressValidity_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "MicResponse": { - "type": "object", - "properties": { - "status": { - "description": "Verification status.", - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "messageIntegrityCode": { - "type": "string", - "description": "Message integrity code" - } - }, - "required": [ - "status" - ] - }, - "EncodedRequestResponse": { - "type": "object", - "properties": { - "status": { - "description": "Verification status.", - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "abiEncodedRequest": { - "type": "string", - "description": "Abi encoded request object see this for more info: https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/encoding-decoding.md" - } - }, - "required": [ - "status" - ] - }, - "BalanceDecreasingTransaction_RequestBody": { - "type": "object", - "properties": { - "transactionId": { - "type": "string", - "description": "ID of the payment transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "sourceAddressIndicator": { - "type": "string", - "description": "The indicator of the address whose balance has been decreased.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "transactionId", - "sourceAddressIndicator" - ] - }, - "BalanceDecreasingTransaction_ResponseBody": { - "type": "object", - "properties": { - "blockNumber": { - "type": "string", - "description": "The number of the block in which the transaction is included.", - "example": "123" - }, - "blockTimestamp": { - "type": "string", - "description": "The timestamp of the block in which the transaction is included.", - "example": "123" - }, - "sourceAddressHash": { - "type": "string", - "description": "Standard address hash of the address indicated by the 'sourceAddressIndicator'.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "spentAmount": { - "type": "string", - "description": "Amount spent by the source address in minimal units.", - "example": "123" - }, - "standardPaymentReference": { - "type": "string", - "description": "Standard payment reference of the transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "blockNumber", - "blockTimestamp", - "sourceAddressHash", - "spentAmount", - "standardPaymentReference" - ] - }, - "BalanceDecreasingTransaction_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x42616c616e636544656372656173696e675472616e73616374696f6e00000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered. This is a security measure to prevent a collision of attestation hashes.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_BalanceDecreasingTransaction_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_Response" - } - }, - "required": [ - "status" - ] - }, - "BalanceDecreasingTransaction_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x42616c616e636544656372656173696e675472616e73616374696f6e00000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/BalanceDecreasingTransaction_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "ConfirmedBlockHeightExists_RequestBody": { - "type": "object", - "properties": { - "blockNumber": { - "type": "string", - "description": "The number of the block the request wants a confirmation of.", - "example": "123" - }, - "queryWindow": { - "type": "string", - "description": "The length of the period in which the block production rate is to be computed.", - "example": "123" - } - }, - "required": [ - "blockNumber", - "queryWindow" - ] - }, - "ConfirmedBlockHeightExists_ResponseBody": { - "type": "object", - "properties": { - "blockTimestamp": { - "type": "string", - "description": "The timestamp of the block with 'blockNumber'.", - "example": "123" - }, - "numberOfConfirmations": { - "type": "string", - "description": "The depth at which a block is considered confirmed depending on the chain. All attestation providers must agree on this number.", - "example": "123" - }, - "lowestQueryWindowBlockNumber": { - "type": "string", - "description": "The block number of the latest block that has a timestamp strictly smaller than 'blockTimestamp' - 'queryWindow'.", - "example": "123" - }, - "lowestQueryWindowBlockTimestamp": { - "type": "string", - "description": "The timestamp of the block at height 'lowestQueryWindowBlockNumber'.", - "example": "123" - } - }, - "required": [ - "blockTimestamp", - "numberOfConfirmations", - "lowestQueryWindowBlockNumber", - "lowestQueryWindowBlockTimestamp" - ] - }, - "ConfirmedBlockHeightExists_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x436f6e6669726d6564426c6f636b486569676874457869737473000000000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_ConfirmedBlockHeightExists_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_Response" - } - }, - "required": [ - "status" - ] - }, - "ConfirmedBlockHeightExists_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x436f6e6669726d6564426c6f636b486569676874457869737473000000000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ConfirmedBlockHeightExists_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "Payment_RequestBody": { - "type": "object", - "properties": { - "transactionId": { - "type": "string", - "description": "ID of the payment transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "inUtxo": { - "type": "string", - "description": "For UTXO chains, this is the index of the transaction input with source address. Always 0 for the non-utxo chains.", - "example": "123" - }, - "utxo": { - "type": "string", - "description": "For UTXO chains, this is the index of the transaction output with receiving address. Always 0 for the non-utxo chains.", - "example": "123" - } - }, - "required": [ - "transactionId", - "inUtxo", - "utxo" - ] - }, - "Payment_ResponseBody": { - "type": "object", - "properties": { - "blockNumber": { - "type": "string", - "description": "Number of the block in which the transaction is included.", - "example": "123" - }, - "blockTimestamp": { - "type": "string", - "description": "The timestamp of the block in which the transaction is included.", - "example": "123" - }, - "sourceAddressHash": { - "type": "string", - "description": "Standard address hash of the source address.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "receivingAddressHash": { - "type": "string", - "description": "Standard address hash of the receiving address. The zero 32-byte string if there is no receivingAddress (if 'status' is not success).", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "intendedReceivingAddressHash": { - "type": "string", - "description": "Standard address hash of the intended receiving address. Relevant if the transaction is unsuccessful.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "spentAmount": { - "type": "string", - "description": "Amount in minimal units spent by the source address.", - "example": "123" - }, - "intendedSpentAmount": { - "type": "string", - "description": "Amount in minimal units to be spent by the source address. Relevant if the transaction status is unsuccessful.", - "example": "123" - }, - "receivedAmount": { - "type": "string", - "description": "Amount in minimal units received by the receiving address.", - "example": "123" - }, - "intendedReceivedAmount": { - "type": "string", - "description": "Amount in minimal units intended to be received by the receiving address. Relevant if the transaction is unsuccessful.", - "example": "123" - }, - "standardPaymentReference": { - "type": "string", - "description": "[Standard payment reference](/specs/attestations/external-chains/standardPaymentReference.md) of the transaction.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "oneToOne": { - "type": "boolean", - "description": "Indicator whether only one source and one receiver are involved in the transaction.", - "example": true - }, - "status": { - "type": "string", - "description": "[Succes status](/specs/attestations/external-chains/transactions.md#transaction-success-status) of the transaction: 0 - success, 1 - failed by sender's fault,x 2 - failed by receiver's fault.", - "example": "123" - } - }, - "required": [ - "blockNumber", - "blockTimestamp", - "sourceAddressHash", - "receivingAddressHash", - "intendedReceivingAddressHash", - "spentAmount", - "intendedSpentAmount", - "receivedAmount", - "intendedReceivedAmount", - "standardPaymentReference", - "oneToOne", - "status" - ] - }, - "Payment_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x5061796d656e7400000000000000000000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/Payment_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/Payment_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_Payment_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/Payment_Response" - } - }, - "required": [ - "status" - ] - }, - "Payment_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x5061796d656e7400000000000000000000000000000000000000000000000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/Payment_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - }, - "ReferencedPaymentNonexistence_RequestBody": { - "type": "object", - "properties": { - "minimalBlockNumber": { - "type": "string", - "description": "The start block of the search range.", - "example": "123" - }, - "deadlineBlockNumber": { - "type": "string", - "description": "The blockNumber to be included in the search range.", - "example": "123" - }, - "deadlineTimestamp": { - "type": "string", - "description": "The timestamp to be included in the search range.", - "example": "123" - }, - "destinationAddressHash": { - "type": "string", - "description": "The standard address hash of the address to which the payment had to be done.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "amount": { - "type": "string", - "description": "The requested amount in minimal units that had to be payed.", - "example": "123" - }, - "standardPaymentReference": { - "type": "string", - "description": "The requested standard payment reference.", - "example": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, - "required": [ - "minimalBlockNumber", - "deadlineBlockNumber", - "deadlineTimestamp", - "destinationAddressHash", - "amount", - "standardPaymentReference" - ] - }, - "ReferencedPaymentNonexistence_ResponseBody": { - "type": "object", - "properties": { - "minimalBlockTimestamp": { - "type": "string", - "description": "The timestamp of the minimalBlock.", - "example": "123" - }, - "firstOverflowBlockNumber": { - "type": "string", - "description": "The height of the firstOverflowBlock.", - "example": "123" - }, - "firstOverflowBlockTimestamp": { - "type": "string", - "description": "The timestamp of the firstOverflowBlock.", - "example": "123" - } - }, - "required": [ - "minimalBlockTimestamp", - "firstOverflowBlockNumber", - "firstOverflowBlockTimestamp" - ] - }, - "ReferencedPaymentNonexistence_Response": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000" - }, - "sourceId": { - "type": "string", - "description": "Extracted from the request.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "votingRound": { - "type": "string", - "description": "The ID of the State Connector round in which the request was considered.", - "example": "123" - }, - "lowestUsedTimestamp": { - "type": "string", - "description": "The lowest timestamp used to generate the response.", - "example": "123" - }, - "requestBody": { - "description": "Extracted from the request.", - "allOf": [ - { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestBody" - } - ] - }, - "responseBody": { - "description": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_ResponseBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "votingRound", - "lowestUsedTimestamp", - "requestBody", - "responseBody" - ] - }, - "AttestationResponseDTO_ReferencedPaymentNonexistence_Response": { - "type": "object", - "properties": { - "status": { - "enum": [ - "VALID", - "INVALID", - "INDETERMINATE" - ], - "type": "string" - }, - "response": { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_Response" - } - }, - "required": [ - "status" - ] - }, - "ReferencedPaymentNonexistence_RequestNoMic": { - "type": "object", - "properties": { - "attestationType": { - "type": "string", - "description": "ID of the attestation type.", - "example": "0x5265666572656e6365645061796d656e744e6f6e6578697374656e6365000000" - }, - "sourceId": { - "type": "string", - "description": "ID of the data source.", - "example": "0x4254430000000000000000000000000000000000000000000000000000000000" - }, - "requestBody": { - "description": "Data defining the request. Type (struct) and interpretation is determined by the 'attestationType'.", - "allOf": [ - { - "$ref": "#/components/schemas/ReferencedPaymentNonexistence_RequestBody" - } - ] - } - }, - "required": [ - "attestationType", - "sourceId", - "requestBody" - ] - } - } - } -} \ No newline at end of file diff --git a/docs/apis/REST/xrpverifier.md b/docs/apis/REST/xrpverifier.md deleted file mode 100644 index 8b1ec73c5..000000000 --- a/docs/apis/REST/xrpverifier.md +++ /dev/null @@ -1,9 +0,0 @@ - - -# XRP Verifier - -{% import "openapi.md" as openapi with context %} -{{ openapi.embed("xrp-api.json") }} \ No newline at end of file diff --git a/docs/apis/attestation-types/AddressValidity.md b/docs/apis/attestation-types/AddressValidity.md deleted file mode 100644 index e7ffe6eb4..000000000 --- a/docs/apis/attestation-types/AddressValidity.md +++ /dev/null @@ -1,40 +0,0 @@ -# AddressValidity - -## Description - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/types/AddressValidity.sol?ref_type=heads) -
- -An assertion whether a string represents a valid address on an external chain. - -**Supported sources:** BTC, DOGE, XRP, testBTC, testDOGE, testXRP - -## Request body - -| Field | Solidity type | Description | -| ------------ | ------------- | ----------------------- | -| `addressStr` | `string` | Address to be verified. | - -## Response body - -| Field | Solidity type | Description | -| --------------------- | ------------- | ----------------------------------------------------------------------------------------------- | -| `isValid` | `bool` | Boolean indicator of the address validity. | -| `standardAddress` | `string` | If `isValid`, standard form of the validated address. Otherwise, an empty string. | -| `standardAddressHash` | `bytes32` | If `isValid`, standard address hash of the validated address. Otherwise, a zero bytes32 string. | - -## Verification - -The address is checked against all validity criteria of the chain with `sourceId`. -Indicator of validity is provided. -If the address is valid, its standard form and standard hash are computed. -Validity criteria for each supported chain: - -* [BTC](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/external-chains/address-validity/BTC.md) -* [DOGE](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/external-chains/address-validity/DOGE.md) -* [XRPL](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/external-chains/address-validity/XRPL.md) - -## Lowest Used Timestamp - -For `lowestUsedTimestamp`, `0xffffffffffffffff` ($2^{64}-1$ in hex) is used. diff --git a/docs/apis/attestation-types/BalanceDecreasingTransaction.md b/docs/apis/attestation-types/BalanceDecreasingTransaction.md deleted file mode 100644 index fe7613747..000000000 --- a/docs/apis/attestation-types/BalanceDecreasingTransaction.md +++ /dev/null @@ -1,59 +0,0 @@ -# BalanceDecreasingTransaction - -## Description - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/types/BalanceDecreasingTransaction.sol?ref_type=heads) -
- -A detection of a transaction that either decreases the balance for some address or is signed by the source address. -Such an attestation could prove a violation of an agreement and therefore provides grounds to liquidate some funds locked by a smart contract on Flare. -A transaction is considered “balance decreasing” for the address, if the balance after the transaction is lower than before or the address is among the signers of the transaction (even if its balance is greater than before the transaction). - -**Supported sources:** BTC, DOGE, XRP, testBTC, testDOGE, testXRP - -## Request body - -| Field | Solidity type | Description | -| ------------------------ | ------------- | -------------------------------------------------------------- | -| `transactionId` | `bytes32` | ID of the payment transaction. | -| `sourceAddressIndicator` | `bytes32` | The indicator of the address whose balance has been decreased. | - -## Response body - -| Field | Solidity type | Description | -| -------------------------- | ------------- | ------------------------------------------------------------------------------- | -| `blockNumber` | `uint64` | The number of the block in which the transaction is included. | -| `blockTimestamp` | `uint64` | The timestamp of the block in which the transaction is included. | -| `sourceAddressHash` | `bytes32` | Standard address hash of the address indicated by the `sourceAddressIndicator`. | -| `spentAmount` | `int256` | Amount spent by the source address in minimal units. | -| `standardPaymentReference` | `bytes32` | Standard payment reference of the transaction. | - -## Verification - -The transaction with `transactionId` is fetched from the API of the source blockchain node or relevant indexer. -If the transaction cannot be fetched or the transaction is in a block that does not have a sufficient [number of confirmations](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/configs.md#finalityconfirmation), the attestation request is rejected. -Once the transaction is received, the response fields are extracted if the transaction is balance decreasing for the indicated address. -Some of the request and response fields are chain specific as described below. -The fields can be computed with the help of a [balance decreasing summary](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/external-chains/transactions.md#balance-decreasing-summary). - -### UTXO (Bitcoin and Dogecoin) - -* `sourceAddressIndicator` is the index of the transaction input in hex padded to a 0x prefixed 32-byte string. - If the indicated input does not exist or the indicated input does not have the address, the attestation request is rejected. - The `sourceAddress` is the address of the indicated transaction input. -* `spentAmount` is the sum of values of all inputs with `sourceAddress` minus the sum of all outputs with `sourceAddress`. - Can be negative. -* `blockTimestamp` is the median time of a block. - -### XRPL - -* `sourceAddressIndicator` is the [standard address hash](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/external-chains/standardAddress.md#standard-address-hash) of the address whose balance has been decreased. - If the address indicated by `sourceAddressIndicator` is not among the signers of the transaction and the balance of the address was not lowered in the transaction, the attestation request is rejected. -* `spentAmount` is the difference between the balance of the indicated address after and before the transaction. - Can be negative. -* `blockTimestamp` is the close_time of a ledger converted to UNIX time. - -## Lowest Used Timestamp - -For `lowestUsedTimestamp`, `blockTimestamp` is used. diff --git a/docs/apis/attestation-types/ConfirmedBlockHeightExists.md b/docs/apis/attestation-types/ConfirmedBlockHeightExists.md deleted file mode 100644 index e09a429ef..000000000 --- a/docs/apis/attestation-types/ConfirmedBlockHeightExists.md +++ /dev/null @@ -1,48 +0,0 @@ -# ConfirmedBlockHeightExists - -## Description - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/types/ConfirmedBlockHeightExists.sol?ref_type=heads) -
- -An assertion that a block with `blockNumber` is confirmed. -It also provides data to compute the block production rate in the given time range. - -**Supported sources:** BTC, DOGE, XRP, testBTC, testDOGE, testXRP - -## Request body - -| Field | Solidity type | Description | -| ------------- | ------------- | ------------------------------------------------------------------------------ | -| `blockNumber` | `uint64` | The number of the block the request wants a confirmation of. | -| `queryWindow` | `uint64` | The length of the period in which the block production rate is to be computed. | - -## Response body - -| Field | Solidity type | Description | -| --------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `blockTimestamp` | `uint64` | The timestamp of the block with `blockNumber`. | -| `numberOfConfirmations` | `uint64` | The depth at which a block is considered confirmed depending on the chain. All attestation providers must agree on this number. | -| `lowestQueryWindowBlockNumber` | `uint64` | The block number of the latest block that has a timestamp strictly smaller than `blockTimestamp` - `queryWindow`. | -| `lowestQueryWindowBlockTimestamp` | `uint64` | The timestamp of the block at height `lowestQueryWindowBlockNumber`. | - -`blockNumber`, `lowestQueryWindowBlockNumber`, `blockTimestamp` and `lowestQueryWindowBlockTimestamp` can be used to compute the average block production time in the specified block range. - -## Verification - -It is checked that the block with `blockNumber` is confirmed by at least `numberOfConfirmations`. -If it is not, the request is rejected. We note a block on the tip of the chain is confirmed by 1 block. -Then `lowestQueryWindowBlock` is determined and its number and timestamp are extracted. - -Current confirmation heights consensus: - -| `Chain` | `chainId` | `numberOfConfirmations` | `timestamp` | -| ------- | --------- | ----------------------- | ----------- | -| `BTC` | 0 | 6 | mediantime | -| `DOGE` | 2 | 60 | mediantime | -| `XRP` | 3 | 3 | close_time | - -## Lowest Used Timestamp - -For `lowestUsedTimestamp`, `lowestQueryWindowBlockTimestamp` is used. diff --git a/docs/apis/attestation-types/EVMTransaction.md b/docs/apis/attestation-types/EVMTransaction.md deleted file mode 100644 index 54260aa75..000000000 --- a/docs/apis/attestation-types/EVMTransaction.md +++ /dev/null @@ -1,62 +0,0 @@ -# EVMTransaction - -## Description - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/types/EVMTransaction.sol?ref_type=heads) -
- -A relay of a transaction from an EVM chain. -This type is only relevant for EVM-compatible chains. - -**Supported sources:** ETH, FLR, SGB, testETH, testFLR, testSGB - -## Request body - -| Field | Solidity type | Description | -| ----------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `transactionHash` | `bytes32` | Hash of the transaction(transactionHash). | -| `requiredConfirmations` | `uint16` | The height at which a block is considered confirmed by the requestor. | -| `provideInput` | `bool` | If true, "input" field is included in the response. | -| `listEvents` | `bool` | If true, events indicated by `logIndices` are included in the response. Otherwise, no events are included in the response. | -| `logIndices` | `uint32[]` | If `listEvents` is `false`, this should be an empty list, otherwise, the request is rejected. If `listEvents` is `true`, this is the list of indices (logIndex) of the events to be relayed (sorted by the requestor). The array should contain at most 50 indices. If empty, it indicates all events in order capped by 50. | - -Note that events (logs) are indexed in block not in each transaction. The contract that uses the attestation should specify the order of event logs as needed and the requestor should sort `logIndices` -with respect to the set specifications. If possible, the contact should only require one `logIndex`. - -## Response body - -| Field | Solidity type | Description | -| ------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `blockNumber` | `uint64` | Number of the block in which the transaction is included. | -| `timestamp` | `uint64` | Timestamp of the block in which the transaction is included. | -| `sourceAddress` | `address` | The address (from) that signed the transaction. | -| `isDeployment` | `bool` | Indicate whether it is a contract creation transaction. | -| `receivingAddress` | `address` | The address (to) of the receiver of the initial transaction. Zero address if `isDeployment` is `true`. | -| `value` | `uint256` | The value transferred by the initial transaction in wei. | -| `input` | `bytes` | If `provideInput`, this is the data send along with the initial transaction. Otherwise, it is the default value `0x00`. | -| `status` | `uint8` | Status of the transaction 1 - success, 0 - failure. | -| `events` | `Event[]` | If `listEvents` is `true`, an array of the requested events. Sorted by the logIndex in the same order as `logIndices`. Otherwise, an empty array. | - -The fields are in line with [transaction](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash) provided by EVM node. - -An `Event` is a struct with the following fields: - -| Field | Solidity type | Description | -| ---------------- | ------------- | --------------------------------------------------------------------------------------------------- | -| `logIndex` | `uint32` | The consecutive number of the event in block. | -| `emitterAddress` | `address` | The address of the contract that emitted the event. | -| `topics` | `bytes32[]` | An array of up to four 32-byte strings of indexed log arguments. | -| `data` | `bytes` | Concatenated 32-byte strings of non-indexed log arguments. At least 32 bytes long. | -| `removed` | `bool` | It is `true` if the log was removed due to a chain reorganization and `false` if it is a valid log. | - -The fields are in line with [EVM event logs](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges). - -## Verification - -If a transaction with the `transactionId` is in a block on the main branch with at least `requiredConfirmations`, the specified data is relayed. -If an indicated event does not exist, the request is rejected. - -## Lowest Used Timestamp - -For `lowestUsedTimestamp`, `timestamp` is used. diff --git a/docs/apis/attestation-types/Payment.md b/docs/apis/attestation-types/Payment.md deleted file mode 100644 index bb5c80aec..000000000 --- a/docs/apis/attestation-types/Payment.md +++ /dev/null @@ -1,54 +0,0 @@ -# Payment - -## Description - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/types/Payment.sol?ref_type=heads) -
- -A relay of a transaction on an external chain that is considered a payment in a native currency. -Various blockchains support different types of native payments. For each blockchain, it is specified how a payment -transaction should be formed to be provable by this attestation type. -The provable payments emulate traditional banking payments from entity A to entity B in native currency with an optional payment reference. - -**Supported sources:** BTC, DOGE, XRP, testBTC, testDOGE, testXRP - -## Request body - -| Field | Solidity type | Description | -| --------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `transactionId` | `bytes32` | ID of the payment transaction. | -| `inUtxo` | `uint256` | For UTXO chains, this is the index of the transaction input with source address. Always 0 for the non-UTXO chains. | -| `utxo` | `uint256` | For UTXO chains, this is the index of the transaction output with receiving address. Always 0 for the non-UTXO chains. | - -## Response body - -| Field | Solidity type | Description | -| ------------------------------ | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `blockNumber` | `uint64` | Number of the block in which the transaction is included. | -| `blockTimestamp` | `uint64` | The timestamp of the block in which the transaction is included. | -| `sourceAddressHash` | `bytes32` | Standard address hash of the source address. | -| `receivingAddressHash` | `bytes32` | Standard address hash of the receiving address. The zero 32-byte string if there is no `receivingAddress` (if `status` is not success). | -| `intendedReceivingAddressHash` | `bytes32` | Standard address hash of the intended receiving address. Relevant if the transaction is unsuccessful. | -| `spentAmount` | `int256` | Amount in minimal units spent by the source address. | -| `intendedSpentAmount` | `int256` | Amount in minimal units to be spent by the source address. Relevant if the transaction status is unsuccessful. | -| `receivedAmount` | `int256` | Amount in minimal units received by the receiving address. | -| `intendedReceivedAmount` | `int256` | Amount in minimal units intended to be received by the receiving address. Relevant if the transaction is unsuccessful. | -| `standardPaymentReference` | `bytes32` | [Standard payment reference](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/external-chains/standardPaymentReference.md) of the transaction. | -| `oneToOne` | `bool` | Indicator whether only one source and one receiver are involved in the transaction. | -| `status` | `uint8` | [Success status](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/external-chains/transactions.md#transaction-success-status) of the transaction: 0 - success, 1 - failed by sender's fault,x 2 - failed by receiver's fault. | - -## Verification - -The transaction with `transactionId` is fetched from the API of the blockchain node or relevant indexer. -If the transaction cannot be fetched or the transaction is in a block that does not have a sufficient [number of confirmations](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/configs.md#finalityconfirmation), the attestation request is rejected. -Once the transaction is received, the [payment summary](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/external-chains/transactions.md#payment-summary) is computed according to the rules for the source chain. -If the summary is successfully calculated, the response is assembled from the summary. -`blockNumber` and `blockTimestamp` are retrieved from the block if they are not included in the transaction data. -For Bitcoin and Dogecoin, `blockTimestamp` is mediantime of the block. -For XRPL, `blockTimestamp` is close time of the ledger converted to UNIX time. -If the summary is not successfully calculated, the attestation request is rejected. - -## Lowest Used Timestamp - -For `lowestUsedTimestamp`, `blockTimestamp` is used. diff --git a/docs/apis/attestation-types/ReferencedPaymentNonexistence.md b/docs/apis/attestation-types/ReferencedPaymentNonexistence.md deleted file mode 100644 index 73e5200d9..000000000 --- a/docs/apis/attestation-types/ReferencedPaymentNonexistence.md +++ /dev/null @@ -1,73 +0,0 @@ -# ReferencedPaymentNonexistence - -## Description - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/types/ReferencedPaymentNonexistence.sol?ref_type=heads) -
- -Assertion that an agreed-upon payment has not been made by a certain deadline. -A confirmed request shows that a transaction meeting certain criteria (address, amount, reference) did not appear in the specified block range. - -This type of attestation can be used to e.g. provide grounds to liquidate funds locked by a smart contract on Flare when a payment is missed. - -**Supported sources:** BTC, DOGE, XRP, testBTC, testDOGE, testXRP - -## Request body - -| Field | Solidity type | Description | -| -------------------------- | ------------- | ----------------------------------------------------------------------------- | -| `minimalBlockNumber` | `uint64` | The start block of the search range. | -| `deadlineBlockNumber` | `uint64` | The `blockNumber` to be included in the search range. | -| `deadlineTimestamp` | `uint64` | The timestamp to be included in the search range. | -| `destinationAddressHash` | `bytes32` | The standard address hash of the address to which the payment had to be done. | -| `amount` | `uint256` | The requested amount in minimal units that had to be paid. | -| `standardPaymentReference` | `bytes32` | The requested standard payment reference. | - -The `standardPaymentReference` should not be zero (as a 32-byte sequence). - -## Response body - -| Field | Solidity type | Description | -| ----------------------------- | ------------- | ------------------------------------------ | -| `minimalBlockTimestamp` | `uint64` | The timestamp of the `minimalBlock`. | -| `firstOverflowBlockNumber` | `uint64` | The height of the `firstOverflowBlock`. | -| `firstOverflowBlockTimestamp` | `uint64` | The timestamp of the `firstOverflowBlock`. | - -`firstOverflowBlock` is the first block that has block number higher than `deadlineBlockNumber` and timestamp later than `deadlineTimestamp`. -The specified search range are blocks between heights including `minimalBlockNumber` and excluding `firstOverflowBlockNumber`. - -## Verification - -If `firstOverflowBlock` cannot be determined or does not have a sufficient [number of confirmations](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/configs.md#finalityconfirmation), the attestation request is rejected. -If `firstOverflowBlockNumber` is higher or equal to `minimalBlockNumber`, the request is rejected. -The search range are blocks between heights including `minimalBlockNumber` and excluding `firstOverflowBlockNumber`. -If the verifier does not have a view of all blocks from `minimalBlockNumber` to `firstOverflowBlockNumber`, the attestation request is rejected. -The request is confirmed if no transaction meeting the specified criteria is found in the search range. -The criteria and timestamp are chain specific. - -### UTXO (Bitcoin and Dogecoin) - -Criteria for the transaction: - -* It is not a coinbase transaction. -* The transaction has the specified [standardPaymentReference](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/external-chains/standardPaymentReference.md#btc-and-doge-blockchains). -* The sum of values of all outputs with the specified address minus the sum of values of all inputs with the specified address is greater than `amount` (in practice the sum of all values of the inputs with the specified address is zero). - -Timestamp is `mediantime`. - -### XRPL - -Criteria for the transaction: - -* The transaction is of type payment. -* The transaction has the specified [standardPaymentReference](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/external-chains/standardPaymentReference.md#xrp), -* One of the following is true: - * Transaction status is `SUCCESS` and the amount received by the specified destination address is greater than the specified `value`. - * Transaction status is `RECEIVER_FAILURE` and the specified destination address would receive an amount greater than the specified `value` had the transaction been successful. - -Timestamp is `close_time` converted to UNIX time. - -## Lowest Used Timestamp - -For `lowestUsedTimestamp`, `minimalBlockTimestamp` is used. diff --git a/docs/apis/attestation-types/index.md b/docs/apis/attestation-types/index.md deleted file mode 100644 index a546c51f2..000000000 --- a/docs/apis/attestation-types/index.md +++ /dev/null @@ -1,18 +0,0 @@ -# State Connector Attestation Types - -This section describes in detail the available [State Connector](../../tech/state-connector.md) attestation types. - -Attestation types define the format of the requests to, and the responses from, the State Connector. -They also specify fully-deterministic rules for valid responses. - -They can be used from JavaScript to perform [REST queries](../REST/index.md) to attestation providers, or from Solidity to perform requests to the State Connector and to parse its responses. - -Each attestation type has its own structures. -These are the currently available attestation types: - -* [AddressValidity](./AddressValidity.md) -* [BalanceDecreasingTransaction](./BalanceDecreasingTransaction.md) -* [ConfirmedBlockHeightExists](./ConfirmedBlockHeightExists.md) -* [EVMTransaction](./EVMTransaction.md) -* [Payment](./Payment.md) -* [ReferencedPaymentNonexistence](./ReferencedPaymentNonexistence.md) diff --git a/docs/apis/index.md b/docs/apis/index.md deleted file mode 100644 index 24e64fd3a..000000000 --- a/docs/apis/index.md +++ /dev/null @@ -1,21 +0,0 @@ -# APIs - -!!! info inline end "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). - * [Google Cloud Marketplace](https://console.cloud.google.com/marketplace/product/flare-public/api-portal-flare-network) (private nodes). - -Select one of the topics below: - -## Flare API Documentation - -* [Smart Contracts API](./smart-contracts/index.md) -* [OpenAPI REST APIs](./REST/index.md) -* [State Connector Attestation Types](./attestation-types/index.md) - -## External Documentation - -* [web3.js API](https://docs.web3js.org/api) -* [ethers.js API](https://docs.ethers.org) diff --git a/docs/apis/smart-contracts/AddressUpdatable.md b/docs/apis/smart-contracts/AddressUpdatable.md deleted file mode 100644 index b8d395d1a..000000000 --- a/docs/apis/smart-contracts/AddressUpdatable.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: AddressUpdatable -search: - boost: 0.5 ---- - - - -# `AddressUpdatable` { #ct_addressupdatable } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol) | Inherits from [IIAddressUpdatable](./IIAddressUpdatable.md) -
- -
- -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. - -
- -
- -## Functions - -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -
- -## Modifiers - -
- -### `onlyAddressUpdater` { #md_onlyaddressupdater } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -modifier onlyAddressUpdater() -``` - -Only the `AdressUpdater` contract can call this method. -Its address is set at construction time but it can also update itself. - -
-
- -
- -
- -## Variables - -
- diff --git a/docs/apis/smart-contracts/AddressUpdater.md b/docs/apis/smart-contracts/AddressUpdater.md deleted file mode 100644 index 6d93df2df..000000000 --- a/docs/apis/smart-contracts/AddressUpdater.md +++ /dev/null @@ -1,491 +0,0 @@ ---- -title: AddressUpdater -search: - boost: 0.5 ---- - - - -# `AddressUpdater` { #ct_addressupdater } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol) | Inherits from [IIAddressUpdater](./IIAddressUpdater.md), [Governed](./Governed.md) -
- -
- -Keeps track of the current address for all unique and special platform contracts. - -This contract keeps a list of addresses that gets updated by [`governance`](#fn_governance_5aa6e675) every time -any of the tracked contracts is redeployed. -This list is then used by the [`FlareContractRegistry`](./FlareContractRegistry.md), and also by [`AddressUpdatable`](./AddressUpdatable.md) -to inform all dependent contracts of any address change. - -
- -
- -## Functions - -
- -### `addOrUpdateContractNamesAndAddresses` { #fn_addorupdatecontractnamesandaddresses_8246e467 } - -
-Defined in `AddressUpdater` ([Docs](./AddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol)). -
- -
- -```solidity -function addOrUpdateContractNamesAndAddresses( - string[] _contractNames, - address[] _contractAddresses -) external; -``` - -Add or [`update`](#fn_update_9933dba6) contract names and addresses that are later used in [`updateContractAddresses`](#fn_updatecontractaddresses_1b0e2960) calls. - -Can only be called by [`governance`](#fn_governance_5aa6e675). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_contractNames` | `string[]` | Contracts names. | -| `_contractAddresses` | `address[]` | Addresses of corresponding contracts names. | - -
-
- -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `AddressUpdater` ([Docs](./AddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Governed` ([Docs](./Governed.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/Governed.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Governance contract. Must not be zero. | - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `getContractAddress` { #fn_getcontractaddress_04433bbc } - -
-Defined in `AddressUpdater` ([Docs](./AddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol)). -
- -
- -```solidity -function getContractAddress( - string _name -) external view returns ( - address); -``` - -Returns contract address for the given name, which might be address(0). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_name` | `string` | Name of the contract to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Current address for the queried contract. | -
-
- -
- -### `getContractAddressByHash` { #fn_getcontractaddressbyhash_159354a2 } - -
-Defined in `AddressUpdater` ([Docs](./AddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol)). -
- -
- -```solidity -function getContractAddressByHash( - bytes32 _nameHash -) external view returns ( - address); -``` - -Returns contract address for the given name hash, which might be address(0). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nameHash` | `bytes32` | Hash of the contract name: `keccak256(abi.encode(name))` | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Current address for the queried contract. | -
-
- -
- -### `getContractAddresses` { #fn_getcontractaddresses_ee6f63c3 } - -
-Defined in `AddressUpdater` ([Docs](./AddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol)). -
- -
- -```solidity -function getContractAddresses( - string[] _names -) external view returns ( - address[]); -``` - -Returns contract addresses for the given names, which might be address(0). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_names` | `string[]` | Names of the contracts to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Current addresses for the queried contracts. | -
-
- -
- -### `getContractAddressesByHash` { #fn_getcontractaddressesbyhash_5e11e2d1 } - -
-Defined in `AddressUpdater` ([Docs](./AddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol)). -
- -
- -```solidity -function getContractAddressesByHash( - bytes32[] _nameHashes -) external view returns ( - address[]); -``` - -Returns contract addresses for the given name hashes, which might be address(0). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nameHashes` | `bytes32[]` | Hashes of the contract names: `keccak256(abi.encode(name))` | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Current addresses for the queried contracts. | -
-
- -
- -### `getContractNamesAndAddresses` { #fn_getcontractnamesandaddresses_2f26c5c3 } - -
-Defined in `AddressUpdater` ([Docs](./AddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol)). -
- -
- -```solidity -function getContractNamesAndAddresses( -) external view returns ( - string[] _contractNames, - address[] _contractAddresses); -``` - -Returns all contract names and corresponding addresses currently being tracked. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_contractNames` | `string[]` | Array of contract names. | -| `_contractAddresses` | `address[]` | Array of contract addresses. | -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `removeContracts` { #fn_removecontracts_70d44f28 } - -
-Defined in `AddressUpdater` ([Docs](./AddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol)). -
- -
- -```solidity -function removeContracts( - string[] _contractNames -) external; -``` - -Remove contracts with given names. - -Can only be called by [`governance`](#fn_governance_5aa6e675). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_contractNames` | `string[]` | Contract names. | - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `update` { #fn_update_9933dba6 } - -
-Defined in `AddressUpdater` ([Docs](./AddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol)). -
- -
- -```solidity -function update( - string[] _contractNames, - address[] _contractAddresses, - contract IIAddressUpdatable[] _contractsToUpdate -) external; -``` - -Set or [`update`](#fn_update_9933dba6) contract names and addresses, and then apply changes to specific contracts. - -This is a combination of [`addOrUpdateContractNamesAndAddresses`](#fn_addorupdatecontractnamesandaddresses_8246e467) and [`updateContractAddresses`](#fn_updatecontractaddresses_1b0e2960). -Can only be called by [`governance`](#fn_governance_5aa6e675). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_contractNames` | `string[]` | Contracts names. | -| `_contractAddresses` | `address[]` | Addresses of corresponding contracts names. | -| `_contractsToUpdate` | `contract IIAddressUpdatable[]` | Contracts to be updated. | - -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_1b0e2960 } - -
-Defined in `AddressUpdater` ([Docs](./AddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdater.sol)). -
- -
- -```solidity -function updateContractAddresses( - contract IIAddressUpdatable[] _contractsToUpdate -) external; -``` - -Updates contract addresses on specific contracts. - -Can only be called by [`governance`](#fn_governance_5aa6e675). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_contractsToUpdate` | `contract IIAddressUpdatable[]` | Contracts to be updated, which must implement the [`IIAddressUpdatable`](./IIAddressUpdatable.md) interface. | - -
-
- -
- -
- -## Variables - -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- diff --git a/docs/apis/smart-contracts/AddressValidityVerification.md b/docs/apis/smart-contracts/AddressValidityVerification.md deleted file mode 100644 index 43e884d11..000000000 --- a/docs/apis/smart-contracts/AddressValidityVerification.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: AddressValidityVerification -search: - boost: 0.5 ---- - - - -# `AddressValidityVerification` { #ct_addressvalidityverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/AddressValidityVerification.sol) | Inherits from [IAddressValidityVerification](./IAddressValidityVerification.md) -
- -
- -Contract for verifying [`AddressValidity`](../attestation-types/AddressValidity.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This contract can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `AddressValidityVerification` ([Docs](./AddressValidityVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/AddressValidityVerification.sol)). -
- -
- -```solidity -constructor( - contract IMerkleRootStorage _merkleRootStorage -) public; -``` - -
-
- -
- -### `verifyAddressValidity` { #fn_verifyaddressvalidity_f34ef587 } - -
-Defined in `AddressValidityVerification` ([Docs](./AddressValidityVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/AddressValidityVerification.sol)). -
- -
- -```solidity -function verifyAddressValidity( - struct AddressValidity.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`AddressValidity`](../attestation-types/AddressValidity.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct AddressValidity.Proof` | The [`AddressValidity`](../attestation-types/AddressValidity.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- -
- -## Variables - -
- -### `merkleRootStorage` { #va_merklerootstorage } - -
-Defined in `AddressValidityVerification` ([Docs](./AddressValidityVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/AddressValidityVerification.sol)). -
- -
- -```solidity - contract IMerkleRootStorage merkleRootStorage -``` - -
-
- -
- diff --git a/docs/apis/smart-contracts/BalanceDecreasingTransactionVerification.md b/docs/apis/smart-contracts/BalanceDecreasingTransactionVerification.md deleted file mode 100644 index 3186fbf13..000000000 --- a/docs/apis/smart-contracts/BalanceDecreasingTransactionVerification.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: BalanceDecreasingTransactionVerification -search: - boost: 0.5 ---- - - - -# `BalanceDecreasingTransactionVerification` { #ct_balancedecreasingtransactionverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/BalanceDecreasingTransactionVerification.sol) | Inherits from [IBalanceDecreasingTransactionVerification](./IBalanceDecreasingTransactionVerification.md) -
- -
- -Contract for verifying [`BalanceDecreasingTransaction`](../attestation-types/BalanceDecreasingTransaction.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This contract can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `BalanceDecreasingTransactionVerification` ([Docs](./BalanceDecreasingTransactionVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/BalanceDecreasingTransactionVerification.sol)). -
- -
- -```solidity -constructor( - contract IMerkleRootStorage _merkleRootStorage -) public; -``` - -
-
- -
- -### `verifyBalanceDecreasingTransaction` { #fn_verifybalancedecreasingtransaction_6ec659c7 } - -
-Defined in `BalanceDecreasingTransactionVerification` ([Docs](./BalanceDecreasingTransactionVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/BalanceDecreasingTransactionVerification.sol)). -
- -
- -```solidity -function verifyBalanceDecreasingTransaction( - struct BalanceDecreasingTransaction.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`BalanceDecreasingTransaction`](../attestation-types/BalanceDecreasingTransaction.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct BalanceDecreasingTransaction.Proof` | The [`BalanceDecreasingTransaction`](../attestation-types/BalanceDecreasingTransaction.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- -
- -## Variables - -
- -### `merkleRootStorage` { #va_merklerootstorage } - -
-Defined in `BalanceDecreasingTransactionVerification` ([Docs](./BalanceDecreasingTransactionVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/BalanceDecreasingTransactionVerification.sol)). -
- -
- -```solidity - contract IMerkleRootStorage merkleRootStorage -``` - -
-
- -
- diff --git a/docs/apis/smart-contracts/CheckPointable.md b/docs/apis/smart-contracts/CheckPointable.md deleted file mode 100644 index 5814bd43e..000000000 --- a/docs/apis/smart-contracts/CheckPointable.md +++ /dev/null @@ -1,217 +0,0 @@ ---- -title: CheckPointable -search: - boost: 0.5 ---- - - - -# `CheckPointable` { #ct_checkpointable } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol) -
- -
- -Check-Pointable ERC20 Behavior. - -ERC20 behavior that adds balance check-point features. - -
- -
- -## Events - -
- -### `CreatedTotalSupplyCache` { #ev_createdtotalsupplycache } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -event CreatedTotalSupplyCache( - uint256 _blockNumber -) -``` - -Emitted when a total supply cache entry is created. -Allows history cleaners to track total supply cache cleanup opportunities off-chain. - -
-
- -
- -
- -## Functions - -
- -### `balanceHistoryCleanup` { #fn_balancehistorycleanup_f0e292c9 } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function balanceHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete balance checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | balance owner account address | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `totalSupplyCacheCleanup` { #fn_totalsupplycachecleanup_43ea370b } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function totalSupplyCacheCleanup( - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete total supply cache entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | the block number for which total supply value was cached | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of cache entries deleted (always 0 or 1) | -
-
- -
- -### `totalSupplyHistoryCleanup` { #fn_totalsupplyhistorycleanup_f62f8f3a } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function totalSupplyHistoryCleanup( - uint256 _count -) external returns ( - uint256); -``` - -Delete total supply checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -
- -## Modifiers - -
- -### `notBeforeCleanupBlock` { #md_notbeforecleanupblock } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -modifier notBeforeCleanupBlock( uint256 _blockNumber) -``` - -This method cannot be called for `_blockNumber` lower than the current cleanup block number. - -
-
- -
- -### `onlyCleaner` { #md_onlycleaner } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -modifier onlyCleaner() -``` - -Only the [`cleanerContract`](#va_cleanercontract) can call this method. - -
-
- -
- -
- -## Variables - -
- -### `cleanerContract` { #va_cleanercontract } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity - address cleanerContract -``` - -Address of the contract that is allowed to call methods for history cleaning. - -
-
- -
- diff --git a/docs/apis/smart-contracts/ClaimSetupManager.md b/docs/apis/smart-contracts/ClaimSetupManager.md deleted file mode 100644 index c9705a921..000000000 --- a/docs/apis/smart-contracts/ClaimSetupManager.md +++ /dev/null @@ -1,1533 +0,0 @@ ---- -title: ClaimSetupManager -search: - boost: 0.5 ---- - - - -# `ClaimSetupManager` { #ct_claimsetupmanager } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol) | Inherits from [IIClaimSetupManager](./IIClaimSetupManager.md), [Governed](./Governed.md), [AddressUpdatable](./AddressUpdatable.md), [CloneFactory](./CloneFactory.md), ReentrancyGuard -
- -
- -Manages automation of operations related to reward claiming. - -Rewards include [FTSO rewards](https://docs.flare.network/tech/ftso) and -[airdrops](https://docs.flare.network/tech/the-flaredrop/). -Managed operations include [Automatic Claiming](https://docs.flare.network/tech/automatic-claiming) and -[Personal Delegation Accounts](https://docs.flare.network/tech/personal-delegation-account). - -
- -
- -## Functions - -
- -### `accountToDelegationAccount` { #fn_accounttodelegationaccount_69ea2387 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function accountToDelegationAccount( - address _owner -) external view returns ( - address); -``` - -Gets the [PDA](https://docs.flare.network/tech/personal-delegation-account) of an account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address of its PDA or `address(0)` if it has not been created yet. | -
-
- -
- -### `allowedClaimRecipients` { #fn_allowedclaimrecipients_dfd14c34 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function allowedClaimRecipients( - address _owner -) external view returns ( - address[]); -``` - -Gets the addresses of recipients allowed to receive rewards on behalf of an account. -Beside these, the owner of the rewards is always authorized. -See [`setAllowedClaimRecipients`](#fn_setallowedclaimrecipients_d2a4ac61). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Addresses of all set authorized recipients. | -
-
- -
- -### `batchDelegate` { #fn_batchdelegate_dc4fcda7 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function batchDelegate( - address[] _delegatees, - uint256[] _bips -) external; -``` - -Undelegates all percentage delegations from the caller's -[PDA](https://docs.flare.network/tech/personal-delegation-account) and then [`delegate`](#fn_delegate_026e402b) to a list of accounts. - -See [`delegate`](#fn_delegate_026e402b). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegatees` | `address[]` | The addresses of the new recipients. | -| `_bips` | `uint256[]` | The percentage of voting power to be delegated to each delegatee, expressed in basis points (1/100 of one percent). Total of all `_bips` values must be lower than 10000. | - -
-
- -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `checkExecutorAndAllowedRecipient` { #fn_checkexecutorandallowedrecipient_ce2caa57 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function checkExecutorAndAllowedRecipient( - address _executor, - address _claimFor, - address _recipient -) external view; -``` - -Checks if an executor can claim on behalf of a given account and send funds to a given recipient address. - -Reverts if claiming is not possible, does nothing otherwise. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | -| `_claimFor` | `address` | | -| `_recipient` | `address` | The address where the reward would be sent. | - -
-
- -
- -### `claimExecutors` { #fn_claimexecutors_3f317fe1 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function claimExecutors( - address _owner -) external view returns ( - address[]); -``` - -Gets the addresses of executors authorized to claim for an account. -See [`setClaimExecutors`](#fn_setclaimexecutors_9119c494). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Addresses of all set executors. | -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -constructor( - address _governance, - address _addressUpdater, - uint256 _feeValueUpdateOffset, - uint256 _minFeeValueWei, - uint256 _maxFeeValueWei, - uint256 _registerExecutorFeeValueWei -) public; -``` - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Governed` ([Docs](./Governed.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/Governed.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Governance contract. Must not be zero. | - -
-
- -
- -### `delegate` { #fn_delegate_026e402b } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function delegate( - address _to, - uint256 _bips -) external; -``` - -Delegates a percentage of the caller's -[PDA](https://docs.flare.network/tech/personal-delegation-account)'s voting power to another address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_bips` | `uint256` | The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: Every call resets the delegation value. A value of 0 revokes delegation. | - -
-
- -
- -### `delegateGovernance` { #fn_delegategovernance_7a68a508 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function delegateGovernance( - address _to -) external; -``` - -Delegates all the [governance](https://docs.flare.network/tech/governance/) vote power of the caller's -[PDA](https://docs.flare.network/tech/personal-delegation-account) to another account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | Address of the recipient of the delegation. | - -
-
- -
- -### `disableDelegationAccount` { #fn_disabledelegationaccount_2394deb1 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function disableDelegationAccount( -) external; -``` - -Disables the -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA). - -When using automatic claiming, all airdrops and FTSO rewards will be sent to the owner's account. -Rewards accrued by the PDA will no longer be automatically claimed. - -Reverts if there is no PDA. - -
-
- -
- -### `enableDelegationAccount` { #fn_enabledelegationaccount_f0977215 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function enableDelegationAccount( -) external returns ( - contract IDelegationAccount); -``` - -Enables (or creates) a -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA). - -When using automatic claiming, all airdrops and FTSO rewards will be sent to the PDA, and any rewards -accrued by the PDA will be claimed too. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IDelegationAccount` | Address of the delegation account contract. | -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `getAutoClaimAddressesAndExecutorFee` { #fn_getautoclaimaddressesandexecutorfee_e24883b2 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function getAutoClaimAddressesAndExecutorFee( - address _executor, - address[] _owners -) external view returns ( - address[] _recipients, - uint256 _executorFeeValue); -``` - -Gets the [Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA) for -a list of accounts for which an executor is claiming. -Returns owner address instead if the PDA is not created yet or not enabled. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | Executor to query. | -| `_owners` | `address[]` | Array of reward owners which must have set `_executor` as their executor. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_recipients` | `address[]` | Addresses which will receive the claimed rewards. Can be the reward owners or their PDAs. | -| `_executorFeeValue` | `uint256` | Executor's fee value, in wei. | -
-
- -
- -### `getDelegationAccountData` { #fn_getdelegationaccountdata_17a1e3fc } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function getDelegationAccountData( - address _owner -) external view returns ( - contract IDelegationAccount _delegationAccount, - bool _enabled); -``` - -Gets [PDA](https://docs.flare.network/tech/personal-delegation-account) data for an account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegationAccount` | `contract IDelegationAccount` | Account's PDA address or `address(0)` if it has not been created yet. | -| `_enabled` | `bool` | Whether the PDA is enabled. | -
-
- -
- -### `getExecutorCurrentFeeValue` { #fn_getexecutorcurrentfeevalue_e25547f8 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorCurrentFeeValue( - address _executor -) public view returns ( - uint256); -``` - -Returns the current fee of a registered executor. -Reverts if the executor is not registered. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Fee in wei. | -
-
- -
- -### `getExecutorFeeValue` { #fn_getexecutorfeevalue_3f8f784c } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorFeeValue( - address _executor, - uint256 _rewardEpoch -) external view returns ( - uint256); -``` - -Returns the fee of an executor at a given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | -| `_rewardEpoch` | `uint256` | Reward Epoch ID to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Fee in wei at that reward epoch. | -
-
- -
- -### `getExecutorInfo` { #fn_getexecutorinfo_8e28b923 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorInfo( - address _executor -) external view returns ( - bool _registered, - uint256 _currentFeeValue); -``` - -Returns information about an executor. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_registered` | `bool` | Whether the executor is registered. | -| `_currentFeeValue` | `uint256` | Executor's current fee value, if registered. | -
-
- -
- -### `getExecutorScheduledFeeValueChanges` { #fn_getexecutorscheduledfeevaluechanges_950b028c } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorScheduledFeeValueChanges( - address _executor -) external view returns ( - uint256[] _feeValue, - uint256[] _validFromEpoch, - bool[] _fixed); -``` - -Returns the currently scheduled fee changes of an executor. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | Executor to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feeValue` | `uint256[]` | Array of scheduled fees. | -| `_validFromEpoch` | `uint256[]` | Array of reward epochs ID where the scheduled fees will become effective. | -| `_fixed` | `bool[]` | Array of booleans indicating if an scheduled fee change is fixed or it might still be changed. | -
-
- -
- -### `getRegisteredExecutors` { #fn_getregisteredexecutors_6e927e61 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function getRegisteredExecutors( - uint256 _start, - uint256 _end -) external view returns ( - address[] _registeredExecutors, - uint256 _totalLength); -``` - -Returns the list of executors registered through [`registerExecutor`](#fn_registerexecutor_ccce7e86). -Supports paging. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_start` | `uint256` | First executor to return. | -| `_end` | `uint256` | Last executor to return. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_registeredExecutors` | `address[]` | Addresses of the registered executors. | -| `_totalLength` | `uint256` | Total amount of executors. | -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `isClaimExecutor` { #fn_isclaimexecutor_87962abe } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function isClaimExecutor( - address _owner, - address _executor -) external view returns ( - bool); -``` - -Returns whether an executor is authorized to claim on behalf of a reward owner. -See [`setClaimExecutors`](#fn_setclaimexecutors_9119c494). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The reward owner to query. | -| `_executor` | `address` | The executor to query. | - -
-
- -
- -### `registerExecutor` { #fn_registerexecutor_ccce7e86 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function registerExecutor( - uint256 _feeValue -) external payable returns ( - uint256); -``` - -Registers the caller as an executor and sets its initial fee value. - -If the executor was already registered, this method only updates the fee, which will take effect after -[`feeValueUpdateOffset`](#va_feevalueupdateoffset) reward epochs have elapsed. - -Executor must pay a fee in order to register. See [`registerExecutorFeeValueWei`](#va_registerexecutorfeevaluewei). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_feeValue` | `uint256` | Desired fee, in wei. Must be between `minFeeValueWei` and `maxFeeValueWei`. 0 means no fee. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID when the changes become effective. | -
-
- -
- -### `revokeDelegationAt` { #fn_revokedelegationat_bbd6fbf8 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function revokeDelegationAt( - address _who, - uint256 _blockNumber -) external; -``` - -Revokes all delegation from the caller's [PDA](https://docs.flare.network/tech/personal-delegation-account) -to a given account at a given block. - -Only affects the reads via `votePowerOfAtCached()` in the specified block. - -This method should be used only to prevent rogue [`delegate`](#fn_delegate_026e402b) voting in the current voting block. -To stop delegating use [`delegate`](#fn_delegate_026e402b) with percentage of 0 or [`undelegateAll`](#fn_undelegateall_b302f393). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The account to revoke. | -| `_blockNumber` | `uint256` | Block number where the revoking will take place. Must be in the past. | - -
-
- -
- -### `setAllowedClaimRecipients` { #fn_setallowedclaimrecipients_d2a4ac61 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function setAllowedClaimRecipients( - address[] _recipients -) external; -``` - -Set the addresses of allowed recipients. -The reward owner is always an allowed recipient. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipients` | `address[]` | The new allowed recipients. All old recipients will be deleted and replaced by these. | - -
-
- -
- -### `setAutoClaiming` { #fn_setautoclaiming_e72dcdbb } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function setAutoClaiming( - address[] _executors, - bool _enableDelegationAccount -) external payable; -``` - -Sets the addresses of executors and optionally enables (creates) a -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA). - -If any of the executors is a registered executor, some fee needs to be paid. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executors` | `address[]` | The new executors. All old executors will be deleted and replaced by these. | -| `_enableDelegationAccount` | `bool` | Whether the PDA should be enabled. | - -
-
- -
- -### `setClaimExecutors` { #fn_setclaimexecutors_9119c494 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function setClaimExecutors( - address[] _executors -) external payable; -``` - -Sets the addresses of executors. - -If any of the executors is a registered executor, some fee needs to be paid. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executors` | `address[]` | The new executors. All old executors will be deleted and replaced by these. | - -
-
- -
- -### `setLibraryAddress` { #fn_setlibraryaddress_4863ba17 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function setLibraryAddress( - address _libraryAddress -) external; -``` - -Sets new library address. - -Only [`governance`](#fn_governance_5aa6e675) can call this. - -
-
- -
- -### `setMaxFeeValueWei` { #fn_setmaxfeevaluewei_2e9b6afa } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function setMaxFeeValueWei( - uint256 _maxFeeValueWei -) external; -``` - -Sets maximum fee allowed for executors, in wei. - -Only [`governance`](#fn_governance_5aa6e675) can call this. - -
-
- -
- -### `setMinFeeValueWei` { #fn_setminfeevaluewei_d8343550 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function setMinFeeValueWei( - uint256 _minFeeValueWei -) external; -``` - -Sets minimum fee allowed for executors, in wei. - -Only [`governance`](#fn_governance_5aa6e675) can call this. - -
-
- -
- -### `setRegisterExecutorFeeValueWei` { #fn_setregisterexecutorfeevaluewei_869d90a5 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function setRegisterExecutorFeeValueWei( - uint256 _registerExecutorFeeValueWei -) external; -``` - -Sets the fee required to register an executor, which must be higher than 0. - -Only [`governance`](#fn_governance_5aa6e675) can call this. - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `transferExternalToken` { #fn_transferexternaltoken_489a8a47 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function transferExternalToken( - contract IERC20 _token, - uint256 _amount -) external; -``` - -Allows the caller to transfer ERC-20 tokens from their -[PDA](https://docs.flare.network/tech/personal-delegation-account) to the owner account. - -The main use case is to move ERC-20 tokes received by mistake (by an airdrop, for example) out of the PDA -and into the main account, where they can be more easily managed. - -Reverts if the target token is the [`WNat`](./WNat.md) contract: use method [`withdraw`](#fn_withdraw_2e1a7d4d) for that. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_token` | `contract IERC20` | Target token contract address. | -| `_amount` | `uint256` | Amount of tokens to transfer. | - -
-
- -
- -### `undelegateAll` { #fn_undelegateall_b302f393 } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function undelegateAll( -) external; -``` - -Removes all delegations from the caller's [PDA](https://docs.flare.network/tech/personal-delegation-account). - -
-
- -
- -### `undelegateGovernance` { #fn_undelegategovernance_87a2a0dc } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function undelegateGovernance( -) external; -``` - -Undelegates all [governance](https://docs.flare.network/tech/governance/) vote power currently delegated by -the caller's [PDA](https://docs.flare.network/tech/personal-delegation-account). - -
-
- -
- -### `unregisterExecutor` { #fn_unregisterexecutor_868a660f } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function unregisterExecutor( -) external returns ( - uint256 _validFromEpoch); -``` - -Unregisters the caller as an executor. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_validFromEpoch` | `uint256` | Reward epoch ID when the change becomes effective. | -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -### `updateExecutorFeeValue` { #fn_updateexecutorfeevalue_831f16af } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function updateExecutorFeeValue( - uint256 _feeValue -) external returns ( - uint256); -``` - -Sets the caller's executor fee. The caller must be an executor registered through [`registerExecutor`](#fn_registerexecutor_ccce7e86). - -When called multiple times inside the same reward epoch, only the last value remains. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_feeValue` | `uint256` | Desired fee, in wei. Must be between `minFeeValueWei` and `maxFeeValueWei`. 0 means no fee. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID when the changes become effective. | -
-
- -
- -### `wNat` { #fn_wnat_9edbf007 } - -
-Defined in `IIClaimSetupManager` ([Docs](./IIClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/interface/IIClaimSetupManager.sol)). -
- -
- -```solidity -function wNat( -) external view returns ( - contract WNat); -``` - -Returns the [`WNat`](./WNat.md) contract. - -
-
- -
- -### `withdraw` { #fn_withdraw_2e1a7d4d } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -function withdraw( - uint256 _amount -) external; -``` - -Allows the caller to transfer [`WNat`](./WNat.md) wrapped tokens from their -[PDA](https://docs.flare.network/tech/personal-delegation-account) to the owner account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_amount` | `uint256` | Amount of tokens to transfer, in wei. | - -
-
- -
- -
- -## Modifiers - -
- -### `nonReentrant` { #md_nonreentrant } - -
-Defined in `ReentrancyGuard` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/utils/ReentrancyGuard.sol)). -
- -
- -```solidity -modifier nonReentrant() -``` - -Prevents a contract from calling itself, directly or indirectly. -Calling a `nonReentrant` function from another `nonReentrant` -function is not supported. It is possible to prevent this from happening -by making the `nonReentrant` function external, and make it call a -`private` function that does the actual work. - -
-
- -
- -### `onlyAddressUpdater` { #md_onlyaddressupdater } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -modifier onlyAddressUpdater() -``` - -Only the `AdressUpdater` contract can call this method. -Its address is set at construction time but it can also update itself. - -
-
- -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -### `onlyOwnerOrExecutor` { #md_onlyownerorexecutor } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity -modifier onlyOwnerOrExecutor( address _executor, - address[] _owners) -``` - -
-
- -
- -
- -## Structures - -
- -### `DelegationAccountData` { #st_delegationaccountdata } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -
-```solidity -struct DelegationAccountData { - contract IIDelegationAccount delegationAccount; - bool enabled; -} -``` - -
- -
- -### `ExecutorFee` { #st_executorfee } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -
-```solidity -struct ExecutorFee { - uint256 value; - uint256 validFromEpoch; -} -``` - -
- -
- -### `TimelockedCall` { #st_timelockedcall } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -
-```solidity -struct TimelockedCall { - uint256 allowedAfterTimestamp; - bytes encodedCall; -} -``` - -
- -
- -
- -## Variables - -
- -### `feeValueUpdateOffset` { #va_feevalueupdateoffset } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity - uint256 feeValueUpdateOffset -``` - -Number of reward epochs that must elapse before an executor's fee change takes effect. - -
-
- -
- -### `ftsoManager` { #va_ftsomanager } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity - contract IFtsoManager ftsoManager -``` - -The [`FtsoManager`](./FtsoManager.md) contract. - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `governanceVP` { #va_governancevp } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity - contract IGovernanceVotePower governanceVP -``` - -The [`GovernanceVotePower`](./GovernanceVotePower.md) contract. - -
-
- -
- -### `libraryAddress` { #va_libraryaddress } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity - address libraryAddress -``` - -
-
- -
- -### `maxFeeValueWei` { #va_maxfeevaluewei } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity - uint256 maxFeeValueWei -``` - -Maximum allowed value for an executor's fee. - -
-
- -
- -### `minFeeValueWei` { #va_minfeevaluewei } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity - uint256 minFeeValueWei -``` - -Minimum allowed value for an executor's fee. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `registerExecutorFeeValueWei` { #va_registerexecutorfeevaluewei } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity - uint256 registerExecutorFeeValueWei -``` - -Fee that must be paid to register an executor. - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- -### `wNat` { #va_wnat } - -
-Defined in `ClaimSetupManager` ([Docs](./ClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/ClaimSetupManager.sol)). -
- -
- -```solidity - contract WNat wNat -``` - -The [`WNat`](./WNat.md) contract. - -
-
- -
- diff --git a/docs/apis/smart-contracts/CleanupBlockNumberManager.md b/docs/apis/smart-contracts/CleanupBlockNumberManager.md deleted file mode 100644 index 77042ddab..000000000 --- a/docs/apis/smart-contracts/CleanupBlockNumberManager.md +++ /dev/null @@ -1,653 +0,0 @@ ---- -title: CleanupBlockNumberManager -search: - boost: 0.5 ---- - - - -# `CleanupBlockNumberManager` { #ct_cleanupblocknumbermanager } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol) | Inherits from [Governed](./Governed.md), [AddressUpdatable](./AddressUpdatable.md) -
- -
- -Token history cleanup manager. - -Maintains the list of cleanable tokens for which history cleanup can be collectively executed. - -
- -
- -## Events - -
- -### `CleanupBlockNumberSet` { #ev_cleanupblocknumberset } - -
-Defined in `CleanupBlockNumberManager` ([Docs](./CleanupBlockNumberManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol)). -
- -
- -```solidity -event CleanupBlockNumberSet( - contract IICleanable theContract, - uint256 blockNumber, - bool success -) -``` - -Emitted when an attempt has been made to set the cleanup block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `theContract` | `contract IICleanable` | The token contract address. | -| `blockNumber` | `uint256` | The block number being set. | -| `success` | `bool` | Whether it succeeded or not. | - -
-
- -
- -### `GovernanceCallTimelocked` { #ev_governancecalltimelocked } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceCallTimelocked( - bytes4 selector, - uint256 allowedAfterTimestamp, - bytes encodedCall -) -``` - -Emitted when a new [`governance`](#fn_governance_5aa6e675) call has been recorded and is now waiting for the time lock to expire. - -
-
- -
- -### `GovernanceInitialised` { #ev_governanceinitialised } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceInitialised( - address initialGovernance -) -``` - -Emitted when the [`governance`](#fn_governance_5aa6e675) address is initialized. -This address will be used until production mode is entered (see [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered)). -At that point the [`governance`](#fn_governance_5aa6e675) address is taken from [`GovernanceSettings`](./GovernanceSettings.md). - -
-
- -
- -### `GovernedProductionModeEntered` { #ev_governedproductionmodeentered } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernedProductionModeEntered( - address governanceSettings -) -``` - -Emitted when [`governance`](#fn_governance_5aa6e675) is enabled and the [`governance`](#fn_governance_5aa6e675) address cannot be changed anymore -(only through a network fork). - -
-
- -
- -### `RegistrationUpdated` { #ev_registrationupdated } - -
-Defined in `CleanupBlockNumberManager` ([Docs](./CleanupBlockNumberManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol)). -
- -
- -```solidity -event RegistrationUpdated( - contract IICleanable theContract, - bool add -) -``` - -Emitted when a new token has been registered to have its history managed by us, or -an old one unregistered. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `theContract` | `contract IICleanable` | The token contract address. | -| `add` | `bool` | **true** is the token has been registered, **false** if unregistered. | - -
-
- -
- -### `TimelockedGovernanceCallCanceled` { #ev_timelockedgovernancecallcanceled } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallCanceled( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is canceled before execution. - -
-
- -
- -### `TimelockedGovernanceCallExecuted` { #ev_timelockedgovernancecallexecuted } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallExecuted( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is executed. - -
-
- -
- -
- -## Functions - -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `CleanupBlockNumberManager` ([Docs](./CleanupBlockNumberManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol)). -
- -
- -```solidity -constructor( - address _governance, - address _addressUpdater, - string _triggerContractName -) public; -``` - -Build a new instance. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Contract address that can make governance calls. See [`Governed`](./Governed.md). | -| `_addressUpdater` | `address` | Contract address that can update redeployable addresses. See `AdressUpdatable`. | -| `_triggerContractName` | `string` | Contract name that can trigger history cleanups. | - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `registerToken` { #fn_registertoken_09824a80 } - -
-Defined in `CleanupBlockNumberManager` ([Docs](./CleanupBlockNumberManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol)). -
- -
- -```solidity -function registerToken( - contract IICleanable _cleanableToken -) external; -``` - -Register a token contract whose history cleanup index is to be managed. -The registered contracts must allow calling `setCleanupBlockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanableToken` | `contract IICleanable` | The address of the contract to be managed. | - -
-
- -
- -### `setCleanUpBlockNumber` { #fn_setcleanupblocknumber_cbc31cf7 } - -
-Defined in `CleanupBlockNumberManager` ([Docs](./CleanupBlockNumberManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol)). -
- -
- -```solidity -function setCleanUpBlockNumber( - uint256 _blockNumber -) external; -``` - -Sets clean up block number on managed cleanable tokens. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | cleanup block number | - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `unregisterToken` { #fn_unregistertoken_77860cdd } - -
-Defined in `CleanupBlockNumberManager` ([Docs](./CleanupBlockNumberManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol)). -
- -
- -```solidity -function unregisterToken( - contract IICleanable _cleanableToken -) external; -``` - -Unregister a token contract from history cleanup index management. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanableToken` | `contract IICleanable` | The address of the contract to unregister. | - -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -
- -## Modifiers - -
- -### `onlyAddressUpdater` { #md_onlyaddressupdater } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -modifier onlyAddressUpdater() -``` - -Only the `AdressUpdater` contract can call this method. -Its address is set at construction time but it can also update itself. - -
-
- -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -### `onlyTrigger` { #md_onlytrigger } - -
-Defined in `CleanupBlockNumberManager` ([Docs](./CleanupBlockNumberManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol)). -
- -
- -```solidity -modifier onlyTrigger() -``` - -Only the trigger contract can call this method. -This contract is set at construction time and updated through [`AddressUpdatable`](./AddressUpdatable.md). - -
-
- -
- -
- -## Variables - -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `registeredTokens` { #va_registeredtokens } - -
-Defined in `CleanupBlockNumberManager` ([Docs](./CleanupBlockNumberManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol)). -
- -
- -```solidity - contract IICleanable[] registeredTokens -``` - -Current list of token contracts being managed. - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- -### `triggerContract` { #va_triggercontract } - -
-Defined in `CleanupBlockNumberManager` ([Docs](./CleanupBlockNumberManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol)). -
- -
- -```solidity - address triggerContract -``` - -Address of the contract that can trigger a cleanup. - -
-
- -
- -### `triggerContractName` { #va_triggercontractname } - -
-Defined in `CleanupBlockNumberManager` ([Docs](./CleanupBlockNumberManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CleanupBlockNumberManager.sol)). -
- -
- -```solidity - string triggerContractName -``` - -Name of the contract that can trigger a cleanup. -Needed to update the trigger contract address through the [`AddressUpdater`](./AddressUpdater.md). - -
-
- -
- diff --git a/docs/apis/smart-contracts/CloneFactory.md b/docs/apis/smart-contracts/CloneFactory.md deleted file mode 100644 index aa78275cd..000000000 --- a/docs/apis/smart-contracts/CloneFactory.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: CloneFactory -search: - boost: 0.5 ---- - - - -# `CloneFactory` { #ct_clonefactory } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/implementation/CloneFactory.sol) -
- -
- -Simple clone contract factory. - -This code (intended to be called from an implementor factory contract) will allow you to install a master copy of a -contract, then easily (cheaply) create clones with separate state. -The deployed bytecode just delegates all calls to the master contract address. - -[Source attribution](https://github.com/optionality/clone-factory). - -
- -
- -## Functions - -
- diff --git a/docs/apis/smart-contracts/ConfirmedBlockHeightExistsVerification.md b/docs/apis/smart-contracts/ConfirmedBlockHeightExistsVerification.md deleted file mode 100644 index 04a1b76ea..000000000 --- a/docs/apis/smart-contracts/ConfirmedBlockHeightExistsVerification.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: ConfirmedBlockHeightExistsVerification -search: - boost: 0.5 ---- - - - -# `ConfirmedBlockHeightExistsVerification` { #ct_confirmedblockheightexistsverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/ConfirmedBlockHeightExistsVerification.sol) | Inherits from [IConfirmedBlockHeightExistsVerification](./IConfirmedBlockHeightExistsVerification.md) -
- -
- -Contract for verifying [`ConfirmedBlockHeightExists`](../attestation-types/ConfirmedBlockHeightExists.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This contract can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `ConfirmedBlockHeightExistsVerification` ([Docs](./ConfirmedBlockHeightExistsVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/ConfirmedBlockHeightExistsVerification.sol)). -
- -
- -```solidity -constructor( - contract IMerkleRootStorage _merkleRootStorage -) public; -``` - -
-
- -
- -### `verifyConfirmedBlockHeightExists` { #fn_verifyconfirmedblockheightexists_5e30ebfb } - -
-Defined in `ConfirmedBlockHeightExistsVerification` ([Docs](./ConfirmedBlockHeightExistsVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/ConfirmedBlockHeightExistsVerification.sol)). -
- -
- -```solidity -function verifyConfirmedBlockHeightExists( - struct ConfirmedBlockHeightExists.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`ConfirmedBlockHeightExists`](../attestation-types/ConfirmedBlockHeightExists.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct ConfirmedBlockHeightExists.Proof` | The [`ConfirmedBlockHeightExists`](../attestation-types/ConfirmedBlockHeightExists.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- -
- -## Variables - -
- -### `merkleRootStorage` { #va_merklerootstorage } - -
-Defined in `ConfirmedBlockHeightExistsVerification` ([Docs](./ConfirmedBlockHeightExistsVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/ConfirmedBlockHeightExistsVerification.sol)). -
- -
- -```solidity - contract IMerkleRootStorage merkleRootStorage -``` - -
-
- -
- diff --git a/docs/apis/smart-contracts/Delegatable.md b/docs/apis/smart-contracts/Delegatable.md deleted file mode 100644 index 6057d9753..000000000 --- a/docs/apis/smart-contracts/Delegatable.md +++ /dev/null @@ -1,403 +0,0 @@ ---- -title: Delegatable -search: - boost: 0.5 ---- - - - -# `Delegatable` { #ct_delegatable } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol) | Inherits from [IVPContractEvents](./IVPContractEvents.md) -
- -
- -[`Delegatable`](./Delegatable.md) ERC20 behavior. - -Adds delegation capabilities to tokens. This contract orchestrates interaction between -managing a delegation and the vote power allocations that result. - -
- -
- -## Enums - -
- -### `DelegationMode` { #en_delegationmode } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -
-```solidity -enum DelegationMode { - NOTSET, - PERCENTAGE, - AMOUNT -} -``` - -Delegation mode of an account. Once set, it cannot be changed. - -* `NOTSET`: Delegation mode not set yet. -* `PERCENTAGE`: Delegation by percentage. -* `AMOUNT`: Delegation by amount (explicit). - -
- -
- -
- -## Events - -
- -### `CreatedVotePowerCache` { #ev_createdvotepowercache } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -event CreatedVotePowerCache( - address _owner, - uint256 _blockNumber -) -``` - -Emitted when a vote power cache entry is created. -Allows history cleaners to track vote power cache cleanup opportunities off-chain. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address whose vote power has just been cached. | -| `_blockNumber` | `uint256` | The block number at which the vote power has been cached. | - -
-
- -
- -### `Delegate` { #ev_delegate } - -
-Defined in `IVPContractEvents` ([Docs](./IVPContractEvents.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPContractEvents.sol)). -
- -
- -```solidity -event Delegate( - address from, - address to, - uint256 priorVotePower, - uint256 newVotePower -) -``` - -Emitted when the amount of vote power delegated from one account to another changes. - -**Note**: This event is always emitted from [`VPToken`](./VPToken.md)'s `writeVotePowerContract`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `from` | `address` | The account that has changed the amount of vote power it is delegating. | -| `to` | `address` | The account whose received vote power has changed. | -| `priorVotePower` | `uint256` | The vote power originally delegated. | -| `newVotePower` | `uint256` | The new vote power that triggered this event. It can be 0 if the delegation is completely canceled. | - -
-
- -
- -### `Revoke` { #ev_revoke } - -
-Defined in `IVPContractEvents` ([Docs](./IVPContractEvents.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPContractEvents.sol)). -
- -
- -```solidity -event Revoke( - address delegator, - address delegatee, - uint256 votePower, - uint256 blockNumber -) -``` - -Emitted when an account revokes its vote power delegation to another account -for a single current or past block (typically the current vote block). - -**Note**: This event is always emitted from [`VPToken`](./VPToken.md)'s `writeVotePowerContract` or `readVotePowerContract`. - -See `revokeDelegationAt` in [`IVPToken`](./IVPToken.md). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `delegator` | `address` | The account that revoked the delegation. | -| `delegatee` | `address` | The account that has been revoked. | -| `votePower` | `uint256` | The revoked vote power. | -| `blockNumber` | `uint256` | The block number at which the delegation has been revoked. | - -
-
- -
- -
- -## Functions - -
- -### `explicitDelegationHistoryCleanup` { #fn_explicitdelegationhistorycleanup_cabc4528 } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -function explicitDelegationHistoryCleanup( - address _from, - address _to, - uint256 _count -) external returns ( - uint256); -``` - -Delete explicit delegation checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Delegator address. | -| `_to` | `address` | Delegatee address. | -| `_count` | `uint256` | Maximum number of checkpoints to delete. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of checkpoints deleted. | -
-
- -
- -### `percentageDelegationHistoryCleanup` { #fn_percentagedelegationhistorycleanup_7f57d58f } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -function percentageDelegationHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete percentage delegation checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Balance owner account address. | -| `_count` | `uint256` | Maximum number of checkpoints to delete. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of deleted checkpoints. | -
-
- -
- -### `revocationCleanup` { #fn_revocationcleanup_8c0b6b40 } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -function revocationCleanup( - address _from, - address _to, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete revocation entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Delegator address. | -| `_to` | `address` | Delegatee address. | -| `_blockNumber` | `uint256` | Block number for which total supply value was cached. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of revocation entries deleted (always 0 or 1). | -
-
- -
- -### `votePowerCacheCleanup` { #fn_votepowercachecleanup_891339a8 } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -function votePowerCacheCleanup( - address _owner, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete vote power cache entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Vote power owner account address. | -| `_blockNumber` | `uint256` | Block number for which total supply value was cached. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of deleted cache entries (always 0 or 1). | -
-
- -
- -### `votePowerHistoryCleanup` { #fn_votepowerhistorycleanup_1a05274c } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -function votePowerHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete vote power checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Vote power owner account address. | -| `_count` | `uint256` | Maximum number of checkpoints to delete. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of deleted checkpoints. | -
-
- -
- -
- -## Modifiers - -
- -### `notBeforeCleanupBlock` { #md_notbeforecleanupblock } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -modifier notBeforeCleanupBlock( uint256 _blockNumber) -``` - -Reading from history is not allowed before `cleanupBlockNumber`, since data before that -might have been deleted and is thus unreliable. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number being checked for validity. | - -
-
- -
- -### `onlyCleaner` { #md_onlycleaner } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -modifier onlyCleaner() -``` - -History cleaning methods can be called only from [`cleanerContract`](#va_cleanercontract). - -
-
- -
- -
- -## Variables - -
- -### `cleanerContract` { #va_cleanercontract } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity - address cleanerContract -``` - -Address of the contract that is allowed to call methods for history cleaning. - -
-
- -
- diff --git a/docs/apis/smart-contracts/EVMTransactionVerification.md b/docs/apis/smart-contracts/EVMTransactionVerification.md deleted file mode 100644 index eabe33fb0..000000000 --- a/docs/apis/smart-contracts/EVMTransactionVerification.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: EVMTransactionVerification -search: - boost: 0.5 ---- - - - -# `EVMTransactionVerification` { #ct_evmtransactionverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/EVMTransactionVerification.sol) | Inherits from [IEVMTransactionVerification](./IEVMTransactionVerification.md) -
- -
- -Contract for verifying [`EVMTransaction`](../attestation-types/EVMTransaction.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This contract can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `EVMTransactionVerification` ([Docs](./EVMTransactionVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/EVMTransactionVerification.sol)). -
- -
- -```solidity -constructor( - contract IMerkleRootStorage _merkleRootStorage -) public; -``` - -
-
- -
- -### `verifyEVMTransaction` { #fn_verifyevmtransaction_58fbe9e1 } - -
-Defined in `EVMTransactionVerification` ([Docs](./EVMTransactionVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/EVMTransactionVerification.sol)). -
- -
- -```solidity -function verifyEVMTransaction( - struct EVMTransaction.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`EVMTransaction`](../attestation-types/EVMTransaction.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct EVMTransaction.Proof` | The [`EVMTransaction`](../attestation-types/EVMTransaction.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- -
- -## Variables - -
- -### `merkleRootStorage` { #va_merklerootstorage } - -
-Defined in `EVMTransactionVerification` ([Docs](./EVMTransactionVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/EVMTransactionVerification.sol)). -
- -
- -```solidity - contract IMerkleRootStorage merkleRootStorage -``` - -
-
- -
- diff --git a/docs/apis/smart-contracts/FlareContractRegistry.md b/docs/apis/smart-contracts/FlareContractRegistry.md deleted file mode 100644 index 875e9697d..000000000 --- a/docs/apis/smart-contracts/FlareContractRegistry.md +++ /dev/null @@ -1,235 +0,0 @@ ---- -title: FlareContractRegistry -search: - boost: 0.5 ---- - - - -# `FlareContractRegistry` { #ct_flarecontractregistry } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FlareContractRegistry.sol) | Inherits from [IFlareContractRegistry](./IFlareContractRegistry.md), [AddressUpdatable](./AddressUpdatable.md) -
- -
- -The Flare contract registry. - -Entry point for all external dapps that need the latest contract addresses deployed by Flare. - -
- -
- -## Functions - -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `FlareContractRegistry` ([Docs](./FlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FlareContractRegistry.sol)). -
- -
- -```solidity -constructor( - address _addressUpdater -) public; -``` - -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `getAllContracts` { #fn_getallcontracts_18d3ce96 } - -
-Defined in `FlareContractRegistry` ([Docs](./FlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FlareContractRegistry.sol)). -
- -
- -```solidity -function getAllContracts( -) external view returns ( - string[] _names, - address[] _addresses); -``` - -Returns all contract names and their corresponding addresses. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_names` | `string[]` | Array of contract names. | -| `_addresses` | `address[]` | Array of corresponding contract addresses. | -
-
- -
- -### `getContractAddressByHash` { #fn_getcontractaddressbyhash_159354a2 } - -
-Defined in `FlareContractRegistry` ([Docs](./FlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FlareContractRegistry.sol)). -
- -
- -```solidity -function getContractAddressByHash( - bytes32 _nameHash -) external view returns ( - address); -``` - -Returns the address of a given contract hash. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nameHash` | `bytes32` | Hash of the contract name as: `keccak256(abi.encode(name))`. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address of the contract, or `address(0)` if not found. | -
-
- -
- -### `getContractAddressByName` { #fn_getcontractaddressbyname_82760fca } - -
-Defined in `FlareContractRegistry` ([Docs](./FlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FlareContractRegistry.sol)). -
- -
- -```solidity -function getContractAddressByName( - string _name -) external view returns ( - address); -``` - -Returns the address of a given contract name. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_name` | `string` | Name of the contract. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address of the contract, or `address(0)` if not found. | -
-
- -
- -### `getContractAddressesByHash` { #fn_getcontractaddressesbyhash_5e11e2d1 } - -
-Defined in `FlareContractRegistry` ([Docs](./FlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FlareContractRegistry.sol)). -
- -
- -```solidity -function getContractAddressesByHash( - bytes32[] _nameHashes -) external view returns ( - address[]); -``` - -Returns the addresses of a list of contract hashes. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nameHashes` | `bytes32[]` | Array of contract name hashes as: `keccak256(abi.encode(name))`. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Array of addresses of the contracts. Any of them might be `address(0)` if not found. | -
-
- -
- -### `getContractAddressesByName` { #fn_getcontractaddressesbyname_76d2b1af } - -
-Defined in `FlareContractRegistry` ([Docs](./FlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FlareContractRegistry.sol)). -
- -
- -```solidity -function getContractAddressesByName( - string[] _names -) external view returns ( - address[]); -``` - -Returns the addresses of a list of contract names. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_names` | `string[]` | Array of contract names. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Array of addresses of the contracts. Any of them might be `address(0)` if not found. | -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- diff --git a/docs/apis/smart-contracts/FlareDaemon.md b/docs/apis/smart-contracts/FlareDaemon.md deleted file mode 100644 index 1ef4ebb7c..000000000 --- a/docs/apis/smart-contracts/FlareDaemon.md +++ /dev/null @@ -1,1259 +0,0 @@ ---- -title: FlareDaemon -search: - boost: 0.5 ---- - - - -# `FlareDaemon` { #ct_flaredaemon } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol) | Inherits from [GovernedAtGenesis](./GovernedAtGenesis.md), [AddressUpdatable](./AddressUpdatable.md) -
- -
- -Flare Daemon contract. - -This contract exists to coordinate regular daemon-like polling of contracts -that are registered to receive said polling. The [`trigger`](#fn_trigger_7fec8d38) method is called by the -validator right at the end of block state transition. - -
- -
- -## Events - -
- -### `ContractDaemonizeErrored` { #ev_contractdaemonizeerrored } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event ContractDaemonizeErrored( - address theContract, - uint256 atBlock, - string theMessage, - uint256 gasConsumed -) -``` - -
-
- -
- -### `ContractDaemonized` { #ev_contractdaemonized } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event ContractDaemonized( - address theContract, - uint256 gasConsumed -) -``` - -
-
- -
- -### `ContractHeldOff` { #ev_contractheldoff } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event ContractHeldOff( - address theContract, - uint256 blockHoldoffsRemaining -) -``` - -
-
- -
- -### `ContractsSkippedOutOfGas` { #ev_contractsskippedoutofgas } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event ContractsSkippedOutOfGas( - uint256 numberOfSkippedConstracts -) -``` - -
-
- -
- -### `GovernanceCallTimelocked` { #ev_governancecalltimelocked } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceCallTimelocked( - bytes4 selector, - uint256 allowedAfterTimestamp, - bytes encodedCall -) -``` - -Emitted when a new [`governance`](#fn_governance_5aa6e675) call has been recorded and is now waiting for the time lock to expire. - -
-
- -
- -### `GovernanceInitialised` { #ev_governanceinitialised } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceInitialised( - address initialGovernance -) -``` - -Emitted when the [`governance`](#fn_governance_5aa6e675) address is initialized. -This address will be used until production mode is entered (see [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered)). -At that point the [`governance`](#fn_governance_5aa6e675) address is taken from [`GovernanceSettings`](./GovernanceSettings.md). - -
-
- -
- -### `GovernedProductionModeEntered` { #ev_governedproductionmodeentered } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernedProductionModeEntered( - address governanceSettings -) -``` - -Emitted when [`governance`](#fn_governance_5aa6e675) is enabled and the [`governance`](#fn_governance_5aa6e675) address cannot be changed anymore -(only through a network fork). - -
-
- -
- -### `InflationSet` { #ev_inflationset } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event InflationSet( - contract IInflationGenesis theNewContract, - contract IInflationGenesis theOldContract -) -``` - -
-
- -
- -### `MintingReceived` { #ev_mintingreceived } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event MintingReceived( - uint256 amountWei -) -``` - -
-
- -
- -### `MintingRequestReceived` { #ev_mintingrequestreceived } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event MintingRequestReceived( - uint256 amountWei -) -``` - -
-
- -
- -### `MintingRequestTriggered` { #ev_mintingrequesttriggered } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event MintingRequestTriggered( - uint256 amountWei -) -``` - -
-
- -
- -### `MintingWithdrawn` { #ev_mintingwithdrawn } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event MintingWithdrawn( - uint256 amountWei -) -``` - -
-
- -
- -### `RegistrationUpdated` { #ev_registrationupdated } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event RegistrationUpdated( - contract IFlareDaemonize theContract, - bool add -) -``` - -
-
- -
- -### `SelfDestructReceived` { #ev_selfdestructreceived } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -event SelfDestructReceived( - uint256 amountWei -) -``` - -
-
- -
- -### `TimelockedGovernanceCallCanceled` { #ev_timelockedgovernancecallcanceled } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallCanceled( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is canceled before execution. - -
-
- -
- -### `TimelockedGovernanceCallExecuted` { #ev_timelockedgovernancecallexecuted } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallExecuted( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is executed. - -
-
- -
- -
- -## Functions - -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -constructor( -) public; -``` - -This [`constructor`](#fn_constructor_undefined) should contain no code as this contract is pre-loaded into the genesis block. - The super [`constructor`](#fn_constructor_undefined) is called for testing convenience. - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `getDaemonizedContractsData` { #fn_getdaemonizedcontractsdata_ed21b6e4 } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -function getDaemonizedContractsData( -) external view returns ( - contract IFlareDaemonize[] _daemonizeContracts, - uint256[] _gasLimits, - uint256[] _blockHoldoffsRemaining); -``` - -
-
- -
- -### `getNextMintRequestAllowedTs` { #fn_getnextmintrequestallowedts_63903143 } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -function getNextMintRequestAllowedTs( -) external view returns ( - uint256); -``` - -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `initialise` { #fn_initialise_9d6a890f } - -
-Defined in `GovernedAtGenesis` ([Docs](./GovernedAtGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedAtGenesis.sol)). -
- -
- -```solidity -function initialise( - address _governance -) public pure; -``` - -Disallow [`initialise`](#fn_initialise_9d6a890f) to be called. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | The governance address for initial claiming. | - -
-
- -
- -### `initialiseFixedAddress` { #fn_initialisefixedaddress_c9f960eb } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -function initialiseFixedAddress( -) public returns ( - address); -``` - -Set the [`governance`](#fn_governance_5aa6e675) address to a hard-coded known address. - -This should be done at contract deployment time. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | The governance address. | -
-
- -
- -### `registerToDaemonize` { #fn_registertodaemonize_689c4999 } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -function registerToDaemonize( - struct FlareDaemon.Registration[] _registrations -) external; -``` - -Register contracts to be polled by the daemon process. - -A gas limit of zero will set no limit for the contract but the validator has an overall - limit for the [`trigger`](#fn_trigger_7fec8d38) method. -If any registrations already exist, they will be unregistered. -Contracts will be daemonized in the order in which presented via the _registrations array. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_registrations` | `struct FlareDaemon.Registration[]` | An array of Registration structures of [`IFlareDaemonize`](./IFlareDaemonize.md) contracts to daemonize and gas limits for each contract. | - -
-
- -
- -### `requestMinting` { #fn_requestminting_e9de7d60 } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -function requestMinting( - uint256 _amountWei -) external; -``` - -Queue up a minting request to send to the validator at next [`trigger`](#fn_trigger_7fec8d38). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_amountWei` | `uint256` | The amount to mint. | - -
-
- -
- -### `setAddressUpdater` { #fn_setaddressupdater_aea36b53 } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -function setAddressUpdater( - address _addressUpdater -) external; -``` - -Sets the address udpater contract. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_addressUpdater` | `address` | The address updater contract. | - -
-
- -
- -### `setBlockHoldoff` { #fn_setblockholdoff_5042916c } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -function setBlockHoldoff( - uint256 _blockHoldoff -) external; -``` - -Set number of blocks that must elapse before a daemonized contract exceeding gas limit can have - its daemonize() method called again. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockHoldoff` | `uint256` | The number of blocks to holdoff. | - -
-
- -
- -### `setMaxMintingRequest` { #fn_setmaxmintingrequest_870196b8 } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -function setMaxMintingRequest( - uint256 _maxMintingRequestWei -) external; -``` - -Set limit on how much can be minted per request. -this number can't be udated too often - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_maxMintingRequestWei` | `uint256` | The request maximum in wei. | - -
-
- -
- -### `showDaemonizedErrors` { #fn_showdaemonizederrors_ecdda0dd } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -function showDaemonizedErrors( - uint256 startIndex, - uint256 numErrorTypesToShow -) public view returns ( - uint256[] _lastErrorBlock, - uint256[] _numErrors, - string[] _errorString, - address[] _erroringContract, - uint256 _totalDaemonizedErrors); -``` - -
-
- -
- -### `showLastDaemonizedError` { #fn_showlastdaemonizederror_63d4a53a } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -function showLastDaemonizedError( -) external view returns ( - uint256[] _lastErrorBlock, - uint256[] _numErrors, - string[] _errorString, - address[] _erroringContract, - uint256 _totalDaemonizedErrors); -``` - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -
- -## Modifiers - -
- -### `inflationSet` { #md_inflationset } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -modifier inflationSet() -``` - -As there is not a [`constructor`](#fn_constructor_undefined), this modifier exists to make sure the [`inflation`](#va_inflation) - contract is set for methods that require it. - -
-
- -
- -### `onlyAddressUpdater` { #md_onlyaddressupdater } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -modifier onlyAddressUpdater() -``` - -Only the `AdressUpdater` contract can call this method. -Its address is set at construction time but it can also update itself. - -
-
- -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -### `onlyInflation` { #md_onlyinflation } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -modifier onlyInflation( address _inflation) -``` - -Access control to protect methods to allow only minters to call select methods - (like transferring balance out). - -
-
- -
- -### `onlySystemTrigger` { #md_onlysystemtrigger } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity -modifier onlySystemTrigger() -``` - -Access control to protect [`trigger`](#fn_trigger_7fec8d38) method. -Please note that the sender address is the same as deployed [`FlareDaemon`](./FlareDaemon.md) address in this case. - -
-
- -
- -
- -## Structures - -
- -### `DaemonizedError` { #st_daemonizederror } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -
-```solidity -struct DaemonizedError { - uint192 lastErrorBlock; - uint64 numErrors; - address fromContract; - uint64 errorTypeIndex; - string errorMessage; -} -``` - -
- -
- -### `LastErrorData` { #st_lasterrordata } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -
-```solidity -struct LastErrorData { - uint192 totalDaemonizedErrors; - uint64 lastErrorTypeIndex; -} -``` - -
- -
- -### `Registration` { #st_registration } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -
-```solidity -struct Registration { - contract IFlareDaemonize daemonizedContract; - uint256 gasLimit; -} -``` - -
- -
- -### `TimelockedCall` { #st_timelockedcall } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -
-```solidity -struct TimelockedCall { - uint256 allowedAfterTimestamp; - bytes encodedCall; -} -``` - -
- -
- -
- -## Variables - -
- -### `blockHoldoff` { #va_blockholdoff } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - uint256 blockHoldoff -``` - -
-
- -
- -### `errorData` { #va_errordata } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - struct FlareDaemon.LastErrorData errorData -``` - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `inflation` { #va_inflation } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - contract IInflationGenesis inflation -``` - -
-
- -
- -### `lastMintRequestTs` { #va_lastmintrequestts } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - uint256 lastMintRequestTs -``` - -
-
- -
- -### `lastUpdateMaxMintRequestTs` { #va_lastupdatemaxmintrequestts } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - uint256 lastUpdateMaxMintRequestTs -``` - -
-
- -
- -### `maxMintingRequestWei` { #va_maxmintingrequestwei } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - uint256 maxMintingRequestWei -``` - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `systemLastTriggeredAt` { #va_systemlasttriggeredat } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - uint256 systemLastTriggeredAt -``` - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- -### `totalMintingReceivedWei` { #va_totalmintingreceivedwei } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - uint256 totalMintingReceivedWei -``` - -
-
- -
- -### `totalMintingRequestedWei` { #va_totalmintingrequestedwei } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - uint256 totalMintingRequestedWei -``` - -
-
- -
- -### `totalMintingWithdrawnWei` { #va_totalmintingwithdrawnwei } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - uint256 totalMintingWithdrawnWei -``` - -
-
- -
- -### `totalSelfDestructReceivedWei` { #va_totalselfdestructreceivedwei } - -
-Defined in `FlareDaemon` ([Docs](./FlareDaemon.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/FlareDaemon.sol)). -
- -
- -```solidity - uint256 totalSelfDestructReceivedWei -``` - -
-
- -
- diff --git a/docs/apis/smart-contracts/Ftso.md b/docs/apis/smart-contracts/Ftso.md deleted file mode 100644 index 08aba345c..000000000 --- a/docs/apis/smart-contracts/Ftso.md +++ /dev/null @@ -1,1337 +0,0 @@ ---- -title: Ftso -search: - boost: 0.5 ---- - - - -# `Ftso` { #ct_ftso } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol) | Inherits from [IIFtso](./IIFtso.md) -
- -
- -[Flare Time Series Oracle](https://docs.flare.network/tech/ftso) contract. - -An instance of this contract is created for each tracked asset, and typically -accessed through the [`FtsoRegistry`](./FtsoRegistry.md). -Data providers do not access the [`Ftso`](./Ftso.md) instances directly either, and use the -[`PriceSubmitter`](./PriceSubmitter.md) contract instead. - -
- -
- -## Functions - -
- -### `activateFtso` { #fn_activateftso_2f0a6f3c } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function activateFtso( - uint256 _firstEpochStartTs, - uint256 _submitPeriodSeconds, - uint256 _revealPeriodSeconds -) external; -``` - -Initializes FTSO immutable settings and activates the contract. - -Can only be called by the [`ftsoManager`](#va_ftsomanager). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_firstEpochStartTs` | `uint256` | Timestamp of the first epoch in seconds from UNIX epoch. | -| `_submitPeriodSeconds` | `uint256` | Duration of epoch submission window in seconds. | -| `_revealPeriodSeconds` | `uint256` | Duration of epoch reveal window in seconds. | - -
-
- -
- -### `active` { #fn_active_02fb0c5e } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function active( -) external view returns ( - bool); -``` - -Returns whether FTSO is [`active`](#fn_active_02fb0c5e) or not. - -
-
- -
- -### `configureEpochs` { #fn_configureepochs_5a3c9d8e } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function configureEpochs( - uint256 _maxVotePowerNatThresholdFraction, - uint256 _maxVotePowerAssetThresholdFraction, - uint256 _lowAssetUSDThreshold, - uint256 _highAssetUSDThreshold, - uint256 _highAssetTurnoutThresholdBIPS, - uint256 _lowNatTurnoutThresholdBIPS, - uint256 _elasticBandRewardBIPS, - uint256 _elasticBandWidthPPM, - address[] _trustedAddresses -) external; -``` - -Sets configurable settings related to epochs. - -Can only be called by the [`ftsoManager`](#va_ftsomanager). -Should never revert if called from [`ftsoManager`](#va_ftsomanager). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_maxVotePowerNatThresholdFraction` | `uint256` | High threshold for native token vote power per voter. | -| `_maxVotePowerAssetThresholdFraction` | `uint256` | High threshold for asset vote power per voter. | -| `_lowAssetUSDThreshold` | `uint256` | Threshold for low asset vote power (in scaled USD). | -| `_highAssetUSDThreshold` | `uint256` | Threshold for high asset vote power (in scaled USD). | -| `_highAssetTurnoutThresholdBIPS` | `uint256` | Threshold for high asset turnout (in BIPS). | -| `_lowNatTurnoutThresholdBIPS` | `uint256` | Threshold for low nat turnout (in BIPS). | -| `_elasticBandRewardBIPS` | `uint256` | Percentage of the rewards (in BIPS) that go to the [secondary reward band](https://docs.flare.network/tech/ftso/#rewards). The rest go to the primary reward band. | -| `_elasticBandWidthPPM` | `uint256` | Width of the secondary reward band, in parts-per-milion of the median. | -| `_trustedAddresses` | `address[]` | Trusted voters that will be used if low voter turnout is detected. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -constructor( - string _symbol, - uint256 _decimals, - contract IPriceSubmitter _priceSubmitter, - contract IIVPToken _wNat, - address _ftsoManager, - uint256 _firstEpochStartTs, - uint256 _submitPeriodSeconds, - uint256 _revealPeriodSeconds, - uint128 _initialPriceUSD, - uint256 _priceDeviationThresholdBIPS, - uint256 _cyclicBufferSize -) public; -``` - -
-
- -
- -### `deactivateFtso` { #fn_deactivateftso_555989da } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function deactivateFtso( -) external; -``` - -Deactivates the contract. - -Can only be called by the [`ftsoManager`](#va_ftsomanager). - -
-
- -
- -### `epochsConfiguration` { #fn_epochsconfiguration_e3749e0c } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function epochsConfiguration( -) external view returns ( - uint256 _maxVotePowerNatThresholdFraction, - uint256 _maxVotePowerAssetThresholdFraction, - uint256 _lowAssetUSDThreshold, - uint256 _highAssetUSDThreshold, - uint256 _highAssetTurnoutThresholdBIPS, - uint256 _lowNatTurnoutThresholdBIPS, - uint256 _elasticBandRewardBIPS, - uint256 _elasticBandWidthPPM, - address[] _trustedAddresses); -``` - -Returns current configuration of epoch state. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_maxVotePowerNatThresholdFraction` | `uint256` | High threshold for native token vote power per voter. | -| `_maxVotePowerAssetThresholdFraction` | `uint256` | High threshold for asset vote power per voter. | -| `_lowAssetUSDThreshold` | `uint256` | Threshold for low asset vote power (in scaled USD). | -| `_highAssetUSDThreshold` | `uint256` | Threshold for high asset vote power (in scaled USD). | -| `_highAssetTurnoutThresholdBIPS` | `uint256` | Threshold for high asset turnout (in BIPS). | -| `_lowNatTurnoutThresholdBIPS` | `uint256` | Threshold for low nat turnout (in BIPS). | -| `_elasticBandRewardBIPS` | `uint256` | Percentage of the rewards (in BIPS) that go to the [secondary reward band](https://docs.flare.network/tech/ftso/#rewards). The rest go to the primary reward band. | -| `_elasticBandWidthPPM` | `uint256` | Width of the secondary reward band, in parts-per-milion of the median. | -| `_trustedAddresses` | `address[]` | Trusted voters that will be used if low voter turnout is detected. | -
-
- -
- -### `fallbackFinalizePriceEpoch` { #fn_fallbackfinalizepriceepoch_4afd5102 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function fallbackFinalizePriceEpoch( - uint256 _epochId -) external; -``` - -Forces finalization of a price epoch, calculating the median price from trusted addresses only. - -Used as a fallback method, for example, due to an unexpected error during normal epoch finalization or -because the [`ftsoManager`](#va_ftsomanager) enabled the fallback mode. - -Can only be called by the [`ftsoManager`](#va_ftsomanager). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch to finalize. | - -
-
- -
- -### `finalizePriceEpoch` { #fn_finalizepriceepoch_40462a2d } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function finalizePriceEpoch( - uint256 _epochId, - bool _returnRewardData -) external returns ( - address[] _eligibleAddresses, - uint256[] _natWeights, - uint256 _natWeightsSum); -``` - -Computes epoch price based on gathered votes. - -* If the price reveal window for the epoch has ended, finalize the epoch. -* Iterate list of price submissions. -* Find weighted median. -* Find adjacent 50% of price submissions. -* Allocate rewards for price submissions. - -Can only be called by the [`ftsoManager`](#va_ftsomanager), and only at the correct time. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch to finalize. | -| `_returnRewardData` | `bool` | Parameter that determines if the reward data is returned. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_eligibleAddresses` | `address[]` | List of addresses eligible for reward. | -| `_natWeights` | `uint256[]` | List of native token weights corresponding to the eligible addresses. | -| `_natWeightsSum` | `uint256` | | -
-
- -
- -### `forceFinalizePriceEpoch` { #fn_forcefinalizepriceepoch_974d7a6b } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function forceFinalizePriceEpoch( - uint256 _epochId -) external; -``` - -Forces finalization of a price epoch by copying the price from the previous epoch. - -Used as a fallback method if [`fallbackFinalizePriceEpoch`](#fn_fallbackfinalizepriceepoch_4afd5102) fails due to an exception. - -Can only be called by the [`ftsoManager`](#va_ftsomanager). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch to finalize. | - -
-
- -
- -### `ftsoManager` { #fn_ftsomanager_11a7aaaa } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function ftsoManager( -) external view returns ( - address); -``` - -Returns the FTSO manager's address. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address of the FTSO manager contract. | -
-
- -
- -### `getAsset` { #fn_getasset_5c222bad } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getAsset( -) external view returns ( - contract IIVPToken); -``` - -Returns the FTSO asset. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IIVPToken` | Address of the [`IIVPToken`](./IIVPToken.md) tracked by this FTSO. `null` in case of multi-asset FTSO. | -
-
- -
- -### `getAssetFtsos` { #fn_getassetftsos_18931c35 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getAssetFtsos( -) external view returns ( - contract IIFtso[]); -``` - -Returns the asset FTSOs. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IIFtso[]` | Array of [`IIFtso`](./IIFtso.md) contract addresses. `null` in case of single-asset FTSO. | -
-
- -
- -### `getCurrentEpochId` { #fn_getcurrentepochid_a29a839f } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getCurrentEpochId( -) public view returns ( - uint256); -``` - -Returns the current epoch ID. - -It never reverts. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Currently running epoch ID. IDs are consecutive numbers starting from zero. | -
-
- -
- -### `getCurrentPrice` { #fn_getcurrentprice_eb91d37e } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getCurrentPrice( -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Returns the current asset price. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -
-
- -
- -### `getCurrentPriceDetails` { #fn_getcurrentpricedetails_040d73b8 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getCurrentPriceDetails( -) external view returns ( - uint256 _price, - uint256 _priceTimestamp, - enum IFtso.PriceFinalizationType _priceFinalizationType, - uint256 _lastPriceEpochFinalizationTimestamp, - enum IFtso.PriceFinalizationType _lastPriceEpochFinalizationType); -``` - -Returns asset's current price details. -All timestamps are in seconds from UNIX epoch. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_priceTimestamp` | `uint256` | Time when price was updated for the last time. | -| `_priceFinalizationType` | `enum IFtso.PriceFinalizationType` | Finalization type when price was updated for the last time. | -| `_lastPriceEpochFinalizationTimestamp` | `uint256` | Time when last price epoch was finalized. | -| `_lastPriceEpochFinalizationType` | `enum IFtso.PriceFinalizationType` | Finalization type of last finalized price epoch. | -
-
- -
- -### `getCurrentPriceFromTrustedProviders` { #fn_getcurrentpricefromtrustedproviders_af52df08 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getCurrentPriceFromTrustedProviders( -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Returns current asset price calculated only using input from trusted providers. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -
-
- -
- -### `getCurrentPriceWithDecimals` { #fn_getcurrentpricewithdecimals_65f5cd86 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimals( -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Returns current asset price and number of decimals. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`_assetPriceUsdDecimals`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the USD price. | -
-
- -
- -### `getCurrentPriceWithDecimalsFromTrustedProviders` { #fn_getcurrentpricewithdecimalsfromtrustedproviders_3cacb3ae } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimalsFromTrustedProviders( -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Returns current asset price calculated only using input from trusted providers and number of decimals. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the USD price. | -
-
- -
- -### `getCurrentRandom` { #fn_getcurrentrandom_d89601fd } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getCurrentRandom( -) external view returns ( - uint256); -``` - -Returns the random number for the previous price epoch, obtained from the random numbers -provided by all data providers along with their data submissions. - -It never reverts. - -
-
- -
- -### `getEpochId` { #fn_getepochid_5303548b } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getEpochId( - uint256 _timestamp -) external view returns ( - uint256); -``` - -Returns the ID of the epoch that was opened for price submission at the specified timestamp. - -It never reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_timestamp` | `uint256` | Queried timestamp in seconds from UNIX epoch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Epoch ID corresponding to that timestamp. IDs are consecutive numbers starting from zero. | -
-
- -
- -### `getEpochPrice` { #fn_getepochprice_7d1d6f12 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getEpochPrice( - uint256 _epochId -) external view returns ( - uint256); -``` - -Returns agreed asset price in the specified epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch. Only the last 200 epochs can be queried. Out-of-bounds queries revert. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -
-
- -
- -### `getEpochPriceForVoter` { #fn_getepochpriceforvoter_c5d8b9e7 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getEpochPriceForVoter( - uint256 _epochId, - address _voter -) external view returns ( - uint256); -``` - -Returns asset price submitted by a voter in the specified epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch being queried. Only the last 200 epochs can be queried. Out-of-bounds queries revert. | -| `_voter` | `address` | Address of the voter being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -
-
- -
- -### `getPriceEpochConfiguration` { #fn_getpriceepochconfiguration_144e1591 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getPriceEpochConfiguration( -) external view returns ( - uint256 _firstEpochStartTs, - uint256 _submitPeriodSeconds, - uint256 _revealPeriodSeconds); -``` - -Returns current epoch's configuration. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_firstEpochStartTs` | `uint256` | First epoch start timestamp in seconds from UNIX epoch. | -| `_submitPeriodSeconds` | `uint256` | Submit period in seconds. | -| `_revealPeriodSeconds` | `uint256` | Reveal period in seconds. | -
-
- -
- -### `getPriceEpochData` { #fn_getpriceepochdata_e3b3a3b3 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getPriceEpochData( -) external view returns ( - uint256 _epochId, - uint256 _epochSubmitEndTime, - uint256 _epochRevealEndTime, - uint256 _votePowerBlock, - bool _fallbackMode); -``` - -Returns current epoch data. -Intervals are open on the right: End times are not included. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_epochId` | `uint256` | Current epoch ID. | -| `_epochSubmitEndTime` | `uint256` | End time of the price submission window in seconds from UNIX epoch. | -| `_epochRevealEndTime` | `uint256` | End time of the price reveal window in seconds from UNIX epoch. | -| `_votePowerBlock` | `uint256` | Vote power block for the current epoch. | -| `_fallbackMode` | `bool` | Whether the current epoch is in fallback mode. Only votes from trusted addresses are used in this mode. | -
-
- -
- -### `getRandom` { #fn_getrandom_cd4b6914 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function getRandom( - uint256 _epochId -) external view returns ( - uint256); -``` - -Returns the random number used in a specific past epoch, obtained from the random numbers -provided by all data providers along with their data submissions. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the queried epoch. Current epoch cannot be queried, and the previous epoch is constantly updated as data providers reveal their prices and random numbers. Only the last 50 epochs can be queried and there is no bounds checking for this parameter. Out-of-bounds queries return undefined values. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The random number used in that epoch. | -
-
- -
- -### `getVoteWeightingParameters` { #fn_getvoteweightingparameters_8357d08c } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function getVoteWeightingParameters( -) external view returns ( - contract IIVPToken[] _assets, - uint256[] _assetMultipliers, - uint256 _totalVotePowerNat, - uint256 _totalVotePowerAsset, - uint256 _assetWeightRatio, - uint256 _votePowerBlock); -``` - -Returns parameters necessary for replicating vote weighting (used in [`VoterWhitelister`](./VoterWhitelister.md)). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_assets` | `contract IIVPToken[]` | The list of assets that are accounted in vote. | -| `_assetMultipliers` | `uint256[]` | Weight multiplier of each asset in (multiasset) FTSO. | -| `_totalVotePowerNat` | `uint256` | Total native token vote power at block. | -| `_totalVotePowerAsset` | `uint256` | Total combined asset vote power at block. | -| `_assetWeightRatio` | `uint256` | Ratio of combined asset vote power vs. native token vp (in BIPS). | -| `_votePowerBlock` | `uint256` | Vote power block for the epoch. | -
-
- -
- -### `initializeCurrentEpochStateForReveal` { #fn_initializecurrentepochstateforreveal_f670ebe3 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function initializeCurrentEpochStateForReveal( - uint256 _circulatingSupplyNat, - bool _fallbackMode -) external; -``` - -Initializes current epoch instance for reveal. - -Can only be called by the [`ftsoManager`](#va_ftsomanager). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_circulatingSupplyNat` | `uint256` | Epoch native token circulating supply. | -| `_fallbackMode` | `bool` | Whether the current epoch is in fallback mode. | - -
-
- -
- -### `revealPriceSubmitter` { #fn_revealpricesubmitter_c1f6c36e } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function revealPriceSubmitter( - address _voter, - uint256 _epochId, - uint256 _price, - uint256 _voterWNatVP -) external; -``` - -Reveals the price submitted by a voter on a specific epoch. -The hash of _price and _random must be equal to the submitted hash - -Emits a [`PriceRevealed`](#ev_pricerevealed) event. -Can only be called by the [`priceSubmitter`](#va_pricesubmitter). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Voter address. | -| `_epochId` | `uint256` | ID of the epoch in which the price hash was submitted. | -| `_price` | `uint256` | Submitted price. | -| `_voterWNatVP` | `uint256` | Voter's vote power in [`WNat`](./WNat.md) units. | - -
-
- -
- -### `setAsset` { #fn_setasset_d0d552dd } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function setAsset( - contract IIVPToken _asset -) external; -``` - -Sets asset for FTSO to operate as single-asset oracle. - -Can only be called by the [`ftsoManager`](#va_ftsomanager). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_asset` | `contract IIVPToken` | Address of the [`IIVPToken`](./IIVPToken.md) contract that will be the asset tracked by this FTSO. | - -
-
- -
- -### `setAssetFtsos` { #fn_setassetftsos_131fdee2 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function setAssetFtsos( - contract IIFtso[] _assetFtsos -) external; -``` - -Sets an array of FTSOs for FTSO to operate as multi-asset oracle. -FTSOs implicitly determine the FTSO [`assets`](#va_assets). - -Can only be called by the [`ftsoManager`](#va_ftsomanager). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_assetFtsos` | `contract IIFtso[]` | Array of FTSOs. | - -
-
- -
- -### `setVotePowerBlock` { #fn_setvotepowerblock_e536f396 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function setVotePowerBlock( - uint256 _votePowerBlock -) external; -``` - -Sets the current vote power block. -Current vote power block will update per reward epoch. -The FTSO doesn't have notion of reward epochs. - -Can only be called by the [`ftsoManager`](#va_ftsomanager). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_votePowerBlock` | `uint256` | | - -
-
- -
- -### `symbol` { #fn_symbol_95d89b41 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function symbol( -) external view returns ( - string); -``` - -Returns the FTSO [`symbol`](#fn_symbol_95d89b41). - -
-
- -
- -### `updateInitialPrice` { #fn_updateinitialprice_306ba253 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function updateInitialPrice( - uint256 _initialPriceUSD, - uint256 _initialPriceTimestamp -) external; -``` - -Updates initial asset price when the contract is not [`active`](#va_active) yet. - -Can only be called by the [`ftsoManager`](#va_ftsomanager). - -
-
- -
- -### `wNat` { #fn_wnat_9edbf007 } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function wNat( -) external view returns ( - contract IIVPToken); -``` - -Address of the [`WNat`](./WNat.md) contract. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IIVPToken` | Address of the [`WNat`](./WNat.md) contract. | -
-
- -
- -### `wNatVotePowerCached` { #fn_wnatvotepowercached_f72cab28 } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -function wNatVotePowerCached( - address _owner, - uint256 _epochId -) public returns ( - uint256); -``` - -Get and cache the vote power of a voter on a specific epoch, in [`WNat`](./WNat.md) units. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | | -| `_epochId` | `uint256` | ID of the epoch in which the price hash was submitted. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Voter's vote power in [`WNat`](./WNat.md) units. | -
-
- -
- -
- -## Modifiers - -
- -### `onlyFtsoManager` { #md_onlyftsomanager } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -modifier onlyFtsoManager() -``` - -Only the [`ftsoManager`](#va_ftsomanager) can call this method. - -
-
- -
- -### `onlyPriceSubmitter` { #md_onlypricesubmitter } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -modifier onlyPriceSubmitter() -``` - -Only the [`priceSubmitter`](#va_pricesubmitter) can call this method. - -
-
- -
- -### `whenActive` { #md_whenactive } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity -modifier whenActive() -``` - -This method can only be called when the FTSO is [`active`](#va_active). - -
-
- -
- -
- -## Structures - -
- -### `RewardData` { #st_rewarddata } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -
-```solidity -struct RewardData { - uint256[] weightIQR; - uint256[] weightElasticBand; - uint256 weightsIQRSum; - uint256 weightsElasticBandSum; - uint256 numberOfVotes; - uint256 elasticBandRewardBIPS; -} -``` - -
- -
- -
- -## Variables - -
- -### `ASSET_PRICE_USD_DECIMALS` { #va_asset_price_usd_decimals } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity - uint256 ASSET_PRICE_USD_DECIMALS -``` - -Number of decimal places in an asset's USD price. -Actual USD price is the integer value divided by 10^[`ASSET_PRICE_USD_DECIMALS`](#va_asset_price_usd_decimals) - -
-
- -
- -### `active` { #va_active } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity - bool active -``` - -Activation status of this FTSO. - -
-
- -
- -### `assetFtsos` { #va_assetftsos } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity - contract IIFtso[] assetFtsos -``` - -Array of addresses of other [`Ftso`](./Ftso.md) contracts tracked by this multi-asset FTSO. - -
-
- -
- -### `assets` { #va_assets } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity - contract IIVPToken[] assets -``` - -Array of addresses of the tracked [`assets`](#va_assets). - -
-
- -
- -### `ftsoManager` { #va_ftsomanager } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity - address ftsoManager -``` - -Address of the [`FtsoManager`](./FtsoManager.md) contract. - -
-
- -
- -### `priceDeviationThresholdBIPS` { #va_pricedeviationthresholdbips } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity - uint256 priceDeviationThresholdBIPS -``` - -Threshold for price deviation between consecutive epochs. - -
-
- -
- -### `priceEpochCyclicBufferSize` { #va_priceepochcyclicbuffersize } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity - uint256 priceEpochCyclicBufferSize -``` - -Amount of stored prices for past epochs, set at construction time. - -
-
- -
- -### `priceSubmitter` { #va_pricesubmitter } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity - contract IPriceSubmitter priceSubmitter -``` - -Address of the [`PriceSubmitter`](./PriceSubmitter.md) contract. - -
-
- -
- -### `symbol` { #va_symbol } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity - string symbol -``` - -Asset [`symbol`](#va_symbol) that identifies this FTSO. - -
-
- -
- -### `wNat` { #va_wnat } - -
-Defined in `Ftso` ([Docs](./Ftso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/Ftso.sol)). -
- -
- -```solidity - contract IIVPToken wNat -``` - -Address of the wrapped native token ([`WNat`](./WNat.md)) contract. - -
-
- -
- diff --git a/docs/apis/smart-contracts/FtsoManager.md b/docs/apis/smart-contracts/FtsoManager.md deleted file mode 100644 index 2f4960aa6..000000000 --- a/docs/apis/smart-contracts/FtsoManager.md +++ /dev/null @@ -1,1975 +0,0 @@ ---- -title: FtsoManager -search: - boost: 0.5 ---- - - - -# `FtsoManager` { #ct_ftsomanager } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol) | Inherits from [IIFtsoManager](./IIFtsoManager.md), [GovernedAndFlareDaemonized](./GovernedAndFlareDaemonized.md), [AddressUpdatable](./AddressUpdatable.md), [RevertErrorTracking](./RevertErrorTracking.md) -
- -
- -FTSO Manager contract. - -It is in charge of: - -- Defining reward epochs (few days). -- Choosing a single block each reward epoch that represents vote power of this epoch. -- Keeping track of all FTSO contracts. -- Every price epoch (few minutes): - - Randomly choose one FTSO for rewarding calculations. - - Trigger finalize price reveal epoch. - - Determine addresses and reward weights and triggers reward distribution. - -
- -
- -## Functions - -
- -### `activate` { #fn_activate_0f15f4c0 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function activate( -) external; -``` - -Activates FTSO manager ([`daemonize`](#fn_daemonize_6d0e8c34) will run jobs). - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -
-
- -
- -### `active` { #fn_active_02fb0c5e } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function active( -) external view returns ( - bool); -``` - -Returns whether the FTSO Manager is [`active`](#fn_active_02fb0c5e) or not. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | bool Active status. | -
-
- -
- -### `addFtso` { #fn_addftso_2663f1b4 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function addFtso( - contract IIFtso _ftso -) external; -``` - -Adds FTSO to the list of managed FTSOs, to support a new price pair. -All FTSOs in a multi-asset FTSO must be managed by the same FTSO manager. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | FTSO contract address to add. | - -
-
- -
- -### `addFtsosBulk` { #fn_addftsosbulk_d429cfe5 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function addFtsosBulk( - contract IIFtso[] _ftsos -) external; -``` - -Adds a list of FTSOs to the list of managed FTSOs, to support new price pairs. -All FTSOs in a multi-asset FTSO must be managed by the same FTSO manager. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsos` | `contract IIFtso[]` | Array of FTSO contract addresses to add. | - -
-
- -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -constructor( - address _governance, - contract FlareDaemon _flareDaemon, - address _addressUpdater, - contract IIFtsoManagerV1 _oldFtsoManager, - uint256 _firstPriceEpochStartTs, - uint256 _priceEpochDurationSeconds, - uint256 _revealEpochDurationSeconds, - uint256 _firstRewardEpochStartTs, - uint256 _rewardEpochDurationSeconds, - uint256 _votePowerIntervalFraction -) public; -``` - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `GovernedAndFlareDaemonized` ([Docs](./GovernedAndFlareDaemonized.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol)). -
- -
- -```solidity -constructor( - address _governance, - contract FlareDaemon _flareDaemon -) public; -``` - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Governed` ([Docs](./Governed.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/Governed.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Governance contract. Must not be zero. | - -
-
- -
- -### `currentRewardEpochEnds` { #fn_currentrewardepochends_d89c39e6 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function currentRewardEpochEnds( -) external view returns ( - uint256); -``` - -Returns when the current reward epoch finishes. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Time in seconds since the UNIX epoch when the current reward epoch will finish. | -
-
- -
- -### `daemonize` { #fn_daemonize_6d0e8c34 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function daemonize( -) external returns ( - bool); -``` - -Implement this function to receive a trigger from the [`FlareDaemon`](./FlareDaemon.md). -The trigger method is called by the validator right at the end of block state transition. - -Only [`flareDaemon`](#va_flaredaemon) can call this method. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | bool Whether the contract is still active after the call. Currently unused. | -
-
- -
- -### `deactivateFtsos` { #fn_deactivateftsos_8de306b1 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function deactivateFtsos( - contract IIFtso[] _ftsos -) external; -``` - -Deactivates FTSOs that are no longer used on FTSO registry. -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsos` | `contract IIFtso[]` | Array of FTSO contract addresses to deactivate. | - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `ftsoRegistry` { #fn_ftsoregistry_38b5f869 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function ftsoRegistry( -) external view returns ( - contract IIFtsoRegistry); -``` - -Returns the [`FtsoRegistry`](./FtsoRegistry.md) contract address. - -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `getContractName` { #fn_getcontractname_f5f5ba72 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getContractName( -) external pure returns ( - string); -``` - -Implement this function to allow updating daemonized contracts through the [`AddressUpdater`](./AddressUpdater.md). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `string` | string Contract name. | -
-
- -
- -### `getCurrentPriceEpochData` { #fn_getcurrentpriceepochdata_93a79025 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getCurrentPriceEpochData( -) external view returns ( - uint256 _priceEpochId, - uint256 _priceEpochStartTimestamp, - uint256 _priceEpochEndTimestamp, - uint256 _priceEpochRevealEndTimestamp, - uint256 _currentTimestamp); -``` - -Returns timing information for the current price epoch. -All intervals are half-closed: end time is not included. -All timestamps are in seconds since UNIX epoch. - -See the [FTSO page](https://docs.flare.network/tech/ftso/#data-submission-process) -for information about the different submission phases. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_priceEpochId` | `uint256` | Price epoch ID. | -| `_priceEpochStartTimestamp` | `uint256` | Beginning of the commit phase. | -| `_priceEpochEndTimestamp` | `uint256` | End of the commit phase. | -| `_priceEpochRevealEndTimestamp` | `uint256` | End of the reveal phase. | -| `_currentTimestamp` | `uint256` | Current time. | -
-
- -
- -### `getCurrentPriceEpochId` { #fn_getcurrentpriceepochid_08a7f402 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getCurrentPriceEpochId( -) external view returns ( - uint256 _priceEpochId); -``` - -Returns current price epoch ID. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_priceEpochId` | `uint256` | Currently running epoch ID. IDs are consecutive numbers starting from zero. | -
-
- -
- -### `getCurrentRewardEpoch` { #fn_getcurrentrewardepoch_e7c830d4 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getCurrentRewardEpoch( -) external view returns ( - uint256); -``` - -Returns current reward epoch ID (the one currently running). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID. A monotonically increasing integer. | -
-
- -
- -### `getElasticBandWidthPPMFtso` { #fn_getelasticbandwidthppmftso_5bb44e9a } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getElasticBandWidthPPMFtso( - contract IIFtso _ftso -) external view returns ( - uint256); -``` - -Returns the secondary band's width in PPM (parts-per-million) of the median value, -for a given FTSO. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | The queried FTSO contract address. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Secondary band width in PPM. To obtain the actual band width, divide this number by 10^6 and multiply by the price median value. | -
-
- -
- -### `getFallbackMode` { #fn_getfallbackmode_4b48dd5e } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getFallbackMode( -) external view returns ( - bool _fallbackMode, - contract IIFtso[] _ftsos, - bool[] _ftsoInFallbackMode); -``` - -Returns whether the FTSO Manager is currently in fallback mode. - -In this mode only submissions from trusted providers are used. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_fallbackMode` | `bool` | True if fallback mode is enabled for the manager. | -| `_ftsos` | `contract IIFtso[]` | Array of all currently active FTSO assets. | -| `_ftsoInFallbackMode` | `bool[]` | Boolean array indicating which FTSO assets are in fallback mode. If the FTSO Manager is in fallback mode then ALL FTSOs are in fallback mode. | -
-
- -
- -### `getFtsos` { #fn_getftsos_ce69f833 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getFtsos( -) external view returns ( - contract IIFtso[] _ftsos); -``` - -Returns the list of currently [`active`](#va_active) FTSOs. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IIFtso[]` | Array of contract addresses for the FTSOs. | -
-
- -
- -### `getGovernanceParameters` { #fn_getgovernanceparameters_5835cf30 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getGovernanceParameters( -) external view returns ( - uint256 _maxVotePowerNatThresholdFraction, - uint256 _maxVotePowerAssetThresholdFraction, - uint256 _lowAssetUSDThreshold, - uint256 _highAssetUSDThreshold, - uint256 _highAssetTurnoutThresholdBIPS, - uint256 _lowNatTurnoutThresholdBIPS, - uint256 _elasticBandRewardBIPS, - uint256 _rewardExpiryOffsetSeconds, - address[] _trustedAddresses, - bool _initialized, - bool _changed); -``` - -Returns [`governance`](#fn_governance_5aa6e675) parameters for FTSOs. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_maxVotePowerNatThresholdFraction` | `uint256` | High threshold for native token vote power per voter. | -| `_maxVotePowerAssetThresholdFraction` | `uint256` | High threshold for asset vote power per voter | -| `_lowAssetUSDThreshold` | `uint256` | Threshold for low asset vote power (in scaled USD). | -| `_highAssetUSDThreshold` | `uint256` | Threshold for high asset vote power (in scaled USD). | -| `_highAssetTurnoutThresholdBIPS` | `uint256` | Threshold for high asset turnout (in BIPS). | -| `_lowNatTurnoutThresholdBIPS` | `uint256` | Threshold for low nat turnout (in BIPS). | -| `_elasticBandRewardBIPS` | `uint256` | Secondary reward band, where _elasticBandRewardBIPS goes to the secondary band and 10000 - _elasticBandRewardBIPS to the primary (IQR) band. | -| `_rewardExpiryOffsetSeconds` | `uint256` | Reward epochs closed earlier than block.timestamp - _rewardExpiryOffsetSeconds expire. | -| `_trustedAddresses` | `address[]` | Trusted addresses will be used as a fallback mechanism for setting the price. | -| `_initialized` | `bool` | | -| `_changed` | `bool` | | -
-
- -
- -### `getLastUnprocessedPriceEpochData` { #fn_getlastunprocessedpriceepochdata_6ca051e6 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getLastUnprocessedPriceEpochData( -) external view returns ( - uint256 _lastUnprocessedPriceEpoch, - uint256 _lastUnprocessedPriceEpochRevealEnds, - bool _lastUnprocessedPriceEpochInitialized); -``` - -Returns information regarding the currently unprocessed price epoch. -This epoch is not necessarily the last one, in case the network halts for some -time due to validator node problems, for example. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_lastUnprocessedPriceEpoch` | `uint256` | ID of the price epoch that is currently waiting finalization. | -| `_lastUnprocessedPriceEpochRevealEnds` | `uint256` | When that price epoch can be finalized, in seconds since UNIX epoch. | -| `_lastUnprocessedPriceEpochInitialized` | `bool` | Whether this price epoch has been already initialized and therefore it must be finalized before the corresponding reward epoch can be finalized. | -
-
- -
- -### `getPriceEpochConfiguration` { #fn_getpriceepochconfiguration_144e1591 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getPriceEpochConfiguration( -) external view returns ( - uint256 _firstPriceEpochStartTs, - uint256 _priceEpochDurationSeconds, - uint256 _revealEpochDurationSeconds); -``` - -Returns the current values for price epoch timing configuration. - -See the [FTSO page](https://docs.flare.network/tech/ftso/#data-submission-process) -for information about the different submission phases. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_firstPriceEpochStartTs` | `uint256` | Timestamp, in seconds since UNIX epoch, of the first price epoch. | -| `_priceEpochDurationSeconds` | `uint256` | Duration in seconds of the commit phase. | -| `_revealEpochDurationSeconds` | `uint256` | Duration in seconds of the reveal phase. | -
-
- -
- -### `getPriceSubmitter` { #fn_getpricesubmitter_0e063d7d } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getPriceSubmitter( -) external view returns ( - contract IIPriceSubmitter); -``` - -Returns the [`PriceSubmitter`](./PriceSubmitter.md) contract. - -
-
- -
- -### `getRewardEpochConfiguration` { #fn_getrewardepochconfiguration_1cb513f7 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochConfiguration( -) external view returns ( - uint256 _firstRewardEpochStartTs, - uint256 _rewardEpochDurationSeconds); -``` - -Returns the current values for reward epoch timing configuration. - -See the [Reward epochs](https://docs.flare.network/tech/ftso/#vote-power) box. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_firstRewardEpochStartTs` | `uint256` | Timestamp, in seconds since UNIX epoch, of the first reward epoch. | -| `_rewardEpochDurationSeconds` | `uint256` | Duration in seconds of the reward epochs. | -
-
- -
- -### `getRewardEpochData` { #fn_getrewardepochdata_e5399da3 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochData( - uint256 _rewardEpochId -) public view returns ( - struct IIFtsoManager.RewardEpochData); -``` - -Returns data regarding a specific reward epoch ID. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpochId` | `uint256` | Epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IIFtsoManager.RewardEpochData` | RewardEpochData Its associated data. | -
-
- -
- -### `getRewardEpochToExpireNext` { #fn_getrewardepochtoexpirenext_3e7ff857 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochToExpireNext( -) external view returns ( - uint256); -``` - -Return reward epoch that will expire next, when a new reward epoch is initialized. - -Reward epochs older than 90 days expire, and any unclaimed rewards in them become -inaccessible. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Reward epoch ID. | -
-
- -
- -### `getRewardEpochVotePowerBlock` { #fn_getrewardepochvotepowerblock_f2edab5a } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochVotePowerBlock( - uint256 _rewardEpoch -) external view returns ( - uint256 _votepowerBlock); -``` - -Returns the [vote power block](https://docs.flare.network/tech/ftso/#vote-power) -that was used for a past reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | The queried reward epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_votepowerBlock` | `uint256` | uint256 The block number of that reward epoch's vote power block. | -
-
- -
- -### `getRewardExpiryOffsetSeconds` { #fn_getrewardexpiryoffsetseconds_ec31db0c } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getRewardExpiryOffsetSeconds( -) external view returns ( - uint256); -``` - -Returns the currently configured reward expiration time. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Unclaimed rewards accrued in reward epochs more than this amount of seconds in the past expire and become inaccessible. | -
-
- -
- -### `getUpdateGovernanceParametersTs` { #fn_getupdategovernanceparametersts_a157713b } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getUpdateGovernanceParametersTs( -) external view returns ( - uint256); -``` - -Returns the timestamp, in seconds since UNIX epoch, when the scheduled new settings -will take effect. - -
-
- -
- -### `getVotePowerIntervalFraction` { #fn_getvotepowerintervalfraction_60f2c5b2 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function getVotePowerIntervalFraction( -) external view returns ( - uint256); -``` - -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `notInitializedFtsos` { #fn_notinitializedftsos_823033a9 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function notInitializedFtsos( - contract IIFtso _ftso -) external view returns ( - bool); -``` - -Returns whether an FTSO has been initialized. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | bool Initialization state. | -
-
- -
- -### `removeFtso` { #fn_removeftso_a670ff87 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function removeFtso( - contract IIFtso _ftso -) external; -``` - -Removes an FTSO from the list of managed FTSOs. -Reverts if FTSO is used in a multi-asset FTSO. -Deactivates the `_ftso`. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | FTSO contract address to remove. | - -
-
- -
- -### `replaceFtso` { #fn_replaceftso_3758e679 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function replaceFtso( - contract IIFtso _ftsoToAdd, - bool _copyCurrentPrice, - bool _copyAssetOrAssetFtsos -) external; -``` - -Replaces one FTSO with another with the same symbol. -All FTSOs in a multi-asset FTSO must be managed by the same FTSO manager. -Deactivates the old FTSO. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoToAdd` | `contract IIFtso` | FTSO contract address to add. An existing FTSO with the same symbol will be removed. | -| `_copyCurrentPrice` | `bool` | | -| `_copyAssetOrAssetFtsos` | `bool` | | - -
-
- -
- -### `replaceFtsosBulk` { #fn_replaceftsosbulk_758ff1da } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function replaceFtsosBulk( - contract IIFtso[] _ftsosToAdd, - bool _copyCurrentPrice, - bool _copyAssetOrAssetFtsos -) external; -``` - -Replaces a list of FTSOs with other FTSOs with the same symbol. -All FTSOs in a multi-asset FTSO must be managed by the same FTSO manager. -Deactivates the old FTSOs. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsosToAdd` | `contract IIFtso[]` | Array of FTSO contract addresses to add. Every existing FTSO with the same symbols will be removed. | -| `_copyCurrentPrice` | `bool` | | -| `_copyAssetOrAssetFtsos` | `bool` | | - -
-
- -
- -### `rewardEpochDurationSeconds` { #fn_rewardepochdurationseconds_85f3c9c9 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function rewardEpochDurationSeconds( -) external view returns ( - uint256); -``` - -Currently configured reward epoch duration. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Reward epoch duration, in seconds. | -
-
- -
- -### `rewardEpochs` { #fn_rewardepochs_a795f409 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function rewardEpochs( - uint256 _rewardEpochId -) external view returns ( - uint256 _votepowerBlock, - uint256 _startBlock, - uint256 _startTimestamp); -``` - -Returns information about a reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpochId` | `uint256` | The epoch ID to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_votepowerBlock` | `uint256` | The [vote power block](https://docs.flare.network/tech/ftso/#vote-power) of the epoch. | -| `_startBlock` | `uint256` | The first block of the epoch. | -| `_startTimestamp` | `uint256` | Timestamp of the epoch start, in seconds since UNIX epoch. | -
-
- -
- -### `rewardEpochsStartTs` { #fn_rewardepochsstartts_a578f55b } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function rewardEpochsStartTs( -) external view returns ( - uint256); -``` - -Time when the current reward epoch started. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Timestamp, in seconds since UNIX epoch. | -
-
- -
- -### `setElasticBandWidthPPMFtsos` { #fn_setelasticbandwidthppmftsos_882376c3 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setElasticBandWidthPPMFtsos( - uint256 _updateTs, - contract IIFtso[] _ftsos, - uint256[] _widths -) external; -``` - -Sets elastic band widths in PPM (parts-per-million) for given FTSOs. -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_updateTs` | `uint256` | Timestamp when the changes will take effect, in seconds from UNIX epoch. | -| `_ftsos` | `contract IIFtso[]` | Array of FTSO contract addresses to update. | -| `_widths` | `uint256[]` | Array of secondary band widths in PPM. To obtain the actual band width, this number is divided by 10^6 and multiplied by the price median value. | - -
-
- -
- -### `setFallbackMode` { #fn_setfallbackmode_ff882fbb } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setFallbackMode( - bool _fallbackMode -) external; -``` - -Sets whether the FTSO Manager is currently in fallback mode. -In this mode only submissions from trusted providers are used. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_fallbackMode` | `bool` | True if fallback mode is enabled. | - -
-
- -
- -### `setFtsoAsset` { #fn_setftsoasset_6b65cc34 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setFtsoAsset( - contract IIFtso _ftso, - contract IIVPToken _asset -) external; -``` - -Sets the asset tracked by an FTSO. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | The FTSO contract address. | -| `_asset` | `contract IIVPToken` | The [`VPToken`](./VPToken.md) contract address of the asset to track. | - -
-
- -
- -### `setFtsoAssetFtsos` { #fn_setftsoassetftsos_a93a6f42 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setFtsoAssetFtsos( - contract IIFtso _ftso, - contract IIFtso[] _assetFtsos -) external; -``` - -Sets an array of FTSOs to be tracked by a multi-asset FTSO. -FTSOs implicitly determine the FTSO assets. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | The multi-asset FTSO contract address. | -| `_assetFtsos` | `contract IIFtso[]` | Array of FTSOs to be tracked. | - -
-
- -
- -### `setFtsoFallbackMode` { #fn_setftsofallbackmode_af946af7 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setFtsoFallbackMode( - contract IIFtso _ftso, - bool _fallbackMode -) external; -``` - -Sets whether an FTSO is currently in fallback mode. -In this mode only submissions from trusted providers are used. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | The FTSO contract address. | -| `_fallbackMode` | `bool` | Fallback mode. | - -
-
- -
- -### `setGovernanceParameters` { #fn_setgovernanceparameters_13226793 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setGovernanceParameters( - uint256 _updateTs, - uint256 _maxVotePowerNatThresholdFraction, - uint256 _maxVotePowerAssetThresholdFraction, - uint256 _lowAssetUSDThreshold, - uint256 _highAssetUSDThreshold, - uint256 _highAssetTurnoutThresholdBIPS, - uint256 _lowNatTurnoutThresholdBIPS, - uint256 _elasticBandRewardBIPS, - uint256 _rewardExpiryOffsetSeconds, - address[] _trustedAddresses -) external; -``` - -Sets [`governance`](#fn_governance_5aa6e675) parameters for FTSOs - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_updateTs` | `uint256` | Time, in seconds since UNIX epoch, when updated settings should be pushed to FTSOs. | -| `_maxVotePowerNatThresholdFraction` | `uint256` | High threshold for native token vote power per voter. | -| `_maxVotePowerAssetThresholdFraction` | `uint256` | High threshold for asset vote power per voter | -| `_lowAssetUSDThreshold` | `uint256` | Threshold for low asset vote power (in scaled USD). | -| `_highAssetUSDThreshold` | `uint256` | Threshold for high asset vote power (in scaled USD). | -| `_highAssetTurnoutThresholdBIPS` | `uint256` | Threshold for high asset turnout (in BIPS). | -| `_lowNatTurnoutThresholdBIPS` | `uint256` | Threshold for low nat turnout (in BIPS). | -| `_elasticBandRewardBIPS` | `uint256` | Secondary reward band, where _elasticBandRewardBIPS goes to the secondary band and 10000 - _elasticBandRewardBIPS to the primary (IQR) band. | -| `_rewardExpiryOffsetSeconds` | `uint256` | Reward epochs closed earlier than block.timestamp - _rewardExpiryOffsetSeconds expire. | -| `_trustedAddresses` | `address[]` | Trusted addresses will be used as a fallback mechanism for setting the price. | - -
-
- -
- -### `setInitialRewardData` { #fn_setinitialrewarddata_e080a970 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setInitialRewardData( - uint256 _nextRewardEpochToExpire, - uint256 _rewardEpochsLength, - uint256 _currentRewardEpochEnds -) external; -``` - -Set reward data to values from old ftso manager. -Can only be called before activation. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nextRewardEpochToExpire` | `uint256` | See `getRewardEpochToExpireNext`. | -| `_rewardEpochsLength` | `uint256` | See `getRewardEpochConfiguration`. | -| `_currentRewardEpochEnds` | `uint256` | See `getCurrentRewardEpoch`. | - -
-
- -
- -### `setRewardEpochDurationSeconds` { #fn_setrewardepochdurationseconds_132c7e1f } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setRewardEpochDurationSeconds( - uint256 _rewardEpochDurationSeconds -) external; -``` - -Sets the reward epoch duration. -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -If the reward epoch is very short and the expiry offset is very long, the list of reward epochs -to be checked becomes very long. Therefore reward epoch time has to be capped to expiry offset. - -
-
- -
- -### `setUpdateOnRewardEpochSwitchover` { #fn_setupdateonrewardepochswitchover_3fdeb7e1 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setUpdateOnRewardEpochSwitchover( - contract IUpdateValidators _updateValidators -) external; -``` - -Unused. - -
-
- -
- -### `setUseGoodRandom` { #fn_setusegoodrandom_a90a38e1 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setUseGoodRandom( - bool _useGoodRandom, - uint256 _maxWaitForGoodRandomSeconds -) external; -``` - -Allow [`governance`](#fn_governance_5aa6e675) to switch to good random numbers only. -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -See [`IFtsoManager`](./IFtsoManager.md).[`UseGoodRandomSet`](#ev_usegoodrandomset). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_useGoodRandom` | `bool` | Whether good random numbers should be used or not. | -| `_maxWaitForGoodRandomSeconds` | `uint256` | Max time in seconds to wait for the good random. If there is none after given time, reward epoch finalization should proceed anyway. | - -
-
- -
- -### `setVotePowerIntervalFraction` { #fn_setvotepowerintervalfraction_361b5459 } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function setVotePowerIntervalFraction( - uint256 _votePowerIntervalFraction -) external; -``` - -
-
- -
- -### `showLastRevertedError` { #fn_showlastrevertederror_2b3c41a4 } - -
-Defined in `RevertErrorTracking` ([Docs](./RevertErrorTracking.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/RevertErrorTracking.sol)). -
- -
- -```solidity -function showLastRevertedError( -) external view returns ( - uint256[] _lastErrorBlock, - uint256[] _numErrors, - string[] _errorString, - address[] _erroringContract, - uint256 _totalRevertedErrors); -``` - -Returns latest error information. All arrays will contain only one entry. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_lastErrorBlock` | `uint256[]` | Array of block numbers where the errors occurred. | -| `_numErrors` | `uint256[]` | Array of number of times same error with same contract address has been reverted. | -| `_errorString` | `string[]` | Array of revert error messages. | -| `_erroringContract` | `address[]` | Array of addresses of the reverting contracts. | -| `_totalRevertedErrors` | `uint256` | Total number of revert errors across all contracts. | -
-
- -
- -### `showRevertedErrors` { #fn_showrevertederrors_6ea0aa31 } - -
-Defined in `RevertErrorTracking` ([Docs](./RevertErrorTracking.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/RevertErrorTracking.sol)). -
- -
- -```solidity -function showRevertedErrors( - uint256 startIndex, - uint256 numErrorTypesToShow -) public view returns ( - uint256[] _lastErrorBlock, - uint256[] _numErrors, - string[] _errorString, - address[] _erroringContract, - uint256 _totalRevertedErrors); -``` - -Returns latest errors. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `startIndex` | `uint256` | Starting index in the error list array. | -| `numErrorTypesToShow` | `uint256` | Number of errors to show. The total amount can be found in `errorData`. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_lastErrorBlock` | `uint256[]` | Array of block numbers where the errors occurred. | -| `_numErrors` | `uint256[]` | Array of number of times same error with same contract address has been reverted. | -| `_errorString` | `string[]` | Array of revert error messages. | -| `_erroringContract` | `address[]` | Array of addresses of the reverting contracts. | -| `_totalRevertedErrors` | `uint256` | Total number of revert errors across all contracts. | -
-
- -
- -### `switchToFallbackMode` { #fn_switchtofallbackmode_e22fdece } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function switchToFallbackMode( -) external returns ( - bool); -``` - -This function will be called after an error is caught in [`daemonize`](#fn_daemonize_6d0e8c34). -It will switch the contract to a simpler fallback mode, which hopefully works when full mode doesn't. -Not every contract needs to support fallback mode ([`FtsoManager`](./FtsoManager.md) does), so this method may be empty. -Switching back to normal mode is left to the contract (typically a governed method call). -This function may be called due to low-gas error, so it shouldn't use more than ~30.000 gas. - -Only [`flareDaemon`](#va_flaredaemon) can call this method. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | True if switched to fallback mode, false if already in fallback mode or if fallback mode is not supported. | -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -### `voterWhitelister` { #fn_voterwhitelister_c2b0d47b } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity -function voterWhitelister( -) external view returns ( - contract IIVoterWhitelister); -``` - -Returns the [`VoterWhitelister`](./VoterWhitelister.md) contract address. - -
-
- -
- -
- -## Variables - -
- -### `MAX_TRUSTED_ADDRESSES_LENGTH` { #va_max_trusted_addresses_length } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - uint256 MAX_TRUSTED_ADDRESSES_LENGTH -``` - -Maximum number of trusted addresses allowed. - -
-
- -
- -### `active` { #va_active } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - bool active -``` - -Whether the FTSO Manager is [`active`](#va_active) or not. - -
-
- -
- -### `cleanupBlockNumberManager` { #va_cleanupblocknumbermanager } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - contract CleanupBlockNumberManager cleanupBlockNumberManager -``` - -Address of the [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md) contract. - -
-
- -
- -### `currentRewardEpochEnds` { #va_currentrewardepochends } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - uint256 currentRewardEpochEnds -``` - -Timestamp when the current reward epoch finishes, in seconds since UNIX epoch. - -
-
- -
- -### `errorData` { #va_errordata } - -
-Defined in `RevertErrorTracking` ([Docs](./RevertErrorTracking.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/RevertErrorTracking.sol)). -
- -
- -```solidity - struct RevertErrorTracking.LastErrorData errorData -``` - -Most recent error information. - -
-
- -
- -### `flareDaemon` { #va_flaredaemon } - -
-Defined in `GovernedAndFlareDaemonized` ([Docs](./GovernedAndFlareDaemonized.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol)). -
- -
- -```solidity - contract FlareDaemon flareDaemon -``` - -The [`FlareDaemon`](./FlareDaemon.md) contract, set at construction time. - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `lastRewardedFtsoAddress` { #va_lastrewardedftsoaddress } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - address lastRewardedFtsoAddress -``` - -Address of the FTSO contract that was last chosen for reward calculations. - -
-
- -
- -### `maxWaitForGoodRandomSeconds` { #va_maxwaitforgoodrandomseconds } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - uint256 maxWaitForGoodRandomSeconds -``` - -Used only when [`useGoodRandom`](#va_usegoodrandom) flag is set. - -
-
- -
- -### `oldFtsoManager` { #va_oldftsomanager } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - contract IIFtsoManagerV1 oldFtsoManager -``` - -Previous FTSO Manager, in case of a redeployment. - -
-
- -
- -### `priceSubmitter` { #va_pricesubmitter } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - contract IIPriceSubmitter priceSubmitter -``` - -Address of the [`PriceSubmitter`](./PriceSubmitter.md) contract. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `rewardEpochDurationSeconds` { #va_rewardepochdurationseconds } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - uint256 rewardEpochDurationSeconds -``` - -Duration of reward epochs, in seconds. - -
-
- -
- -### `rewardEpochsStartTs` { #va_rewardepochsstartts } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - uint256 rewardEpochsStartTs -``` - -Timestamp when the first reward epoch started, in seconds since UNIX epoch. - -
-
- -
- -### `rewardManager` { #va_rewardmanager } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - contract IIFtsoRewardManager rewardManager -``` - -Address of the `RewardManager` contract. - -
-
- -
- -### `supply` { #va_supply } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - contract IISupply supply -``` - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- -### `updateOnRewardEpochSwitchover` { #va_updateonrewardepochswitchover } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - contract IUpdateValidators updateOnRewardEpochSwitchover -``` - -Unused. - -
-
- -
- -### `useGoodRandom` { #va_usegoodrandom } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - bool useGoodRandom -``` - -Whether use of good random numbers is enforced. See [`IFtsoManager`](./IFtsoManager.md).[`UseGoodRandomSet`](#ev_usegoodrandomset). - -
-
- -
- -### `waitingForGoodRandomSinceTs` { #va_waitingforgoodrandomsincets } - -
-Defined in `FtsoManager` ([Docs](./FtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/implementation/FtsoManager.sol)). -
- -
- -```solidity - uint256 waitingForGoodRandomSinceTs -``` - -Used only when [`useGoodRandom`](#va_usegoodrandom) flag is set. - -
-
- -
- diff --git a/docs/apis/smart-contracts/FtsoRegistry.md b/docs/apis/smart-contracts/FtsoRegistry.md deleted file mode 100644 index 29e016654..000000000 --- a/docs/apis/smart-contracts/FtsoRegistry.md +++ /dev/null @@ -1,1040 +0,0 @@ ---- -title: FtsoRegistry -search: - boost: 0.5 ---- - - - -# `FtsoRegistry` { #ct_ftsoregistry } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol) | Inherits from [IIFtsoRegistry](./IIFtsoRegistry.md), [AddressUpdatable](./AddressUpdatable.md), [GovernedBase](./GovernedBase.md) -
- -
- -Handles registration of assets to the [FTSO system](https://docs.flare.network/tech/ftso). - -
- -
- -## Functions - -
- -### `addFtso` { #fn_addftso_2663f1b4 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function addFtso( - contract IIFtso _ftsoContract -) external returns ( - uint256 _assetIndex); -``` - -Add a new FTSO contract to the registry. - -Only the [`ftsoManager`](#va_ftsomanager) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoContract` | `contract IIFtso` | New target FTSO contract. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_assetIndex` | `uint256` | The FTSO index assigned to the new asset. | -
-
- -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -constructor( -) public; -``` - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `getAllCurrentPrices` { #fn_getallcurrentprices_58f9296f } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getAllCurrentPrices( -) external view returns ( - struct IFtsoRegistry.PriceInfo[]); -``` - -Returns the current price of all supported assets. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IFtsoRegistry.PriceInfo[]` | Array of `PriceInfo` structures. | -
-
- -
- -### `getAllFtsos` { #fn_getallftsos_2bcdd6ab } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getAllFtsos( -) external view returns ( - contract IIFtso[] _ftsos); -``` - -Return all currently supported FTSO contracts. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IIFtso[]` | Array of FTSO contract addresses. | -
-
- -
- -### `getCurrentPrice` { #fn_getcurrentprice_c55d0f56 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPrice( - uint256 _assetIndex -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Public view function to get the current price of a given active FTSO index. -Reverts if the index is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_assetIndex` | `uint256` | | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -
-
- -
- -### `getCurrentPrice` { #fn_getcurrentprice_42a0f243 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPrice( - string _symbol -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Public view function to get the current price of a given active asset symbol. -Reverts if the symbol is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Symbol to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -
-
- -
- -### `getCurrentPriceWithDecimals` { #fn_getcurrentpricewithdecimals_257cbd3a } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimals( - uint256 _assetIndex -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Public view function to get the current price and decimals of a given active FTSO index. -Reverts if the index is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_assetIndex` | `uint256` | Index to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`_assetPriceUsdDecimals`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the `_price`. | -
-
- -
- -### `getCurrentPriceWithDecimals` { #fn_getcurrentpricewithdecimals_a69afdc6 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimals( - string _symbol -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Public view function to get the current price and decimals of a given active asset symbol. -Reverts if the symbol is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Symbol to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`_assetPriceUsdDecimals`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the `_price`. | -
-
- -
- -### `getCurrentPricesByIndices` { #fn_getcurrentpricesbyindices_6ba31fa1 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPricesByIndices( - uint256[] _indices -) external view returns ( - struct IFtsoRegistry.PriceInfo[]); -``` - -Returns the current price of a list of indices. -Reverts if any of the indices is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_indices` | `uint256[]` | Array of indices to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IFtsoRegistry.PriceInfo[]` | Array of `PriceInfo` structures. | -
-
- -
- -### `getCurrentPricesBySymbols` { #fn_getcurrentpricesbysymbols_79d5ea4b } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPricesBySymbols( - string[] _symbols -) external view returns ( - struct IFtsoRegistry.PriceInfo[]); -``` - -Returns the current price of a list of asset symbols. -Reverts if any of the symbols is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbols` | `string[]` | Array of symbols to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IFtsoRegistry.PriceInfo[]` | Array of `PriceInfo` structures. | -
-
- -
- -### `getFtso` { #fn_getftso_d75f6d81 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getFtso( - uint256 _assetIndex -) external view returns ( - contract IIFtso _activeFtso); -``` - -Returns the address of the FTSO contract for a given index. -Reverts if unsupported index is passed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_assetIndex` | `uint256` | | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_activeFtso` | `contract IIFtso` | | -
-
- -
- -### `getFtsoBySymbol` { #fn_getftsobysymbol_97da6af4 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getFtsoBySymbol( - string _symbol -) external view returns ( - contract IIFtso _activeFtso); -``` - -Returns the address of the FTSO contract for a given symbol. -Reverts if unsupported symbol is passed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | The queried symbol. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_activeFtso` | `contract IIFtso` | | -
-
- -
- -### `getFtsoHistory` { #fn_getftsohistory_c71a1b20 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getFtsoHistory( - uint256 _assetIndex -) external view returns ( - contract IIFtso[5] _ftsoAddressHistory); -``` - -Get the history of FTSOs for given index. -If there are less then MAX_HISTORY_LENGTH the remaining addresses will be 0 addresses. -Reverts if index is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_assetIndex` | `uint256` | Asset index to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsoAddressHistory` | `contract IIFtso[5]` | History of FTSOs contract for provided index. | -
-
- -
- -### `getFtsoIndex` { #fn_getftsoindex_e848da30 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getFtsoIndex( - string _symbol -) external view returns ( - uint256 _assetIndex); -``` - -Returns the FTSO index corresponding to a given asset symbol. -Reverts if the symbol is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Symbol to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_assetIndex` | `uint256` | The corresponding asset index. | -
-
- -
- -### `getFtsoSymbol` { #fn_getftsosymbol_136d3f64 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getFtsoSymbol( - uint256 _assetIndex -) external view returns ( - string _symbol); -``` - -Returns the asset symbol corresponding to a given FTSO index. -Reverts if the index is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_assetIndex` | `uint256` | | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_symbol` | `string` | The corresponding asset symbol. | -
-
- -
- -### `getFtsos` { #fn_getftsos_9cb47538 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getFtsos( - uint256[] _assetIndices -) external view returns ( - contract IFtsoGenesis[] _ftsos); -``` - -Get the addresses of the active FTSOs at the given indices. -Reverts if any of the provided indices is non-existing or inactive. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_assetIndices` | `uint256[]` | | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IFtsoGenesis[]` | The array of FTSO addresses. | -
-
- -
- -### `getSupportedFtsos` { #fn_getsupportedftsos_a40060ba } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedFtsos( -) external view returns ( - contract IIFtso[] _ftsos); -``` - -Get array of all FTSO contracts for all supported asset indices. -The index of FTSO in returned array does not necessarily correspond to the asset's index. -Due to deletion, some indices might be unsupported. - -Use [`getSupportedIndicesAndFtsos`](#fn_getsupportedindicesandftsos_06a2ba29) to retrieve pairs of correct indices and FTSOs, -where possible "null" holes are readily apparent. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSOs. | -
-
- -
- -### `getSupportedIndices` { #fn_getsupportedindices_798aac5b } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndices( -) external view returns ( - uint256[] _supportedIndices); -``` - -Returns the indices of the currently supported FTSOs. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all active FTSO indices in increasing order. | -
-
- -
- -### `getSupportedIndicesAndFtsos` { #fn_getsupportedindicesandftsos_06a2ba29 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndicesAndFtsos( -) external view returns ( - uint256[] _supportedIndices, - contract IIFtso[] _ftsos); -``` - -Get all supported indices and corresponding FTSO addresses. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all supported indices. | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSO addresses. | -
-
- -
- -### `getSupportedIndicesAndSymbols` { #fn_getsupportedindicesandsymbols_e68f283b } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndicesAndSymbols( -) external view returns ( - uint256[] _supportedIndices, - string[] _supportedSymbols); -``` - -Get all supported indices and corresponding symbols. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all supported indices. | -| `_supportedSymbols` | `string[]` | Array of all supported symbols. | -
-
- -
- -### `getSupportedIndicesSymbolsAndFtsos` { #fn_getsupportedindicessymbolsandftsos_7687542c } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndicesSymbolsAndFtsos( -) external view returns ( - uint256[] _supportedIndices, - string[] _supportedSymbols, - contract IIFtso[] _ftsos); -``` - -Get all supported indices, symbols, and corresponding FTSO addresses. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all supported indices. | -| `_supportedSymbols` | `string[]` | Array of all supported symbols. | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSO addresses. | -
-
- -
- -### `getSupportedSymbols` { #fn_getsupportedsymbols_ce1c0e4d } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedSymbols( -) external view returns ( - string[] _supportedSymbols); -``` - -Returns the symbols of the currently supported FTSOs. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedSymbols` | `string[]` | Array of all active FTSO symbols in increasing order. | -
-
- -
- -### `getSupportedSymbolsAndFtsos` { #fn_getsupportedsymbolsandftsos_0cf48497 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedSymbolsAndFtsos( -) external view returns ( - string[] _supportedSymbols, - contract IIFtso[] _ftsos); -``` - -Get all supported symbols and corresponding FTSO addresses. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedSymbols` | `string[]` | Array of all supported symbols. | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSO addresses. | -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `initialiseRegistry` { #fn_initialiseregistry_ffc880fd } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function initialiseRegistry( - address _addressUpdater -) external; -``` - -
-
- -
- -### `removeFtso` { #fn_removeftso_a670ff87 } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -function removeFtso( - contract IIFtso _ftso -) external; -``` - -Removes the FTSO and keeps part of the history. -Reverts if the provided address is not supported. - -From now on, the index this asset was using is "reserved" and cannot be used again. -It will not be returned in any list of currently supported assets. - -Only the [`ftsoManager`](#va_ftsomanager) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | Address of the FTSO contract to remove. | - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -
- -## Modifiers - -
- -### `onlyAddressUpdater` { #md_onlyaddressupdater } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -modifier onlyAddressUpdater() -``` - -Only the `AdressUpdater` contract can call this method. -Its address is set at construction time but it can also update itself. - -
-
- -
- -### `onlyFtsoManager` { #md_onlyftsomanager } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity -modifier onlyFtsoManager() -``` - -Only the [`ftsoManager`](#va_ftsomanager) can call this method. - -
-
- -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -
- -## Variables - -
- -### `ftsoManager` { #va_ftsomanager } - -
-Defined in `FtsoRegistry` ([Docs](./FtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/FtsoRegistry.sol)). -
- -
- -```solidity - contract IIFtsoManager ftsoManager -``` - -[`FtsoManager`](./FtsoManager.md) contract that can add and remove assets to the registry. - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- diff --git a/docs/apis/smart-contracts/FtsoRewardManager.md b/docs/apis/smart-contracts/FtsoRewardManager.md deleted file mode 100644 index d2a3cc42c..000000000 --- a/docs/apis/smart-contracts/FtsoRewardManager.md +++ /dev/null @@ -1,1913 +0,0 @@ ---- -title: FtsoRewardManager -search: - boost: 0.5 ---- - - - -# `FtsoRewardManager` { #ct_ftsorewardmanager } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol) | Inherits from [IIFtsoRewardManager](./IIFtsoRewardManager.md), [Governed](./Governed.md), ReentrancyGuard, [AddressUpdatable](./AddressUpdatable.md) -
- -
- -Handles reward distribution and claiming related to the FTSO system. - -More specifically, this contract: - -* Distributes rewards according to instructions from the [`FtsoManager`](./FtsoManager.md). -* Allows data providers, delegators and executors to [`claim`](#fn_claim_b2c12192) rewards. - -
- -
- -## Functions - -
- -### `accrueUnearnedRewards` { #fn_accrueunearnedrewards_67dcac53 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function accrueUnearnedRewards( - uint256 _epochId, - uint256 _priceEpochDurationSeconds, - uint256 _priceEpochEndTime -) external; -``` - -Accrue unearned rewards for a given price epoch. -Typically done when the FTSO is in fallback mode or because of insufficient vote power. -Simply accrue them so they will not be distributed and will be burned later. - -The amount of rewards that will be burned is calculated in the same way as in [`distributeRewards`](#fn_distributerewards_a9b79e17). - -Only the FTSO Manager can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | | -| `_priceEpochDurationSeconds` | `uint256` | | -| `_priceEpochEndTime` | `uint256` | | - -
-
- -
- -### `activate` { #fn_activate_0f15f4c0 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function activate( -) external; -``` - -Activates reward manager (allows claiming rewards). - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -
-
- -
- -### `active` { #fn_active_02fb0c5e } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function active( -) external view returns ( - bool); -``` - -Whether rewards can be claimed from this reward manager. - -
-
- -
- -### `autoClaim` { #fn_autoclaim_8dc305fa } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function autoClaim( - address[] _rewardOwners, - uint256 _rewardEpoch -) external; -``` - -Allows claiming rewards simultaneously for a list of reward owners and all unclaimed epochs before the -specified one. - -This is meant as a convenience all-in-one reward claiming method to be used both by reward owners and -[registered executors](https://docs.flare.network/tech/automatic-claiming/#registered-claiming-process). -It performs a series of operations, besides claiming rewards: - -* If a reward owner has enabled its -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account), rewards are also -claimed for the PDA and the total claimed amount is sent to that PDA. -Otherwise, the claimed amount is sent to the reward owner's account. - -* Claimed amount is automatically wrapped through the [`WNat`](./WNat.md) contract. - -* If the caller is a registered executor with a non-zero fee, the fee is paid to the executor for each claimed -address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwners` | `address[]` | List of reward owners to claim for. | -| `_rewardEpoch` | `uint256` | Last reward epoch ID to claim for. All previous epochs with pending rewards will be claimed too. | - -
-
- -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `claim` { #fn_claim_b2c12192 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function claim( - address _rewardOwner, - address payable _recipient, - uint256 _rewardEpoch, - bool _wrap -) external returns ( - uint256 _rewardAmount); -``` - -Allows the caller to [`claim`](#fn_claim_b2c12192) rewards for a reward owner. -The caller does not have to be the owner of the rewards, but must be approved by the owner to [`claim`](#fn_claim_b2c12192) on his -behalf by using `setClaimExecutors` on the [`claimSetupManager`](#va_claimsetupmanager). - -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by percentage. -Reverts if `msg.sender` is delegating by amount. - -Anybody can call this method, but rewards can only be sent to the reward owner, therefore no funds can be -stolen. However, by limiting the authorized callers, the owner can control the timing of the calls. - -When the reward owner is the caller, rewards can be sent to any recipient set by `setAllowedClaimRecipients` on -the [`claimSetupManager`](#va_claimsetupmanager). -The reward owner's [Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) -is always an authorized recipient. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | Address of the reward owner. | -| `_recipient` | `address payable` | Address to transfer claimed rewards to. | -| `_rewardEpoch` | `uint256` | Last reward epoch to claim for. All previous epochs with pending rewards will be claimed too. | -| `_wrap` | `bool` | Whether claimed rewards should be wrapped through the [`WNat`](./WNat.md) contract before transferring them to the `_recipient`. This parameter is offered as a convenience. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Total amount of claimed rewards (wei). | -
-
- -
- -### `claimFromDataProviders` { #fn_claimfromdataproviders_21bb25af } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function claimFromDataProviders( - address _rewardOwner, - address payable _recipient, - uint256[] _rewardEpochs, - address[] _dataProviders, - bool _wrap -) external returns ( - uint256 _rewardAmount); -``` - -Allows the caller to [`claim`](#fn_claim_b2c12192) rewards for a reward owner from specific data providers. -The caller does not have to be the owner of the rewards, but must be approved by the owner to [`claim`](#fn_claim_b2c12192) on his -behalf by using `setClaimExecutors` on the [`claimSetupManager`](#va_claimsetupmanager). - -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by amount (explicit delegation). -Reverts if `msg.sender` is delegating by percentage. - -Anybody can call this method, but rewards can only be sent to the reward owner, therefore no funds can be -stolen. However, by limiting the authorized callers, the owner can control the timing of the calls. - -When the reward owner is the caller, rewards can be sent to any recipient set by `setAllowedClaimRecipients` on -the [`claimSetupManager`](#va_claimsetupmanager). -The reward owner's [Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) -is always an authorized recipient. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | Address of the reward owner. | -| `_recipient` | `address payable` | Address to transfer claimed rewards to. | -| `_rewardEpochs` | `uint256[]` | Array of reward epoch IDs to claim for. | -| `_dataProviders` | `address[]` | Array of addresses of the data providers to claim the reward from. | -| `_wrap` | `bool` | Whether claimed rewards should be wrapped through the [`WNat`](./WNat.md) contract before transferring them to the `_recipient`. This parameter is offered as a convenience. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Total amount of claimed rewards (wei). | -
-
- -
- -### `claimReward` { #fn_claimreward_b2af870a } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function claimReward( - address payable _recipient, - uint256[] _rewardEpochs -) external returns ( - uint256 _rewardAmount); -``` - -Allows a percentage delegator to [`claim`](#fn_claim_b2c12192) rewards. -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by percentage. - -**This function is deprecated**: use [`claim`](#fn_claim_b2c12192) instead. - -Reverts if `msg.sender` is delegating by amount. -Claims for all unclaimed reward epochs to the 'max(_rewardEpochs)'. -Retained for backward compatibility. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipient` | `address payable` | Address to transfer funds to. | -| `_rewardEpochs` | `uint256[]` | Array of reward epoch numbers to claim for. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Amount of total claimed rewards (wei). | -
-
- -
- -### `claimRewardFromDataProviders` { #fn_claimrewardfromdataproviders_d20bb542 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function claimRewardFromDataProviders( - address payable _recipient, - uint256[] _rewardEpochs, - address[] _dataProviders -) external returns ( - uint256 _rewardAmount); -``` - -Allows the caller to [`claim`](#fn_claim_b2c12192) rewards from specific data providers. -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by amount. - -**This function is deprecated**: use [`claimFromDataProviders`](#fn_claimfromdataproviders_21bb25af) instead. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipient` | `address payable` | Address to transfer funds to. | -| `_rewardEpochs` | `uint256[]` | Array of reward epoch numbers to claim for. | -| `_dataProviders` | `address[]` | Array of addresses of the data providers to claim the reward from. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Total amount of claimed rewards (wei). | -
-
- -
- -### `closeExpiredRewardEpoch` { #fn_closeexpiredrewardepoch_d6c1dbee } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function closeExpiredRewardEpoch( - uint256 _rewardEpoch -) external; -``` - -Collects funds from expired reward epoch and calculates totals. - -Triggered by [`ftsoManager`](#va_ftsomanager) on finalization of a reward epoch. -Operation is irreversible: when some reward epoch is closed according to current -settings, it cannot be reopened even if new parameters would -allow it, because `nextRewardEpochToExpire` in [`ftsoManager`](#va_ftsomanager) never decreases. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -constructor( - address _governance, - address _addressUpdater, - address _oldFtsoRewardManager, - uint256 _feePercentageUpdateOffset, - uint256 _defaultFeePercentage -) public; -``` - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Governed` ([Docs](./Governed.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/Governed.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Governance contract. Must not be zero. | - -
-
- -
- -### `deactivate` { #fn_deactivate_51b42b00 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function deactivate( -) external; -``` - -Deactivates reward manager (prevents claiming rewards). - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -
-
- -
- -### `defaultFeePercentage` { #fn_defaultfeepercentage_b4824034 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function defaultFeePercentage( -) external view returns ( - uint256); -``` - -Returns the configured default fee percentage. - -
-
- -
- -### `distributeRewards` { #fn_distributerewards_a9b79e17 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function distributeRewards( - address[] _addresses, - uint256[] _weights, - uint256 _totalWeight, - uint256 _epochId, - address _ftso, - uint256 _priceEpochDurationSeconds, - uint256 _currentRewardEpoch, - uint256 _priceEpochEndTime, - uint256 _votePowerBlock -) external; -``` - -Distributes price epoch rewards to data provider accounts, according to input parameters. -Must be called with `totalWeight` > 0 and `addresses.length` > 0. - -The amount of rewards for a given price epoch ID are calculated in [`FtsoRewardManager`](./FtsoRewardManager.md) from -`priceEpochDurationSeconds`, `priceEpochEndTime` and inflation authorization data -(see `_getTotalPriceEpochRewardWei` in [`FtsoRewardManager`](./FtsoRewardManager.md). -Then each data provider address is given a portion of this amount according to corresponding weight -and total sum of weights. - -Parameters `epochId` and `ftso` are only needed so they can be passed onto the emitted event. - -Only the [`ftsoManager`](#va_ftsomanager) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_addresses` | `address[]` | | -| `_weights` | `uint256[]` | | -| `_totalWeight` | `uint256` | | -| `_epochId` | `uint256` | | -| `_ftso` | `address` | | -| `_priceEpochDurationSeconds` | `uint256` | | -| `_currentRewardEpoch` | `uint256` | | -| `_priceEpochEndTime` | `uint256` | | -| `_votePowerBlock` | `uint256` | | - -
-
- -
- -### `enableClaims` { #fn_enableclaims_ea28edad } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function enableClaims( -) external; -``` - -Enable claiming for current and all future reward epochs. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `feePercentageUpdateOffset` { #fn_feepercentageupdateoffset_16fe49c7 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function feePercentageUpdateOffset( -) external view returns ( - uint256); -``` - -Returns the amount of reward epoch that need to ellapse before a fee change takes effect. - -
-
- -
- -### `firstClaimableRewardEpoch` { #fn_firstclaimablerewardepoch_7b6b2c0a } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -function firstClaimableRewardEpoch( -) external view returns ( - uint256); -``` - -Epochs before the token distribution event at Flare launch were not be claimable. -Use this method to know the first reward epoch that was claimable. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 The first reward epoch that can be claimed. | -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `getClaimedReward` { #fn_getclaimedreward_85b4c538 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getClaimedReward( - uint256 _rewardEpoch, - address _dataProvider, - address _claimer -) external view returns ( - bool _claimed, - uint256 _amount); -``` - -Returns information on the rewards accrued by a reward owner from a specific data provider at a specific -reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID to query. | -| `_dataProvider` | `address` | Address of the data provider to query. | -| `_claimer` | `address` | Address of the reward owner to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_claimed` | `bool` | Whether the reward has been claimed or not. | -| `_amount` | `uint256` | Accrued amount in wei. | -
-
- -
- -### `getContractName` { #fn_getcontractname_f5f5ba72 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getContractName( -) external pure returns ( - string); -``` - -Implement this function to allow updating inflation receiver contracts through [`AddressUpdater`](./AddressUpdater.md). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `string` | Contract name. | -
-
- -
- -### `getCurrentRewardEpoch` { #fn_getcurrentrewardepoch_e7c830d4 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getCurrentRewardEpoch( -) external view returns ( - uint256); -``` - -Returns the current reward epoch ID. - -
-
- -
- -### `getDataProviderCurrentFeePercentage` { #fn_getdataprovidercurrentfeepercentage_cfbcd25f } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderCurrentFeePercentage( - address _dataProvider -) external view returns ( - uint256); -``` - -Returns the current [fee](https://docs.flare.network/tech/ftso/#rewards) percentage of a data provider. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_dataProvider` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | | -
-
- -
- -### `getDataProviderFeePercentage` { #fn_getdataproviderfeepercentage_961c00ed } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderFeePercentage( - address _dataProvider, - uint256 _rewardEpoch -) external view returns ( - uint256 _feePercentageBIPS); -``` - -Returns the [fee](https://docs.flare.network/tech/ftso/#rewards) percentage of a data provider at a -given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_dataProvider` | `address` | Address of the queried data provider. | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256` | Fee percentage in BIPS. | -
-
- -
- -### `getDataProviderPerformanceInfo` { #fn_getdataproviderperformanceinfo_eb82dd7f } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderPerformanceInfo( - uint256 _rewardEpoch, - address _dataProvider -) external view returns ( - uint256 _rewardAmount, - uint256 _votePowerIgnoringRevocation); -``` - -Returns information on rewards and vote power of a data provider at a given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | -| `_dataProvider` | `address` | Address of the data provider to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Amount of rewards (wei). | -| `_votePowerIgnoringRevocation` | `uint256` | Vote power, not including revocations. | -
-
- -
- -### `getDataProviderScheduledFeePercentageChanges` { #fn_getdataproviderscheduledfeepercentagechanges_33b7971e } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderScheduledFeePercentageChanges( - address _dataProvider -) external view returns ( - uint256[] _feePercentageBIPS, - uint256[] _validFromEpoch, - bool[] _fixed); -``` - -Returns the scheduled [fee](https://docs.flare.network/tech/ftso/#rewards) percentage changes for a data -provider. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_dataProvider` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256[]` | Array of fee percentages in BIPS. | -| `_validFromEpoch` | `uint256[]` | Array of block numbers from which the fee settings are effective. | -| `_fixed` | `bool[]` | Array of boolean values indicating whether settings are subject to change or not. | -
-
- -
- -### `getEpochReward` { #fn_getepochreward_d418634a } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getEpochReward( - uint256 _rewardEpoch -) external view returns ( - uint256 _totalReward, - uint256 _claimedReward); -``` - -Returns information on an epoch's rewards. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_totalReward` | `uint256` | Total amount of rewards accrued on that epoch, in wei. | -| `_claimedReward` | `uint256` | Total amount of rewards that have already been claimed, in wei. | -
-
- -
- -### `getEpochsWithClaimableRewards` { #fn_getepochswithclaimablerewards_0441218e } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getEpochsWithClaimableRewards( -) external view returns ( - uint256 _startEpochId, - uint256 _endEpochId); -``` - -Returns the reward epoch range for which rewards can be claimed. -Rewards outside this range are unclaimable, either because they have expired or because the reward epoch is -still ongoing. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_startEpochId` | `uint256` | The oldest epoch ID that allows reward claiming. | -| `_endEpochId` | `uint256` | The newest epoch ID that allows reward claiming. | -
-
- -
- -### `getEpochsWithUnclaimedRewards` { #fn_getepochswithunclaimedrewards_b4a2043d } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getEpochsWithUnclaimedRewards( - address _beneficiary -) external view returns ( - uint256[] _epochIds); -``` - -Returns the array of claimable epoch IDs for which the rewards of a reward owner have not yet been claimed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_beneficiary` | `address` | Address of the reward owner to query. Reverts if it uses delegation by amount. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_epochIds` | `uint256[]` | Array of epoch IDs. | -
-
- -
- -### `getExpectedBalance` { #fn_getexpectedbalance_af04cd3b } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getExpectedBalance( -) external view returns ( - uint256); -``` - -Returns the contract's expected balance -(actual balance may be higher due to self-destruct funds). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Expected native token balance. | -
-
- -
- -### `getInflationAddress` { #fn_getinflationaddress_ed39d3f8 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getInflationAddress( -) external view returns ( - address); -``` - -Returns the address of the [`Inflation`](./Inflation.md) contract. - -
-
- -
- -### `getInitialRewardEpoch` { #fn_getinitialrewardepoch_3123b7d8 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getInitialRewardEpoch( -) external view returns ( - uint256 _initialRewardEpoch); -``` - -Returns the initial reward epoch ID for this reward manager contract. -This corresponds to the oldest reward epoch with claimable rewards in the previous reward manager when this -one took over. -Set by [`governance`](#fn_governance_5aa6e675) through [`setInitialRewardData`](#fn_setinitialrewarddata_1de56098). - -
-
- -
- -### `getRewardEpochToExpireNext` { #fn_getrewardepochtoexpirenext_3e7ff857 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getRewardEpochToExpireNext( -) external view returns ( - uint256); -``` - -Returns the reward epoch that will expire next once a new reward epoch starts. - -
-
- -
- -### `getRewardEpochVotePowerBlock` { #fn_getrewardepochvotepowerblock_f2edab5a } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getRewardEpochVotePowerBlock( - uint256 _rewardEpoch -) external view returns ( - uint256); -``` - -Returns the [vote power block](https://docs.flare.network/tech/ftso/#vote-power) of a given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | - -
-
- -
- -### `getStateOfRewards` { #fn_getstateofrewards_a4472c10 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getStateOfRewards( - address _beneficiary, - uint256 _rewardEpoch -) external view returns ( - address[] _dataProviders, - uint256[] _rewardAmounts, - bool[] _claimed, - bool _claimable); -``` - -Returns the state of rewards for a given address at a specific reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_beneficiary` | `address` | Address of the beneficiary to query. It can be a data provider or a delegator, for example.
Reverts if the queried address is delegating by amount. | -| `_rewardEpoch` | `uint256` | Reward epoch ID to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_dataProviders` | `address[]` | Array of addresses of data providers. | -| `_rewardAmounts` | `uint256[]` | Array of reward amounts received from each provider, in wei. | -| `_claimed` | `bool[]` | Array of boolean values indicating whether each reward has been claimed or not. | -| `_claimable` | `bool` | Boolean value indicating whether rewards are claimable or not. | -
-
- -
- -### `getStateOfRewardsFromDataProviders` { #fn_getstateofrewardsfromdataproviders_e416b7e1 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getStateOfRewardsFromDataProviders( - address _beneficiary, - uint256 _rewardEpoch, - address[] _dataProviders -) external view returns ( - uint256[] _rewardAmounts, - bool[] _claimed, - bool _claimable); -``` - -Returns the state of rewards for a given address coming from a specific set of data providers, at a specific -reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_beneficiary` | `address` | Address of beneficiary to query. | -| `_rewardEpoch` | `uint256` | Reward epoch ID to query. | -| `_dataProviders` | `address[]` | Array of addresses of the data providers to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmounts` | `uint256[]` | Array of reward amounts received from each provider, in wei. | -| `_claimed` | `bool[]` | Array of boolean values indicating whether each reward has been claimed or not. | -| `_claimable` | `bool` | Boolean value indicating whether rewards are claimable or not. | -
-
- -
- -### `getTokenPoolSupplyData` { #fn_gettokenpoolsupplydata_2dafdbbf } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getTokenPoolSupplyData( -) external view returns ( - uint256 _lockedFundsWei, - uint256 _totalInflationAuthorizedWei, - uint256 _totalClaimedWei); -``` - -Returns token pool supply data. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_lockedFundsWei` | `uint256` | Total amount of funds ever locked in the token pool (wei). `_lockedFundsWei` - `_totalClaimedWei` is the amount currently locked and outside the circulating supply. | -| `_totalInflationAuthorizedWei` | `uint256` | Total inflation authorized amount (wei). | -| `_totalClaimedWei` | `uint256` | Total claimed amount (wei). | -
-
- -
- -### `getTotals` { #fn_gettotals_84e10a90 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getTotals( -) external view returns ( - uint256 _totalAwardedWei, - uint256 _totalClaimedWei, - uint256 _totalExpiredWei, - uint256 _totalUnearnedWei, - uint256 _totalBurnedWei, - uint256 _totalInflationAuthorizedWei, - uint256 _totalInflationReceivedWei, - uint256 _lastInflationAuthorizationReceivedTs, - uint256 _dailyAuthorizedInflation); -``` - -Returns statistics regarding rewards, accumulated over the whole lifespan of the reward manager contract. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_totalAwardedWei` | `uint256` | Rewards that were distributed (wei). | -| `_totalClaimedWei` | `uint256` | Distributed rewards that were claimed in time (wei). | -| `_totalExpiredWei` | `uint256` | Distributed rewards that were not claimed in time and expired (wei). | -| `_totalUnearnedWei` | `uint256` | Rewards that were unearned (due to FTSO being in fallback mode) and thus were not distributed (wei). | -| `_totalBurnedWei` | `uint256` | Rewards that were unearned or expired and thus burned (wei). | -| `_totalInflationAuthorizedWei` | `uint256` | Total inflation authorized amount (wei). | -| `_totalInflationReceivedWei` | `uint256` | Total inflation received amount (wei). | -| `_lastInflationAuthorizationReceivedTs` | `uint256` | UNIX timestamp of the last inflation authorization. | -| `_dailyAuthorizedInflation` | `uint256` | [`Inflation`](./Inflation.md) authorized amount (wei) at the time of last authorization. | -
-
- -
- -### `getUnclaimedReward` { #fn_getunclaimedreward_657d9695 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function getUnclaimedReward( - uint256 _rewardEpoch, - address _dataProvider -) external view returns ( - uint256 _amount, - uint256 _weight); -``` - -Returns information on unclaimed rewards for a given data provider and epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Queried reward epoch ID. | -| `_dataProvider` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_amount` | `uint256` | Amount available to be claimed, in wei. | -| `_weight` | `uint256` | Portion of total vote power used in this reward epoch that has not yet claimed its reward, in BIPS. It decreases to 0 when all data providers have claimed their rewards. | -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `nextClaimableRewardEpoch` { #fn_nextclaimablerewardepoch_69b91b59 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function nextClaimableRewardEpoch( - address _rewardOwner -) external view returns ( - uint256); -``` - -Returns the next claimable reward epoch for a reward owner. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | Address of the reward owner to query. | - -
-
- -
- -### `receiveInflation` { #fn_receiveinflation_06201f1d } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function receiveInflation( -) external payable; -``` - -Receive native tokens from inflation. - -Only the `inflation` contract can call this method. - -
-
- -
- -### `setDailyAuthorizedInflation` { #fn_setdailyauthorizedinflation_e2739563 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function setDailyAuthorizedInflation( - uint256 _toAuthorizeWei -) external; -``` - -Notify the receiver that it is entitled to receive a new inflation amount. - -Only the `inflation` contract can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_toAuthorizeWei` | `uint256` | The amount of inflation that can be awarded in the coming day, in wei. | - -
-
- -
- -### `setDataProviderFeePercentage` { #fn_setdataproviderfeepercentage_16e69328 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function setDataProviderFeePercentage( - uint256 _feePercentageBIPS -) external returns ( - uint256); -``` - -Sets the [fee](https://docs.flare.network/tech/ftso/#rewards) a data provider keeps from all delegations. - -Takes effect after `feeValueUpdateOffset` reward epochs have elapsed. - -When called multiple times inside the same reward epoch, only the last value remains. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256` | Fee percentage in BIPS. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | | -
-
- -
- -### `setInitialRewardData` { #fn_setinitialrewarddata_1de56098 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function setInitialRewardData( -) external; -``` - -Copy initial reward data from [`oldFtsoRewardManager`](#va_oldftsorewardmanager) before starting up this new reward manager. -Should be called at the time of switching to the new reward manager, can be called only once, and only -by [`governance`](#fn_governance_5aa6e675). - -
-
- -
- -### `setNewFtsoRewardManager` { #fn_setnewftsorewardmanager_82a2b905 } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -function setNewFtsoRewardManager( - address _newFtsoRewardManager -) external; -``` - -Sets new ftso reward manager which will take over closing expired reward epochs -Should be called at the time of switching to the new reward manager, can be called only once, and only -by [`governance`](#fn_governance_5aa6e675). - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -
- -## Modifiers - -
- -### `mustBalance` { #md_mustbalance } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -modifier mustBalance() -``` - -
-
- -
- -### `nonReentrant` { #md_nonreentrant } - -
-Defined in `ReentrancyGuard` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/utils/ReentrancyGuard.sol)). -
- -
- -```solidity -modifier nonReentrant() -``` - -Prevents a contract from calling itself, directly or indirectly. -Calling a `nonReentrant` function from another `nonReentrant` -function is not supported. It is possible to prevent this from happening -by making the `nonReentrant` function external, and make it call a -`private` function that does the actual work. - -
-
- -
- -### `onlyAddressUpdater` { #md_onlyaddressupdater } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -modifier onlyAddressUpdater() -``` - -Only the `AdressUpdater` contract can call this method. -Its address is set at construction time but it can also update itself. - -
-
- -
- -### `onlyExecutorAndAllowedRecipient` { #md_onlyexecutorandallowedrecipient } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -modifier onlyExecutorAndAllowedRecipient( address _rewardOwner, - address _recipient) -``` - -Only the reward owner and its authorized executors can call this method. -Executors can only send rewards to authorized recipients. -See [`ClaimSetupManager`](./ClaimSetupManager.md). - -
-
- -
- -### `onlyFtsoManager` { #md_onlyftsomanager } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -modifier onlyFtsoManager() -``` - -Only the [`ftsoManager`](#va_ftsomanager) contract can call this method. - -
-
- -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyIfActive` { #md_onlyifactive } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -modifier onlyIfActive() -``` - -This method can only be called if the contract is [`active`](#va_active). - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -### `onlyInflation` { #md_onlyinflation } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity -modifier onlyInflation() -``` - -Only the [`Inflation`](./Inflation.md) contract can call this method. - -
-
- -
- -
- -## Structures - -
- -### `RewardClaim` { #st_rewardclaim } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -
-```solidity -struct RewardClaim { - bool claimed; - uint128 amount; -} -``` - -
- -
- -### `RewardState` { #st_rewardstate } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -
-```solidity -struct RewardState { - address[] dataProviders; - uint256[] weights; - uint256[] amounts; - bool[] claimed; -} -``` - -
- -
- -### `TimelockedCall` { #st_timelockedcall } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -
-```solidity -struct TimelockedCall { - uint256 allowedAfterTimestamp; - bytes encodedCall; -} -``` - -
- -
- -### `UnclaimedRewardState` { #st_unclaimedrewardstate } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -
-```solidity -struct UnclaimedRewardState { - uint128 amount; - uint128 weight; -} -``` - -
- -
- -
- -## Variables - -
- -### `active` { #va_active } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity - bool active -``` - -Whether rewards can be claimed from this reward manager. - -
-
- -
- -### `claimSetupManager` { #va_claimsetupmanager } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity - contract IIClaimSetupManager claimSetupManager -``` - -The [`ClaimSetupManager`](./ClaimSetupManager.md) contract that helps automate reward claiming. - -
-
- -
- -### `firstClaimableRewardEpoch` { #va_firstclaimablerewardepoch } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity - uint256 firstClaimableRewardEpoch -``` - -Epochs before the token distribution event at Flare launch were not be claimable. -This variable holds the first reward epoch that was claimable. - -
-
- -
- -### `ftsoManager` { #va_ftsomanager } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity - contract IIFtsoManager ftsoManager -``` - -The [`FtsoManager`](./FtsoManager.md) contract that controls reward distribution. - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `newFtsoRewardManager` { #va_newftsorewardmanager } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity - address newFtsoRewardManager -``` - -Address of the new [`FtsoRewardManager`](./FtsoRewardManager.md) that replaced this one. - -
-
- -
- -### `oldFtsoRewardManager` { #va_oldftsorewardmanager } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity - address oldFtsoRewardManager -``` - -Address of the old [`FtsoRewardManager`](./FtsoRewardManager.md), replaced by this one. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- -### `wNat` { #va_wnat } - -
-Defined in `FtsoRewardManager` ([Docs](./FtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/implementation/FtsoRewardManager.sol)). -
- -
- -```solidity - contract WNat wNat -``` - -Address of the wrapped native token ([`WNat`](./WNat.md)) contract. - -
-
- -
- diff --git a/docs/apis/smart-contracts/GovernanceSettings.md b/docs/apis/smart-contracts/GovernanceSettings.md deleted file mode 100644 index 2af35b24b..000000000 --- a/docs/apis/smart-contracts/GovernanceSettings.md +++ /dev/null @@ -1,364 +0,0 @@ ---- -title: GovernanceSettings -search: - boost: 0.5 ---- - - - -# `GovernanceSettings` { #ct_governancesettings } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol) | Inherits from [IGovernanceSettings](./IGovernanceSettings.md) -
- -
- -A special contract that holds the Flare governance address and its timelock. - -All governance calls are delayed by the timelock specified in this contract. - -This contract enables updating governance address and timelock only by hard-forking the network, -this is, only by updating validator code. - -
- -
- -## Events - -
- -### `GovernanceAddressUpdated` { #ev_governanceaddressupdated } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -event GovernanceAddressUpdated( - uint256 timestamp, - address oldGovernanceAddress, - address newGovernanceAddress -) -``` - -Emitted when the governance address has been changed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `timestamp` | `uint256` | Timestamp of the block where the change happened, in seconds from UNIX epoch. | -| `oldGovernanceAddress` | `address` | Governance address before the change. | -| `newGovernanceAddress` | `address` | Governance address after the change. | - -
-
- -
- -### `GovernanceExecutorsUpdated` { #ev_governanceexecutorsupdated } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -event GovernanceExecutorsUpdated( - uint256 timestamp, - address[] oldExecutors, - address[] newExecutors -) -``` - -The list of addresses that are allowed to perform governance calls has been changed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `timestamp` | `uint256` | Timestamp of the block where the change happened, in seconds from UNIX epoch. | -| `oldExecutors` | `address[]` | Array of executor addresses before the change. | -| `newExecutors` | `address[]` | Array of executor addresses after the change. | - -
-
- -
- -### `GovernanceTimelockUpdated` { #ev_governancetimelockupdated } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -event GovernanceTimelockUpdated( - uint256 timestamp, - uint256 oldTimelock, - uint256 newTimelock -) -``` - -Emitted when the timelock has been changed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `timestamp` | `uint256` | Timestamp of the block where the change happened, in seconds from UNIX epoch. | -| `oldTimelock` | `uint256` | Timelock before the change (in seconds). | -| `newTimelock` | `uint256` | Timelock after the change (in seconds). | - -
-
- -
- -
- -## Functions - -
- -### `getExecutors` { #fn_getexecutors_ef09e78f } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -function getExecutors( -) external view returns ( - address[]); -``` - -Gets the addresses of the accounts that are allowed to execute the timelocked governance calls, -once the timelock period expires. -Executors can be changed without a hard fork, via a normal governance call. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | | -
-
- -
- -### `getGovernanceAddress` { #fn_getgovernanceaddress_73252494 } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -function getGovernanceAddress( -) external view returns ( - address); -``` - -Gets the governance account address. -The governance address can only be changed by a hard fork. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | | -
-
- -
- -### `getTimelock` { #fn_gettimelock_6221a54b } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -function getTimelock( -) external view returns ( - uint256); -``` - -Gets the time in seconds that must pass between a governance call and its execution. -The timelock value can only be changed by a hard fork. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | | -
-
- -
- -### `initialise` { #fn_initialise_cf0ea268 } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -function initialise( - address _governanceAddress, - uint256 _timelock, - address[] _executors -) external; -``` - -Perform initialization, which cannot be done in constructor, since this is a genesis contract. -Can only be called once. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governanceAddress` | `address` | Initial governance address. | -| `_timelock` | `uint256` | Initial timelock value, in seconds. | -| `_executors` | `address[]` | Initial list of addresses allowed to perform governance calls. | - -
-
- -
- -### `isExecutor` { #fn_isexecutor_debfda30 } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -function isExecutor( - address _address -) external view returns ( - bool); -``` - -Checks whether an address is one of the allowed executors. See [`getExecutors`](#fn_getexecutors_ef09e78f). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_address` | `address` | The address to check. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | True if `_address` is in the executors list. | -
-
- -
- -### `setExecutors` { #fn_setexecutors_1d452e46 } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -function setExecutors( - address[] _newExecutors -) external; -``` - -Set the addresses of the accounts that are allowed to execute the timelocked governance calls -once the timelock period expires. -It isn't very dangerous to allow for anyone to execute timelocked calls, but we reserve the right to -make sure the timing of the execution is under control. -Can only be called by the governance. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_newExecutors` | `address[]` | New list of allowed executors. The previous list is replaced. | - -
-
- -
- -### `setGovernanceAddress` { #fn_setgovernanceaddress_cfc16254 } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -function setGovernanceAddress( - address _newGovernance -) external; -``` - -Change the governance address. -Can only be called by validators via fork. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_newGovernance` | `address` | New governance address. | - -
-
- -
- -### `setTimelock` { #fn_settimelock_1e891c0a } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity -function setTimelock( - uint256 _newTimelock -) external; -``` - -Change the timelock, this is, the amount of time between a governance call and -its execution. -Can only be called by validators via fork. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_newTimelock` | `uint256` | New timelock value, in seconds. | - -
-
- -
- -
- -## Variables - -
- -### `SIGNAL_COINBASE` { #va_signal_coinbase } - -
-Defined in `GovernanceSettings` ([Docs](./GovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/GovernanceSettings.sol)). -
- -
- -```solidity - address SIGNAL_COINBASE -``` - -
-
- -
- diff --git a/docs/apis/smart-contracts/GovernanceVotePower.md b/docs/apis/smart-contracts/GovernanceVotePower.md deleted file mode 100644 index def16bf6b..000000000 --- a/docs/apis/smart-contracts/GovernanceVotePower.md +++ /dev/null @@ -1,577 +0,0 @@ ---- -title: GovernanceVotePower -search: - boost: 0.5 ---- - - - -# `GovernanceVotePower` { #ct_governancevotepower } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol) | Inherits from [IIGovernanceVotePower](./IIGovernanceVotePower.md) -
- -
- -Contract managing governance vote power and its delegation. - -
- -
- -## Functions - -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -constructor( - contract IVPToken _ownerToken, - contract IPChainStakeMirror _pChainStakeMirror -) public; -``` - -Construct [`GovernanceVotePower`](./GovernanceVotePower.md) for given [`VPToken`](./VPToken.md). - -
-
- -
- -### `delegate` { #fn_delegate_5c19a95c } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function delegate( - address _to -) public; -``` - -Delegates all governance vote power of `msg.sender` to address `_to`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | - -
-
- -
- -### `delegatedGovernanceVotePowerHistoryCleanup` { #fn_delegatedgovernancevotepowerhistorycleanup_29a59ff2 } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function delegatedGovernanceVotePowerHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete governance vote power checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Vote power owner account address. | -| `_count` | `uint256` | Maximum number of checkpoints to delete. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The number of deleted checkpoints. | -
-
- -
- -### `delegatesHistoryCleanup` { #fn_delegateshistorycleanup_f7ce0ddf } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function delegatesHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete delegates checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Vote power owner account address. | -| `_count` | `uint256` | Maximum number of checkpoints to delete. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The number of deleted checkpoints. | -
-
- -
- -### `getCleanupBlockNumber` { #fn_getcleanupblocknumber_a72ec4b6 } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function getCleanupBlockNumber( -) external view returns ( - uint256); -``` - -Get the current cleanup block number set with [`setCleanupBlockNumber`](#fn_setcleanupblocknumber_13de97f5). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The currently set cleanup block number. | -
-
- -
- -### `getDelegateOfAt` { #fn_getdelegateofat_3c028e9d } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function getDelegateOfAt( - address _who, - uint256 _blockNumber -) public view returns ( - address); -``` - -Gets the address an account is delegating its governance vote power to, at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number at which to fetch the address. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address where `_who` was delegating its governance vote power at block `_blockNumber`. | -
-
- -
- -### `getDelegateOfAtNow` { #fn_getdelegateofatnow_b3e871ee } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function getDelegateOfAtNow( - address _who -) public view returns ( - address); -``` - -Gets the address an account is delegating its governance vote power to, at the latest block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address where `_who` is currently delegating its governance vote power. | -
-
- -
- -### `getVotes` { #fn_getvotes_9ab24eb0 } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function getVotes( - address _who -) public view returns ( - uint256); -``` - -Gets the governance vote power of an address at the latest block, including -all delegations made to it. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Governance vote power of `account` at the lastest block. | -
-
- -
- -### `ownerToken` { #fn_ownertoken_65371883 } - -
-Defined in `IIGovernanceVotePower` ([Docs](./IIGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol)). -
- -
- -```solidity -function ownerToken( -) external view returns ( - contract IVPToken); -``` - -Get the token that this governance vote power contract belongs to. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IVPToken` | The [`IVPToken`](./IVPToken.md) interface owning this contract. | -
-
- -
- -### `pChainStakeMirror` { #fn_pchainstakemirror_62d9c89a } - -
-Defined in `IIGovernanceVotePower` ([Docs](./IIGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol)). -
- -
- -```solidity -function pChainStakeMirror( -) external view returns ( - contract IPChainStakeMirror); -``` - -Get the stake mirror contract that this governance vote power contract belongs to. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IPChainStakeMirror` | The [`IPChainStakeMirror`](./IPChainStakeMirror.md) interface owning this contract. | -
-
- -
- -### `setCleanerContract` { #fn_setcleanercontract_f6a494af } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function setCleanerContract( - address _cleanerContract -) external; -``` - -Set the contract that is allowed to call history cleaning methods. - -This method can be called by the [`ownerToken`](#va_ownertoken) only. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanerContract` | `address` | Address of the cleanup contract. Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). | - -
-
- -
- -### `setCleanupBlockNumber` { #fn_setcleanupblocknumber_13de97f5 } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function setCleanupBlockNumber( - uint256 _blockNumber -) external; -``` - -Set the cleanup block number. -Historic data for the blocks before `cleanupBlockNumber` can be erased. -History before that block should never be used since it can be inconsistent. -In particular, cleanup block number must be lower than the current vote power block. - -This method can be called by the [`ownerToken`](#va_ownertoken) only. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The new cleanup block number. | - -
-
- -
- -### `undelegate` { #fn_undelegate_92ab89bb } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function undelegate( -) public; -``` - -Undelegates all governance vote power of `msg.sender`. - -
-
- -
- -### `updateAtTokenTransfer` { #fn_updateattokentransfer_eadb4362 } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function updateAtTokenTransfer( - address _from, - address _to, - uint256, - uint256, - uint256 _amount -) external; -``` - -Update governance vote power of all involved delegates after tokens are transferred. - -This function **MUST** be called after each governance token transfer for the -delegates to reflect the correct balance. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Source address of the transfer. | -| `_to` | `address` | Destination address of the transfer. | -| `` | `uint256` | | -| `` | `uint256` | | -| `_amount` | `uint256` | Amount being transferred. | - -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_92bfe6d8 } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -function votePowerOfAt( - address _who, - uint256 _blockNumber -) public view returns ( - uint256); -``` - -Gets the governance vote power of an address at a given block number, including -all delegations made to it. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number at which to fetch the vote power. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Governance vote power of `_who` at `_blockNumber`. | -
-
- -
- -
- -## Modifiers - -
- -### `onlyCleaner` { #md_onlycleaner } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -modifier onlyCleaner() -``` - -History cleaning methods can be called only from the cleaner address. - -
-
- -
- -### `onlyOwnerContracts` { #md_onlyownercontracts } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -modifier onlyOwnerContracts() -``` - -Method [`updateAtTokenTransfer`](#fn_updateattokentransfer_eadb4362) in [`GovernanceVotePower`](./GovernanceVotePower.md) can only be executed by the owner contracts. - -
-
- -
- -### `onlyOwnerToken` { #md_onlyownertoken } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity -modifier onlyOwnerToken() -``` - -All external methods in [`GovernanceVotePower`](./GovernanceVotePower.md) can only be executed by the owner token. - -
-
- -
- -
- -## Variables - -
- -### `cleanerContract` { #va_cleanercontract } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity - address cleanerContract -``` - -Address of the contract that is allowed to call methods for history cleaning. -Set with [`setCleanerContract`](#fn_setcleanercontract_f6a494af). - -
-
- -
- -### `ownerToken` { #va_ownertoken } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity - contract IVPToken ownerToken -``` - -The [`VPToken`](./VPToken.md) and [`IPChainStakeMirror`](./IPChainStakeMirror.md) contracts that own this [`GovernanceVotePower`](./GovernanceVotePower.md). -All state changing methods may be called only from these addresses. -This is because original `msg.sender` is typically sent in a parameter -and we must make sure that it cannot be faked by directly calling -[`GovernanceVotePower`](./GovernanceVotePower.md) methods. - -
-
- -
- -### `pChainStakeMirror` { #va_pchainstakemirror } - -
-Defined in `GovernanceVotePower` ([Docs](./GovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/GovernanceVotePower.sol)). -
- -
- -```solidity - contract IPChainStakeMirror pChainStakeMirror -``` - -Get the stake mirror contract that this governance vote power contract belongs to. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -
-
- -
- diff --git a/docs/apis/smart-contracts/Governed.md b/docs/apis/smart-contracts/Governed.md deleted file mode 100644 index 6a4505912..000000000 --- a/docs/apis/smart-contracts/Governed.md +++ /dev/null @@ -1,147 +0,0 @@ ---- -title: Governed -search: - boost: 0.5 ---- - - - -# `Governed` { #ct_governed } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/Governed.sol) | Inherits from [GovernedBase](./GovernedBase.md) -
- -
- -Defines behaviors for governed contracts that must have a governor set at construction-time. - -
- -
- -## Functions - -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Governed` ([Docs](./Governed.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/Governed.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Governance contract. Must not be zero. | - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- diff --git a/docs/apis/smart-contracts/GovernedAndFlareDaemonized.md b/docs/apis/smart-contracts/GovernedAndFlareDaemonized.md deleted file mode 100644 index 6540dbc83..000000000 --- a/docs/apis/smart-contracts/GovernedAndFlareDaemonized.md +++ /dev/null @@ -1,310 +0,0 @@ ---- -title: GovernedAndFlareDaemonized -search: - boost: 0.5 ---- - - - -# `GovernedAndFlareDaemonized` { #ct_governedandflaredaemonized } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol) | Inherits from [Governed](./Governed.md) -
- -
- -Base class for contracts that are governed and triggered from the [`FlareDaemon`](./FlareDaemon.md). - -See [`Governed`](./Governed.md) and [`IFlareDaemonize`](./IFlareDaemonize.md). - -
- -
- -## Functions - -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `GovernedAndFlareDaemonized` ([Docs](./GovernedAndFlareDaemonized.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol)). -
- -
- -```solidity -constructor( - address _governance, - contract FlareDaemon _flareDaemon -) public; -``` - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Governed` ([Docs](./Governed.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/Governed.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Governance contract. Must not be zero. | - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -
- -## Modifiers - -
- -### `onlyFlareDaemon` { #md_onlyflaredaemon } - -
-Defined in `GovernedAndFlareDaemonized` ([Docs](./GovernedAndFlareDaemonized.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol)). -
- -
- -```solidity -modifier onlyFlareDaemon() -``` - -Only the [`flareDaemon`](#va_flaredaemon) can call this method. - -
-
- -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -
- -## Variables - -
- -### `flareDaemon` { #va_flaredaemon } - -
-Defined in `GovernedAndFlareDaemonized` ([Docs](./GovernedAndFlareDaemonized.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol)). -
- -
- -```solidity - contract FlareDaemon flareDaemon -``` - -The [`FlareDaemon`](./FlareDaemon.md) contract, set at construction time. - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- diff --git a/docs/apis/smart-contracts/GovernedAtGenesis.md b/docs/apis/smart-contracts/GovernedAtGenesis.md deleted file mode 100644 index 00378784e..000000000 --- a/docs/apis/smart-contracts/GovernedAtGenesis.md +++ /dev/null @@ -1,174 +0,0 @@ ---- -title: GovernedAtGenesis -search: - boost: 0.5 ---- - - - -# `GovernedAtGenesis` { #ct_governedatgenesis } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedAtGenesis.sol) | Inherits from [GovernedBase](./GovernedBase.md) -
- -
- -Defines behaviors for governed contracts that have their governor set at genesis. - -This contract enforces a fixed [`governance`](#fn_governance_5aa6e675) address when the [`constructor`](#fn_constructor_undefined) -is not executed on a contract (for instance when directly loaded to the genesis block). -This is required to fix [`governance`](#fn_governance_5aa6e675) on a contract when the network starts, at such point -where theoretically no accounts yet exist, and leaving it ungoverned could result in a race -to claim [`governance`](#fn_governance_5aa6e675) by an unauthorized address. - -
- -
- -## Functions - -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `GovernedAtGenesis` ([Docs](./GovernedAtGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedAtGenesis.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `initialise` { #fn_initialise_9d6a890f } - -
-Defined in `GovernedAtGenesis` ([Docs](./GovernedAtGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedAtGenesis.sol)). -
- -
- -```solidity -function initialise( - address _governance -) public pure; -``` - -Disallow [`initialise`](#fn_initialise_9d6a890f) to be called. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | The governance address for initial claiming. | - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- diff --git a/docs/apis/smart-contracts/GovernedBase.md b/docs/apis/smart-contracts/GovernedBase.md deleted file mode 100644 index cb6326993..000000000 --- a/docs/apis/smart-contracts/GovernedBase.md +++ /dev/null @@ -1,375 +0,0 @@ ---- -title: GovernedBase -search: - boost: 0.5 ---- - - - -# `GovernedBase` { #ct_governedbase } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol) -
- -
- -Abstract base class that defines behaviors for governed contracts. - -This class is abstract so that specific behaviors can be defined for the constructor. -Contracts should not be left ungoverned, but not all contract will have a constructor -(for example those pre-defined in genesis). - -
- -
- -## Events - -
- -### `GovernanceCallTimelocked` { #ev_governancecalltimelocked } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceCallTimelocked( - bytes4 selector, - uint256 allowedAfterTimestamp, - bytes encodedCall -) -``` - -Emitted when a new [`governance`](#fn_governance_5aa6e675) call has been recorded and is now waiting for the time lock to expire. - -
-
- -
- -### `GovernanceInitialised` { #ev_governanceinitialised } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceInitialised( - address initialGovernance -) -``` - -Emitted when the [`governance`](#fn_governance_5aa6e675) address is initialized. -This address will be used until production mode is entered (see [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered)). -At that point the [`governance`](#fn_governance_5aa6e675) address is taken from [`GovernanceSettings`](./GovernanceSettings.md). - -
-
- -
- -### `GovernedProductionModeEntered` { #ev_governedproductionmodeentered } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernedProductionModeEntered( - address governanceSettings -) -``` - -Emitted when [`governance`](#fn_governance_5aa6e675) is enabled and the [`governance`](#fn_governance_5aa6e675) address cannot be changed anymore -(only through a network fork). - -
-
- -
- -### `TimelockedGovernanceCallCanceled` { #ev_timelockedgovernancecallcanceled } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallCanceled( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is canceled before execution. - -
-
- -
- -### `TimelockedGovernanceCallExecuted` { #ev_timelockedgovernancecallexecuted } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallExecuted( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is executed. - -
-
- -
- -
- -## Functions - -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -
- -## Modifiers - -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -
- -## Structures - -
- -### `TimelockedCall` { #st_timelockedcall } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -
-```solidity -struct TimelockedCall { - uint256 allowedAfterTimestamp; - bytes encodedCall; -} -``` - -
- -
- -
- -## Variables - -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- diff --git a/docs/apis/smart-contracts/IAddressValidityVerification.md b/docs/apis/smart-contracts/IAddressValidityVerification.md deleted file mode 100644 index 16f388fa1..000000000 --- a/docs/apis/smart-contracts/IAddressValidityVerification.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: IAddressValidityVerification -search: - boost: 0.5 ---- - - - -# `IAddressValidityVerification` { #ct_iaddressvalidityverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IAddressValidityVerification.sol) -
- -
- -Interface for verifying [`AddressValidity`](../attestation-types/AddressValidity.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This interface can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `verifyAddressValidity` { #fn_verifyaddressvalidity_f34ef587 } - -
-Defined in `IAddressValidityVerification` ([Docs](./IAddressValidityVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IAddressValidityVerification.sol)). -
- -
- -```solidity -function verifyAddressValidity( - struct AddressValidity.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`AddressValidity`](../attestation-types/AddressValidity.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct AddressValidity.Proof` | The [`AddressValidity`](../attestation-types/AddressValidity.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IBalanceDecreasingTransactionVerification.md b/docs/apis/smart-contracts/IBalanceDecreasingTransactionVerification.md deleted file mode 100644 index ce503a945..000000000 --- a/docs/apis/smart-contracts/IBalanceDecreasingTransactionVerification.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: IBalanceDecreasingTransactionVerification -search: - boost: 0.5 ---- - - - -# `IBalanceDecreasingTransactionVerification` { #ct_ibalancedecreasingtransactionverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IBalanceDecreasingTransactionVerification.sol) -
- -
- -Interface for verifying [`BalanceDecreasingTransaction`](../attestation-types/BalanceDecreasingTransaction.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This interface can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `verifyBalanceDecreasingTransaction` { #fn_verifybalancedecreasingtransaction_6ec659c7 } - -
-Defined in `IBalanceDecreasingTransactionVerification` ([Docs](./IBalanceDecreasingTransactionVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IBalanceDecreasingTransactionVerification.sol)). -
- -
- -```solidity -function verifyBalanceDecreasingTransaction( - struct BalanceDecreasingTransaction.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`BalanceDecreasingTransaction`](../attestation-types/BalanceDecreasingTransaction.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct BalanceDecreasingTransaction.Proof` | The [`BalanceDecreasingTransaction`](../attestation-types/BalanceDecreasingTransaction.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IClaimSetupManager.md b/docs/apis/smart-contracts/IClaimSetupManager.md deleted file mode 100644 index e212335b2..000000000 --- a/docs/apis/smart-contracts/IClaimSetupManager.md +++ /dev/null @@ -1,1002 +0,0 @@ ---- -title: IClaimSetupManager -search: - boost: 0.5 ---- - - - -# `IClaimSetupManager` { #ct_iclaimsetupmanager } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol) -
- -
- -Public interface for the [`ClaimSetupManager`](./ClaimSetupManager.md) contract. - -
- -
- -## Events - -
- -### `AllowedClaimRecipientsChanged` { #ev_allowedclaimrecipientschanged } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event AllowedClaimRecipientsChanged( - address owner, - address[] recipients -) -``` - -
-
- -
- -### `ClaimExecutorFeeValueChanged` { #ev_claimexecutorfeevaluechanged } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event ClaimExecutorFeeValueChanged( - address executor, - uint256 validFromRewardEpoch, - uint256 feeValueWei -) -``` - -
-
- -
- -### `ClaimExecutorsChanged` { #ev_claimexecutorschanged } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event ClaimExecutorsChanged( - address owner, - address[] executors -) -``` - -
-
- -
- -### `DelegationAccountCreated` { #ev_delegationaccountcreated } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event DelegationAccountCreated( - address owner, - contract IDelegationAccount delegationAccount -) -``` - -
-
- -
- -### `DelegationAccountUpdated` { #ev_delegationaccountupdated } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event DelegationAccountUpdated( - address owner, - contract IDelegationAccount delegationAccount, - bool enabled -) -``` - -
-
- -
- -### `ExecutorRegistered` { #ev_executorregistered } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event ExecutorRegistered( - address executor -) -``` - -
-
- -
- -### `ExecutorUnregistered` { #ev_executorunregistered } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event ExecutorUnregistered( - address executor, - uint256 validFromRewardEpoch -) -``` - -
-
- -
- -### `MaxFeeSet` { #ev_maxfeeset } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event MaxFeeSet( - uint256 maxFeeValueWei -) -``` - -
-
- -
- -### `MinFeeSet` { #ev_minfeeset } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event MinFeeSet( - uint256 minFeeValueWei -) -``` - -
-
- -
- -### `RegisterExecutorFeeSet` { #ev_registerexecutorfeeset } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event RegisterExecutorFeeSet( - uint256 registerExecutorFeeValueWei -) -``` - -
-
- -
- -### `SetExecutorsExcessAmountRefunded` { #ev_setexecutorsexcessamountrefunded } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event SetExecutorsExcessAmountRefunded( - address owner, - uint256 excessAmount -) -``` - -
-
- -
- -
- -## Functions - -
- -### `accountToDelegationAccount` { #fn_accounttodelegationaccount_69ea2387 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function accountToDelegationAccount( - address _owner -) external view returns ( - address); -``` - -Gets the [PDA](https://docs.flare.network/tech/personal-delegation-account) of an account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address of its PDA or `address(0)` if it has not been created yet. | -
-
- -
- -### `allowedClaimRecipients` { #fn_allowedclaimrecipients_dfd14c34 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function allowedClaimRecipients( - address _rewardOwner -) external view returns ( - address[]); -``` - -Gets the addresses of recipients allowed to receive rewards on behalf of an account. -Beside these, the owner of the rewards is always authorized. -See [`setAllowedClaimRecipients`](#fn_setallowedclaimrecipients_d2a4ac61). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | The account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Addresses of all set authorized recipients. | -
-
- -
- -### `batchDelegate` { #fn_batchdelegate_dc4fcda7 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function batchDelegate( - address[] _delegatees, - uint256[] _bips -) external; -``` - -Undelegates all percentage delegations from the caller's -[PDA](https://docs.flare.network/tech/personal-delegation-account) and then [`delegate`](#fn_delegate_026e402b) to a list of accounts. - -See [`delegate`](#fn_delegate_026e402b). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegatees` | `address[]` | The addresses of the new recipients. | -| `_bips` | `uint256[]` | The percentage of voting power to be delegated to each delegatee, expressed in basis points (1/100 of one percent). Total of all `_bips` values must be lower than 10000. | - -
-
- -
- -### `claimExecutors` { #fn_claimexecutors_3f317fe1 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function claimExecutors( - address _owner -) external view returns ( - address[]); -``` - -Gets the addresses of executors authorized to claim for an account. -See [`setClaimExecutors`](#fn_setclaimexecutors_9119c494). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Addresses of all set executors. | -
-
- -
- -### `delegate` { #fn_delegate_026e402b } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function delegate( - address _to, - uint256 _bips -) external; -``` - -Delegates a percentage of the caller's -[PDA](https://docs.flare.network/tech/personal-delegation-account)'s voting power to another address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_bips` | `uint256` | The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: Every call resets the delegation value. A value of 0 revokes delegation. | - -
-
- -
- -### `delegateGovernance` { #fn_delegategovernance_7a68a508 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function delegateGovernance( - address _to -) external; -``` - -Delegates all the [governance](https://docs.flare.network/tech/governance/) vote power of the caller's -[PDA](https://docs.flare.network/tech/personal-delegation-account) to another account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | Address of the recipient of the delegation. | - -
-
- -
- -### `disableDelegationAccount` { #fn_disabledelegationaccount_2394deb1 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function disableDelegationAccount( -) external; -``` - -Disables the -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA). - -When using automatic claiming, all airdrops and FTSO rewards will be sent to the owner's account. -Rewards accrued by the PDA will no longer be automatically claimed. - -Reverts if there is no PDA. - -
-
- -
- -### `enableDelegationAccount` { #fn_enabledelegationaccount_f0977215 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function enableDelegationAccount( -) external returns ( - contract IDelegationAccount); -``` - -Enables (or creates) a -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA). - -When using automatic claiming, all airdrops and FTSO rewards will be sent to the PDA, and any rewards -accrued by the PDA will be claimed too. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IDelegationAccount` | Address of the delegation account contract. | -
-
- -
- -### `getDelegationAccountData` { #fn_getdelegationaccountdata_17a1e3fc } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getDelegationAccountData( - address _owner -) external view returns ( - contract IDelegationAccount _delegationAccount, - bool _enabled); -``` - -Gets [PDA](https://docs.flare.network/tech/personal-delegation-account) data for an account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegationAccount` | `contract IDelegationAccount` | Account's PDA address or `address(0)` if it has not been created yet. | -| `_enabled` | `bool` | Whether the PDA is enabled. | -
-
- -
- -### `getExecutorCurrentFeeValue` { #fn_getexecutorcurrentfeevalue_e25547f8 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorCurrentFeeValue( - address _executor -) external view returns ( - uint256); -``` - -Returns the current fee of a registered executor. -Reverts if the executor is not registered. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Fee in wei. | -
-
- -
- -### `getExecutorFeeValue` { #fn_getexecutorfeevalue_3f8f784c } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorFeeValue( - address _executor, - uint256 _rewardEpoch -) external view returns ( - uint256); -``` - -Returns the fee of an executor at a given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | -| `_rewardEpoch` | `uint256` | Reward Epoch ID to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Fee in wei at that reward epoch. | -
-
- -
- -### `getExecutorInfo` { #fn_getexecutorinfo_8e28b923 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorInfo( - address _executor -) external view returns ( - bool _registered, - uint256 _currentFeeValue); -``` - -Returns information about an executor. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_registered` | `bool` | Whether the executor is registered. | -| `_currentFeeValue` | `uint256` | Executor's current fee value, if registered. | -
-
- -
- -### `getExecutorScheduledFeeValueChanges` { #fn_getexecutorscheduledfeevaluechanges_950b028c } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorScheduledFeeValueChanges( - address _executor -) external view returns ( - uint256[] _feeValue, - uint256[] _validFromEpoch, - bool[] _fixed); -``` - -Returns the currently scheduled fee changes of an executor. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | Executor to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feeValue` | `uint256[]` | Array of scheduled fees. | -| `_validFromEpoch` | `uint256[]` | Array of reward epochs ID where the scheduled fees will become effective. | -| `_fixed` | `bool[]` | Array of booleans indicating if an scheduled fee change is fixed or it might still be changed. | -
-
- -
- -### `getRegisteredExecutors` { #fn_getregisteredexecutors_6e927e61 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getRegisteredExecutors( - uint256 _start, - uint256 _end -) external view returns ( - address[] _registeredExecutors, - uint256 _totalLength); -``` - -Returns the list of executors registered through [`registerExecutor`](#fn_registerexecutor_ccce7e86). -Supports paging. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_start` | `uint256` | First executor to return. | -| `_end` | `uint256` | Last executor to return. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_registeredExecutors` | `address[]` | Addresses of the registered executors. | -| `_totalLength` | `uint256` | Total amount of executors. | -
-
- -
- -### `isClaimExecutor` { #fn_isclaimexecutor_87962abe } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function isClaimExecutor( - address _owner, - address _executor -) external view returns ( - bool); -``` - -Returns whether an executor is authorized to claim on behalf of a reward owner. -See [`setClaimExecutors`](#fn_setclaimexecutors_9119c494). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The reward owner to query. | -| `_executor` | `address` | The executor to query. | - -
-
- -
- -### `registerExecutor` { #fn_registerexecutor_ccce7e86 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function registerExecutor( - uint256 _feeValue -) external payable returns ( - uint256); -``` - -Registers the caller as an executor and sets its initial fee value. - -If the executor was already registered, this method only updates the fee, which will take effect after -`feeValueUpdateOffset` reward epochs have elapsed. - -Executor must pay a fee in order to register. See `registerExecutorFeeValueWei`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_feeValue` | `uint256` | Desired fee, in wei. Must be between `minFeeValueWei` and `maxFeeValueWei`. 0 means no fee. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID when the changes become effective. | -
-
- -
- -### `revokeDelegationAt` { #fn_revokedelegationat_bbd6fbf8 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function revokeDelegationAt( - address _who, - uint256 _blockNumber -) external; -``` - -Revokes all delegation from the caller's [PDA](https://docs.flare.network/tech/personal-delegation-account) -to a given account at a given block. - -Only affects the reads via `votePowerOfAtCached()` in the specified block. - -This method should be used only to prevent rogue [`delegate`](#fn_delegate_026e402b) voting in the current voting block. -To stop delegating use [`delegate`](#fn_delegate_026e402b) with percentage of 0 or [`undelegateAll`](#fn_undelegateall_b302f393). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The account to revoke. | -| `_blockNumber` | `uint256` | Block number where the revoking will take place. Must be in the past. | - -
-
- -
- -### `setAllowedClaimRecipients` { #fn_setallowedclaimrecipients_d2a4ac61 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function setAllowedClaimRecipients( - address[] _recipients -) external; -``` - -Set the addresses of allowed recipients. -The reward owner is always an allowed recipient. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipients` | `address[]` | The new allowed recipients. All old recipients will be deleted and replaced by these. | - -
-
- -
- -### `setAutoClaiming` { #fn_setautoclaiming_e72dcdbb } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function setAutoClaiming( - address[] _executors, - bool _enableDelegationAccount -) external payable; -``` - -Sets the addresses of executors and optionally enables (creates) a -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA). - -If any of the executors is a registered executor, some fee needs to be paid. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executors` | `address[]` | The new executors. All old executors will be deleted and replaced by these. | -| `_enableDelegationAccount` | `bool` | Whether the PDA should be enabled. | - -
-
- -
- -### `setClaimExecutors` { #fn_setclaimexecutors_9119c494 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function setClaimExecutors( - address[] _executors -) external payable; -``` - -Sets the addresses of executors. - -If any of the executors is a registered executor, some fee needs to be paid. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executors` | `address[]` | The new executors. All old executors will be deleted and replaced by these. | - -
-
- -
- -### `transferExternalToken` { #fn_transferexternaltoken_489a8a47 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function transferExternalToken( - contract IERC20 _token, - uint256 _amount -) external; -``` - -Allows the caller to transfer ERC-20 tokens from their -[PDA](https://docs.flare.network/tech/personal-delegation-account) to the owner account. - -The main use case is to move ERC-20 tokes received by mistake (by an airdrop, for example) out of the PDA -and into the main account, where they can be more easily managed. - -Reverts if the target token is the [`WNat`](./WNat.md) contract: use method [`withdraw`](#fn_withdraw_2e1a7d4d) for that. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_token` | `contract IERC20` | Target token contract address. | -| `_amount` | `uint256` | Amount of tokens to transfer. | - -
-
- -
- -### `undelegateAll` { #fn_undelegateall_b302f393 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function undelegateAll( -) external; -``` - -Removes all delegations from the caller's [PDA](https://docs.flare.network/tech/personal-delegation-account). - -
-
- -
- -### `undelegateGovernance` { #fn_undelegategovernance_87a2a0dc } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function undelegateGovernance( -) external; -``` - -Undelegates all [governance](https://docs.flare.network/tech/governance/) vote power currently delegated by -the caller's [PDA](https://docs.flare.network/tech/personal-delegation-account). - -
-
- -
- -### `unregisterExecutor` { #fn_unregisterexecutor_868a660f } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function unregisterExecutor( -) external returns ( - uint256); -``` - -Unregisters the caller as an executor. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID when the change becomes effective. | -
-
- -
- -### `updateExecutorFeeValue` { #fn_updateexecutorfeevalue_831f16af } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function updateExecutorFeeValue( - uint256 _feeValue -) external returns ( - uint256); -``` - -Sets the caller's executor fee. The caller must be an executor registered through [`registerExecutor`](#fn_registerexecutor_ccce7e86). - -When called multiple times inside the same reward epoch, only the last value remains. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_feeValue` | `uint256` | Desired fee, in wei. Must be between `minFeeValueWei` and `maxFeeValueWei`. 0 means no fee. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID when the changes become effective. | -
-
- -
- -### `withdraw` { #fn_withdraw_2e1a7d4d } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function withdraw( - uint256 _amount -) external; -``` - -Allows the caller to transfer [`WNat`](./WNat.md) wrapped tokens from their -[PDA](https://docs.flare.network/tech/personal-delegation-account) to the owner account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_amount` | `uint256` | Amount of tokens to transfer, in wei. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IConfirmedBlockHeightExistsVerification.md b/docs/apis/smart-contracts/IConfirmedBlockHeightExistsVerification.md deleted file mode 100644 index d0d4deb89..000000000 --- a/docs/apis/smart-contracts/IConfirmedBlockHeightExistsVerification.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: IConfirmedBlockHeightExistsVerification -search: - boost: 0.5 ---- - - - -# `IConfirmedBlockHeightExistsVerification` { #ct_iconfirmedblockheightexistsverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IConfirmedBlockHeightExistsVerification.sol) -
- -
- -Interface for verifying [`ConfirmedBlockHeightExists`](../attestation-types/ConfirmedBlockHeightExists.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This interface can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `verifyConfirmedBlockHeightExists` { #fn_verifyconfirmedblockheightexists_5e30ebfb } - -
-Defined in `IConfirmedBlockHeightExistsVerification` ([Docs](./IConfirmedBlockHeightExistsVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IConfirmedBlockHeightExistsVerification.sol)). -
- -
- -```solidity -function verifyConfirmedBlockHeightExists( - struct ConfirmedBlockHeightExists.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`ConfirmedBlockHeightExists`](../attestation-types/ConfirmedBlockHeightExists.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct ConfirmedBlockHeightExists.Proof` | The [`ConfirmedBlockHeightExists`](../attestation-types/ConfirmedBlockHeightExists.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IEVMTransactionVerification.md b/docs/apis/smart-contracts/IEVMTransactionVerification.md deleted file mode 100644 index d056ffcdc..000000000 --- a/docs/apis/smart-contracts/IEVMTransactionVerification.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: IEVMTransactionVerification -search: - boost: 0.5 ---- - - - -# `IEVMTransactionVerification` { #ct_ievmtransactionverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IEVMTransactionVerification.sol) -
- -
- -Interface for verifying [`EVMTransaction`](../attestation-types/EVMTransaction.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This interface can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `verifyEVMTransaction` { #fn_verifyevmtransaction_58fbe9e1 } - -
-Defined in `IEVMTransactionVerification` ([Docs](./IEVMTransactionVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IEVMTransactionVerification.sol)). -
- -
- -```solidity -function verifyEVMTransaction( - struct EVMTransaction.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`EVMTransaction`](../attestation-types/EVMTransaction.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct EVMTransaction.Proof` | The [`EVMTransaction`](../attestation-types/EVMTransaction.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IFlareContractRegistry.md b/docs/apis/smart-contracts/IFlareContractRegistry.md deleted file mode 100644 index ae925f02f..000000000 --- a/docs/apis/smart-contracts/IFlareContractRegistry.md +++ /dev/null @@ -1,170 +0,0 @@ ---- -title: IFlareContractRegistry -search: - boost: 0.5 ---- - - - -# `IFlareContractRegistry` { #ct_iflarecontractregistry } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFlareContractRegistry.sol) -
- -
- -Interface for the [`FlareContractRegistry`](./FlareContractRegistry.md). - -Entry point for all external dapps that need the latest contract addresses deployed by Flare. - -
- -
- -## Functions - -
- -### `getAllContracts` { #fn_getallcontracts_18d3ce96 } - -
-Defined in `IFlareContractRegistry` ([Docs](./IFlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFlareContractRegistry.sol)). -
- -
- -```solidity -function getAllContracts( -) external view returns ( - string[] _names, - address[] _addresses); -``` - -Returns all contract names and their corresponding addresses. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_names` | `string[]` | Array of contract names. | -| `_addresses` | `address[]` | Array of corresponding contract addresses. | -
-
- -
- -### `getContractAddressByHash` { #fn_getcontractaddressbyhash_159354a2 } - -
-Defined in `IFlareContractRegistry` ([Docs](./IFlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFlareContractRegistry.sol)). -
- -
- -```solidity -function getContractAddressByHash( - bytes32 _nameHash -) external view returns ( - address); -``` - -Returns the address of a given contract hash. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nameHash` | `bytes32` | Hash of the contract name as: `keccak256(abi.encode(name))`. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address of the contract, or `address(0)` if not found. | -
-
- -
- -### `getContractAddressByName` { #fn_getcontractaddressbyname_82760fca } - -
-Defined in `IFlareContractRegistry` ([Docs](./IFlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFlareContractRegistry.sol)). -
- -
- -```solidity -function getContractAddressByName( - string _name -) external view returns ( - address); -``` - -Returns the address of a given contract name. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_name` | `string` | Name of the contract. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address of the contract, or `address(0)` if not found. | -
-
- -
- -### `getContractAddressesByHash` { #fn_getcontractaddressesbyhash_5e11e2d1 } - -
-Defined in `IFlareContractRegistry` ([Docs](./IFlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFlareContractRegistry.sol)). -
- -
- -```solidity -function getContractAddressesByHash( - bytes32[] _nameHashes -) external view returns ( - address[]); -``` - -Returns the addresses of a list of contract hashes. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nameHashes` | `bytes32[]` | Array of contract name hashes as: `keccak256(abi.encode(name))`. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Array of addresses of the contracts. Any of them might be `address(0)` if not found. | -
-
- -
- -### `getContractAddressesByName` { #fn_getcontractaddressesbyname_76d2b1af } - -
-Defined in `IFlareContractRegistry` ([Docs](./IFlareContractRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFlareContractRegistry.sol)). -
- -
- -```solidity -function getContractAddressesByName( - string[] _names -) external view returns ( - address[]); -``` - -Returns the addresses of a list of contract names. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_names` | `string[]` | Array of contract names. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Array of addresses of the contracts. Any of them might be `address(0)` if not found. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IFlareDaemonize.md b/docs/apis/smart-contracts/IFlareDaemonize.md deleted file mode 100644 index 40fcfc576..000000000 --- a/docs/apis/smart-contracts/IFlareDaemonize.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: IFlareDaemonize -search: - boost: 0.5 ---- - - - -# `IFlareDaemonize` { #ct_iflaredaemonize } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFlareDaemonize.sol) -
- -
- -Interface for contracts that receive triggers from the [`FlareDaemon`](./FlareDaemon.md) contract. - -
- -
- -## Functions - -
- -### `daemonize` { #fn_daemonize_6d0e8c34 } - -
-Defined in `IFlareDaemonize` ([Docs](./IFlareDaemonize.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFlareDaemonize.sol)). -
- -
- -```solidity -function daemonize( -) external returns ( - bool); -``` - -Implement this function to receive a trigger from the [`FlareDaemon`](./FlareDaemon.md). -The trigger method is called by the validator right at the end of block state transition. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | bool Whether the contract is still active after the call. Currently unused. | -
-
- -
- -### `getContractName` { #fn_getcontractname_f5f5ba72 } - -
-Defined in `IFlareDaemonize` ([Docs](./IFlareDaemonize.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFlareDaemonize.sol)). -
- -
- -```solidity -function getContractName( -) external view returns ( - string); -``` - -Implement this function to allow updating daemonized contracts through the [`AddressUpdater`](./AddressUpdater.md). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `string` | string Contract name. | -
-
- -
- -### `switchToFallbackMode` { #fn_switchtofallbackmode_e22fdece } - -
-Defined in `IFlareDaemonize` ([Docs](./IFlareDaemonize.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFlareDaemonize.sol)). -
- -
- -```solidity -function switchToFallbackMode( -) external returns ( - bool); -``` - -This function will be called after an error is caught in [`daemonize`](#fn_daemonize_6d0e8c34). -It will switch the contract to a simpler fallback mode, which hopefully works when full mode doesn't. -Not every contract needs to support fallback mode ([`FtsoManager`](./FtsoManager.md) does), so this method may be empty. -Switching back to normal mode is left to the contract (typically a governed method call). -This function may be called due to low-gas error, so it shouldn't use more than ~30.000 gas. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | True if switched to fallback mode, false if already in fallback mode or if fallback mode is not supported. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IFtso.md b/docs/apis/smart-contracts/IFtso.md deleted file mode 100644 index 54ad15e76..000000000 --- a/docs/apis/smart-contracts/IFtso.md +++ /dev/null @@ -1,626 +0,0 @@ ---- -title: IFtso -search: - boost: 0.5 ---- - - - -# `IFtso` { #ct_iftso } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol) -
- -
- -Interface for each of the FTSO contracts that handles an asset. -Read the [FTSO documentation page](https://docs.flare.network/tech/ftso/) -for general information about the FTSO system. - -
- -
- -## Enums - -
- -### `PriceFinalizationType` { #en_pricefinalizationtype } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -
-```solidity -enum PriceFinalizationType { - NOT_FINALIZED, - WEIGHTED_MEDIAN, - TRUSTED_ADDRESSES, - PREVIOUS_PRICE_COPIED, - TRUSTED_ADDRESSES_EXCEPTION, - PREVIOUS_PRICE_COPIED_EXCEPTION -} -``` - -How did a price epoch finalize. - -* `NOT_FINALIZED`: The epoch has not been finalized yet. This is the initial state. -* `WEIGHTED_MEDIAN`: The median was used to calculate the final price. - This is the most common state in normal operation. -* `TRUSTED_ADDRESSES`: Due to low turnout, the final price was calculated using only - the median of trusted addresses. -* `PREVIOUS_PRICE_COPIED`: Due to low turnout and absence of votes from trusted addresses, - the final price was copied from the previous epoch. -* `TRUSTED_ADDRESSES_EXCEPTION`: Due to an exception, the final price was calculated - using only the median of trusted addresses. -* `PREVIOUS_PRICE_COPIED_EXCEPTION`: Due to an exception, the final price was copied - from the previous epoch. - -
- -
- -
- -## Events - -
- -### `LowTurnout` { #ev_lowturnout } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -event LowTurnout( - uint256 epochId, - uint256 natTurnout, - uint256 lowNatTurnoutThresholdBIPS, - uint256 timestamp -) -``` - -Not enough votes were received for this asset during a price epoch that has just ended. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `epochId` | `uint256` | The ID of the epoch. | -| `natTurnout` | `uint256` | Total received vote power, as a percentage of the circulating supply in BIPS. | -| `lowNatTurnoutThresholdBIPS` | `uint256` | Minimum required vote power, as a percentage of the circulating supply in BIPS. The fact that this number is higher than `natTurnout` is what triggered this event. | -| `timestamp` | `uint256` | Timestamp of the block where the price epoch ended. | - -
-
- -
- -### `PriceEpochInitializedOnFtso` { #ev_priceepochinitializedonftso } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -event PriceEpochInitializedOnFtso( - uint256 epochId, - uint256 endTime, - uint256 timestamp -) -``` - -All necessary parameters have been set for an epoch and prices can start being _revealed_. -Note that prices can already be _submitted_ immediately after the previous price epoch submit end time is over. - -This event is not emitted in fallback mode (see [`getPriceEpochData`](#fn_getpriceepochdata_e3b3a3b3)). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `epochId` | `uint256` | The ID of the epoch that has just started. | -| `endTime` | `uint256` | Deadline to submit prices, in seconds since UNIX epoch. | -| `timestamp` | `uint256` | Current on-chain timestamp. | - -
-
- -
- -### `PriceFinalized` { #ev_pricefinalized } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -event PriceFinalized( - uint256 epochId, - uint256 price, - bool rewardedFtso, - uint256 lowIQRRewardPrice, - uint256 highIQRRewardPrice, - uint256 lowElasticBandRewardPrice, - uint256 highElasticBandRewardPrice, - enum IFtso.PriceFinalizationType finalizationType, - uint256 timestamp -) -``` - -An epoch has ended and the asset price is available. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `epochId` | `uint256` | The ID of the epoch that has just ended. | -| `price` | `uint256` | The asset's price for that epoch. | -| `rewardedFtso` | `bool` | Whether the next 4 parameters contain data. | -| `lowIQRRewardPrice` | `uint256` | Lowest price in the primary (inter-quartile) reward band. | -| `highIQRRewardPrice` | `uint256` | Highest price in the primary (inter-quartile) reward band. | -| `lowElasticBandRewardPrice` | `uint256` | Lowest price in the secondary (elastic) reward band. | -| `highElasticBandRewardPrice` | `uint256` | Highest price in the secondary (elastic) reward band. | -| `finalizationType` | `enum IFtso.PriceFinalizationType` | Reason for the finalization of the epoch. | -| `timestamp` | `uint256` | Timestamp of the block where the price has been finalized. | - -
-
- -
- -### `PriceRevealed` { #ev_pricerevealed } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -event PriceRevealed( - address voter, - uint256 epochId, - uint256 price, - uint256 timestamp, - uint256 votePowerNat, - uint256 votePowerAsset -) -``` - -A voter has revealed its price. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `voter` | `address` | The voter. | -| `epochId` | `uint256` | The ID of the epoch for which the price has been revealed. | -| `price` | `uint256` | The revealed price. | -| `timestamp` | `uint256` | Timestamp of the block where the reveal happened. | -| `votePowerNat` | `uint256` | Vote power of the voter in this epoch. This includes the vote power derived from its [`WNat`](./WNat.md) holdings and the delegations. | -| `votePowerAsset` | `uint256` | _Unused_. | - -
-
- -
- -
- -## Functions - -
- -### `active` { #fn_active_02fb0c5e } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function active( -) external view returns ( - bool); -``` - -Returns whether FTSO is [`active`](#fn_active_02fb0c5e) or not. - -
-
- -
- -### `getCurrentEpochId` { #fn_getcurrentepochid_a29a839f } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentEpochId( -) external view returns ( - uint256); -``` - -Returns the current epoch ID. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Currently running epoch ID. IDs are consecutive numbers starting from zero. | -
-
- -
- -### `getCurrentPrice` { #fn_getcurrentprice_eb91d37e } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentPrice( -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Returns the current asset price. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -
-
- -
- -### `getCurrentPriceDetails` { #fn_getcurrentpricedetails_040d73b8 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentPriceDetails( -) external view returns ( - uint256 _price, - uint256 _priceTimestamp, - enum IFtso.PriceFinalizationType _priceFinalizationType, - uint256 _lastPriceEpochFinalizationTimestamp, - enum IFtso.PriceFinalizationType _lastPriceEpochFinalizationType); -``` - -Returns asset's current price details. -All timestamps are in seconds from UNIX epoch. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_priceTimestamp` | `uint256` | Time when price was updated for the last time. | -| `_priceFinalizationType` | `enum IFtso.PriceFinalizationType` | Finalization type when price was updated for the last time. | -| `_lastPriceEpochFinalizationTimestamp` | `uint256` | Time when last price epoch was finalized. | -| `_lastPriceEpochFinalizationType` | `enum IFtso.PriceFinalizationType` | Finalization type of last finalized price epoch. | -
-
- -
- -### `getCurrentPriceFromTrustedProviders` { #fn_getcurrentpricefromtrustedproviders_af52df08 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentPriceFromTrustedProviders( -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Returns current asset price calculated only using input from trusted providers. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -
-
- -
- -### `getCurrentPriceWithDecimals` { #fn_getcurrentpricewithdecimals_65f5cd86 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimals( -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Returns current asset price and number of decimals. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`_assetPriceUsdDecimals`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the USD price. | -
-
- -
- -### `getCurrentPriceWithDecimalsFromTrustedProviders` { #fn_getcurrentpricewithdecimalsfromtrustedproviders_3cacb3ae } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimalsFromTrustedProviders( -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Returns current asset price calculated only using input from trusted providers and number of decimals. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the USD price. | -
-
- -
- -### `getCurrentRandom` { #fn_getcurrentrandom_d89601fd } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentRandom( -) external view returns ( - uint256); -``` - -Returns the random number for the previous price epoch, obtained from the random numbers -provided by all data providers along with their data submissions. - -
-
- -
- -### `getEpochId` { #fn_getepochid_5303548b } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getEpochId( - uint256 _timestamp -) external view returns ( - uint256); -``` - -Returns the ID of the epoch that was opened for price submission at the specified timestamp. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_timestamp` | `uint256` | Queried timestamp in seconds from UNIX epoch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Epoch ID corresponding to that timestamp. IDs are consecutive numbers starting from zero. | -
-
- -
- -### `getEpochPrice` { #fn_getepochprice_7d1d6f12 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getEpochPrice( - uint256 _epochId -) external view returns ( - uint256); -``` - -Returns agreed asset price in the specified epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch. Only the last 200 epochs can be queried. Out-of-bounds queries revert. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -
-
- -
- -### `getEpochPriceForVoter` { #fn_getepochpriceforvoter_c5d8b9e7 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getEpochPriceForVoter( - uint256 _epochId, - address _voter -) external view returns ( - uint256); -``` - -Returns asset price submitted by a voter in the specified epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch being queried. Only the last 200 epochs can be queried. Out-of-bounds queries revert. | -| `_voter` | `address` | Address of the voter being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -
-
- -
- -### `getPriceEpochConfiguration` { #fn_getpriceepochconfiguration_144e1591 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getPriceEpochConfiguration( -) external view returns ( - uint256 _firstEpochStartTs, - uint256 _submitPeriodSeconds, - uint256 _revealPeriodSeconds); -``` - -Returns current epoch's configuration. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_firstEpochStartTs` | `uint256` | First epoch start timestamp in seconds from UNIX epoch. | -| `_submitPeriodSeconds` | `uint256` | Submit period in seconds. | -| `_revealPeriodSeconds` | `uint256` | Reveal period in seconds. | -
-
- -
- -### `getPriceEpochData` { #fn_getpriceepochdata_e3b3a3b3 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getPriceEpochData( -) external view returns ( - uint256 _epochId, - uint256 _epochSubmitEndTime, - uint256 _epochRevealEndTime, - uint256 _votePowerBlock, - bool _fallbackMode); -``` - -Returns current epoch data. -Intervals are open on the right: End times are not included. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_epochId` | `uint256` | Current epoch ID. | -| `_epochSubmitEndTime` | `uint256` | End time of the price submission window in seconds from UNIX epoch. | -| `_epochRevealEndTime` | `uint256` | End time of the price reveal window in seconds from UNIX epoch. | -| `_votePowerBlock` | `uint256` | Vote power block for the current epoch. | -| `_fallbackMode` | `bool` | Whether the current epoch is in fallback mode. Only votes from trusted addresses are used in this mode. | -
-
- -
- -### `getRandom` { #fn_getrandom_cd4b6914 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getRandom( - uint256 _epochId -) external view returns ( - uint256); -``` - -Returns the random number used in a specific past epoch, obtained from the random numbers -provided by all data providers along with their data submissions. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the queried epoch. Current epoch cannot be queried, and the previous epoch is constantly updated as data providers reveal their prices and random numbers. Only the last 50 epochs can be queried and there is no bounds checking for this parameter. Out-of-bounds queries return undefined values. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The random number used in that epoch. | -
-
- -
- -### `symbol` { #fn_symbol_95d89b41 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function symbol( -) external view returns ( - string); -``` - -Returns the FTSO [`symbol`](#fn_symbol_95d89b41). - -
-
- -
- diff --git a/docs/apis/smart-contracts/IFtsoGenesis.md b/docs/apis/smart-contracts/IFtsoGenesis.md deleted file mode 100644 index 51ae78fed..000000000 --- a/docs/apis/smart-contracts/IFtsoGenesis.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: IFtsoGenesis -search: - boost: 0.5 ---- - - - -# `IFtsoGenesis` { #ct_iftsogenesis } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoGenesis.sol) -
- -
- -Portion of the [`IFtso`](./IFtso.md) interface that is available to contracts deployed at genesis. - -
- -
- -## Functions - -
- -### `revealPriceSubmitter` { #fn_revealpricesubmitter_c1f6c36e } - -
-Defined in `IFtsoGenesis` ([Docs](./IFtsoGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoGenesis.sol)). -
- -
- -```solidity -function revealPriceSubmitter( - address _voter, - uint256 _epochId, - uint256 _price, - uint256 _voterWNatVP -) external; -``` - -Reveals the price submitted by a voter on a specific epoch. -The hash of _price and _random must be equal to the submitted hash - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Voter address. | -| `_epochId` | `uint256` | ID of the epoch in which the price hash was submitted. | -| `_price` | `uint256` | Submitted price. | -| `_voterWNatVP` | `uint256` | Voter's vote power in [`WNat`](./WNat.md) units. | - -
-
- -
- -### `wNatVotePowerCached` { #fn_wnatvotepowercached_f72cab28 } - -
-Defined in `IFtsoGenesis` ([Docs](./IFtsoGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoGenesis.sol)). -
- -
- -```solidity -function wNatVotePowerCached( - address _voter, - uint256 _epochId -) external returns ( - uint256); -``` - -Get and cache the vote power of a voter on a specific epoch, in [`WNat`](./WNat.md) units. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Voter address. | -| `_epochId` | `uint256` | ID of the epoch in which the price hash was submitted. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Voter's vote power in [`WNat`](./WNat.md) units. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IFtsoManager.md b/docs/apis/smart-contracts/IFtsoManager.md deleted file mode 100644 index ecc1ccdcd..000000000 --- a/docs/apis/smart-contracts/IFtsoManager.md +++ /dev/null @@ -1,595 +0,0 @@ ---- -title: IFtsoManager -search: - boost: 0.5 ---- - - - -# `IFtsoManager` { #ct_iftsomanager } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol) | Inherits from [IFtsoManagerGenesis](./IFtsoManagerGenesis.md) -
- -
- -Interface for the [`FtsoManager`](./FtsoManager.md) contract. - -
- -
- -## Events - -
- -### `AccruingUnearnedRewardsFailed` { #ev_accruingunearnedrewardsfailed } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event AccruingUnearnedRewardsFailed( - uint256 epochId -) -``` - -Unexpected failure while accruing unearned rewards. -This should be a rare occurrence. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `epochId` | `uint256` | Epoch ID of the failure. | - -
-
- -
- -### `DistributingRewardsFailed` { #ev_distributingrewardsfailed } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event DistributingRewardsFailed( - address ftso, - uint256 epochId -) -``` - -Unexpected failure while distributing rewards. -This should be a rare occurrence. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `address` | Contract address of the FTSO where the failure happened. | -| `epochId` | `uint256` | Epoch ID of the failure. | - -
-
- -
- -### `FallbackMode` { #ev_fallbackmode } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event FallbackMode( - bool fallbackMode -) -``` - -Emitted when the fallback mode of the FTSO manager changes its state. -Fallback mode is a recovery mode, where only data from a trusted subset of FTSO -data providers is used to calculate the final price. - -The FTSO Manager enters the fallback mode when ALL FTSOs are in fallback mode. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `fallbackMode` | `bool` | New state of the FTSO Manager fallback mode. | - -
-
- -
- -### `FinalizingPriceEpochFailed` { #ev_finalizingpriceepochfailed } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event FinalizingPriceEpochFailed( - contract IIFtso ftso, - uint256 epochId, - enum IFtso.PriceFinalizationType failingType -) -``` - -Unexpected failure while finalizing a price epoch. -This should be a rare occurrence. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `contract IIFtso` | Contract address of the FTSO where the failure happened. | -| `epochId` | `uint256` | Epoch ID of the failure. | -| `failingType` | `enum IFtso.PriceFinalizationType` | How was the epoch finalized. | - -
-
- -
- -### `FtsoAdded` { #ev_ftsoadded } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event FtsoAdded( - contract IIFtso ftso, - bool add -) -``` - -Emitted when a new FTSO has been added or an existing one has been removed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `contract IIFtso` | Contract address of the FTSO. | -| `add` | `bool` | True if added, removed otherwise. | - -
-
- -
- -### `FtsoFallbackMode` { #ev_ftsofallbackmode } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event FtsoFallbackMode( - contract IIFtso ftso, - bool fallbackMode -) -``` - -Emitted when the fallback mode of an FTSO changes its state. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `contract IIFtso` | Contract address of the FTSO. | -| `fallbackMode` | `bool` | New state of its fallback mode. | - -
-
- -
- -### `InitializingCurrentEpochStateForRevealFailed` { #ev_initializingcurrentepochstateforrevealfailed } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event InitializingCurrentEpochStateForRevealFailed( - contract IIFtso ftso, - uint256 epochId -) -``` - -Unexpected failure while initializing a price epoch. -This should be a rare occurrence. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `contract IIFtso` | Contract address of the FTSO where the failure happened. | -| `epochId` | `uint256` | Epoch ID that failed initialization. | - -
-
- -
- -### `PriceEpochFinalized` { #ev_priceepochfinalized } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event PriceEpochFinalized( - address chosenFtso, - uint256 rewardEpochId -) -``` - -Emitted when a [price epoch](https://docs.flare.network/tech/ftso/#procedure-overview) ends, this is, -after the reveal phase, when final prices are calculated. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `chosenFtso` | `address` | Contract address of the FTSO asset that was randomly chosen to be the basis for reward calculation. On this price epoch, rewards will be calculated based on how close each data provider was to the median of all submitted prices FOR THIS FTSO. | -| `rewardEpochId` | `uint256` | Reward epoch ID this price epoch belongs to. | - -
-
- -
- -### `RewardEpochFinalized` { #ev_rewardepochfinalized } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event RewardEpochFinalized( - uint256 votepowerBlock, - uint256 startBlock -) -``` - -Emitted when a [reward epoch](https://docs.flare.network/tech/ftso/#procedure-overview) -ends and rewards are available. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `votepowerBlock` | `uint256` | The [vote power block](https://docs.flare.network/tech/ftso/#vote-power) of the epoch. | -| `startBlock` | `uint256` | The first block of the epoch. | - -
-
- -
- -### `UseGoodRandomSet` { #ev_usegoodrandomset } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event UseGoodRandomSet( - bool useGoodRandom, - uint256 maxWaitForGoodRandomSeconds -) -``` - -Emitted when the requirement to provide good random numbers has changed. - -As part of [the FTSO protocol](https://docs.flare.network/tech/ftso/#data-submission-process), -data providers must submit a random number along with their price reveals. -When good random numbers are enforced, all providers that submit a hash must then -submit a reveal with a random number or they will be punished. -This is a measure against random number manipulation. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `useGoodRandom` | `bool` | Whether good random numbers are now enforced or not. | -| `maxWaitForGoodRandomSeconds` | `uint256` | Max number of seconds to wait for a good random number to be submitted. | - -
-
- -
- -
- -## Functions - -
- -### `active` { #fn_active_02fb0c5e } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function active( -) external view returns ( - bool); -``` - -Returns whether the FTSO Manager is [`active`](#fn_active_02fb0c5e) or not. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | bool Active status. | -
-
- -
- -### `getCurrentPriceEpochData` { #fn_getcurrentpriceepochdata_93a79025 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getCurrentPriceEpochData( -) external view returns ( - uint256 _priceEpochId, - uint256 _priceEpochStartTimestamp, - uint256 _priceEpochEndTimestamp, - uint256 _priceEpochRevealEndTimestamp, - uint256 _currentTimestamp); -``` - -Returns timing information for the current price epoch. -All intervals are half-closed: end time is not included. -All timestamps are in seconds since UNIX epoch. - -See the [FTSO page](https://docs.flare.network/tech/ftso/#data-submission-process) -for information about the different submission phases. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_priceEpochId` | `uint256` | Price epoch ID. | -| `_priceEpochStartTimestamp` | `uint256` | Beginning of the commit phase. | -| `_priceEpochEndTimestamp` | `uint256` | End of the commit phase. | -| `_priceEpochRevealEndTimestamp` | `uint256` | End of the reveal phase. | -| `_currentTimestamp` | `uint256` | Current time. | -
-
- -
- -### `getCurrentPriceEpochId` { #fn_getcurrentpriceepochid_08a7f402 } - -
-Defined in `IFtsoManagerGenesis` ([Docs](./IFtsoManagerGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoManagerGenesis.sol)). -
- -
- -```solidity -function getCurrentPriceEpochId( -) external view returns ( - uint256 _priceEpochId); -``` - -Returns current price epoch ID. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_priceEpochId` | `uint256` | Currently running epoch ID. IDs are consecutive numbers starting from zero. | -
-
- -
- -### `getCurrentRewardEpoch` { #fn_getcurrentrewardepoch_e7c830d4 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getCurrentRewardEpoch( -) external view returns ( - uint256); -``` - -Returns current reward epoch ID (the one currently running). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID. A monotonically increasing integer. | -
-
- -
- -### `getFallbackMode` { #fn_getfallbackmode_4b48dd5e } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getFallbackMode( -) external view returns ( - bool _fallbackMode, - contract IIFtso[] _ftsos, - bool[] _ftsoInFallbackMode); -``` - -Returns whether the FTSO Manager is currently in fallback mode. - -In this mode only submissions from trusted providers are used. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_fallbackMode` | `bool` | True if fallback mode is enabled for the manager. | -| `_ftsos` | `contract IIFtso[]` | Array of all currently active FTSO assets. | -| `_ftsoInFallbackMode` | `bool[]` | Boolean array indicating which FTSO assets are in fallback mode. If the FTSO Manager is in fallback mode then ALL FTSOs are in fallback mode. | -
-
- -
- -### `getFtsos` { #fn_getftsos_ce69f833 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getFtsos( -) external view returns ( - contract IIFtso[] _ftsos); -``` - -Returns the list of currently [`active`](#fn_active_02fb0c5e) FTSOs. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IIFtso[]` | Array of contract addresses for the FTSOs. | -
-
- -
- -### `getPriceEpochConfiguration` { #fn_getpriceepochconfiguration_144e1591 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getPriceEpochConfiguration( -) external view returns ( - uint256 _firstPriceEpochStartTs, - uint256 _priceEpochDurationSeconds, - uint256 _revealEpochDurationSeconds); -``` - -Returns the current values for price epoch timing configuration. - -See the [FTSO page](https://docs.flare.network/tech/ftso/#data-submission-process) -for information about the different submission phases. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_firstPriceEpochStartTs` | `uint256` | Timestamp, in seconds since UNIX epoch, of the first price epoch. | -| `_priceEpochDurationSeconds` | `uint256` | Duration in seconds of the commit phase. | -| `_revealEpochDurationSeconds` | `uint256` | Duration in seconds of the reveal phase. | -
-
- -
- -### `getRewardEpochConfiguration` { #fn_getrewardepochconfiguration_1cb513f7 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochConfiguration( -) external view returns ( - uint256 _firstRewardEpochStartTs, - uint256 _rewardEpochDurationSeconds); -``` - -Returns the current values for reward epoch timing configuration. - -See the [Reward epochs](https://docs.flare.network/tech/ftso/#vote-power) box. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_firstRewardEpochStartTs` | `uint256` | Timestamp, in seconds since UNIX epoch, of the first reward epoch. | -| `_rewardEpochDurationSeconds` | `uint256` | Duration in seconds of the reward epochs. | -
-
- -
- -### `getRewardEpochToExpireNext` { #fn_getrewardepochtoexpirenext_3e7ff857 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochToExpireNext( -) external view returns ( - uint256); -``` - -Return reward epoch that will expire next, when a new reward epoch is initialized. - -Reward epochs older than 90 days expire, and any unclaimed rewards in them become -inaccessible. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Reward epoch ID. | -
-
- -
- -### `getRewardEpochVotePowerBlock` { #fn_getrewardepochvotepowerblock_f2edab5a } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochVotePowerBlock( - uint256 _rewardEpoch -) external view returns ( - uint256); -``` - -Returns the [vote power block](https://docs.flare.network/tech/ftso/#vote-power) -that was used for a past reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | The queried reward epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 The block number of that reward epoch's vote power block. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IFtsoManagerGenesis.md b/docs/apis/smart-contracts/IFtsoManagerGenesis.md deleted file mode 100644 index bf0d94fe0..000000000 --- a/docs/apis/smart-contracts/IFtsoManagerGenesis.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: IFtsoManagerGenesis -search: - boost: 0.5 ---- - - - -# `IFtsoManagerGenesis` { #ct_iftsomanagergenesis } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoManagerGenesis.sol) -
- -
- -Portion of the [`IFtsoManager`](./IFtsoManager.md) interface that is available to contracts deployed at genesis. - -
- -
- -## Functions - -
- -### `getCurrentPriceEpochId` { #fn_getcurrentpriceepochid_08a7f402 } - -
-Defined in `IFtsoManagerGenesis` ([Docs](./IFtsoManagerGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoManagerGenesis.sol)). -
- -
- -```solidity -function getCurrentPriceEpochId( -) external view returns ( - uint256 _priceEpochId); -``` - -Returns current price epoch ID. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_priceEpochId` | `uint256` | Currently running epoch ID. IDs are consecutive numbers starting from zero. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IFtsoRegistry.md b/docs/apis/smart-contracts/IFtsoRegistry.md deleted file mode 100644 index be947911a..000000000 --- a/docs/apis/smart-contracts/IFtsoRegistry.md +++ /dev/null @@ -1,609 +0,0 @@ ---- -title: IFtsoRegistry -search: - boost: 0.5 ---- - - - -# `IFtsoRegistry` { #ct_iftsoregistry } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol) | Inherits from [IFtsoRegistryGenesis](./IFtsoRegistryGenesis.md) -
- -
- -Interface for the [`FtsoRegistry`](./FtsoRegistry.md) contract. - -
- -
- -## Functions - -
- -### `getAllCurrentPrices` { #fn_getallcurrentprices_58f9296f } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getAllCurrentPrices( -) external view returns ( - struct IFtsoRegistry.PriceInfo[]); -``` - -Returns the current price of all supported assets. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IFtsoRegistry.PriceInfo[]` | Array of `PriceInfo` structures. | -
-
- -
- -### `getCurrentPrice` { #fn_getcurrentprice_c55d0f56 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPrice( - uint256 _ftsoIndex -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Public view function to get the current price of a given active FTSO index. -Reverts if the index is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -
-
- -
- -### `getCurrentPrice` { #fn_getcurrentprice_42a0f243 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPrice( - string _symbol -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Public view function to get the current price of a given active asset symbol. -Reverts if the symbol is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Symbol to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -
-
- -
- -### `getCurrentPriceWithDecimals` { #fn_getcurrentpricewithdecimals_257cbd3a } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimals( - uint256 _assetIndex -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Public view function to get the current price and decimals of a given active FTSO index. -Reverts if the index is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_assetIndex` | `uint256` | Index to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`_assetPriceUsdDecimals`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the `_price`. | -
-
- -
- -### `getCurrentPriceWithDecimals` { #fn_getcurrentpricewithdecimals_a69afdc6 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimals( - string _symbol -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Public view function to get the current price and decimals of a given active asset symbol. -Reverts if the symbol is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Symbol to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`_assetPriceUsdDecimals`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the `_price`. | -
-
- -
- -### `getCurrentPricesByIndices` { #fn_getcurrentpricesbyindices_6ba31fa1 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPricesByIndices( - uint256[] _indices -) external view returns ( - struct IFtsoRegistry.PriceInfo[]); -``` - -Returns the current price of a list of indices. -Reverts if any of the indices is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_indices` | `uint256[]` | Array of indices to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IFtsoRegistry.PriceInfo[]` | Array of `PriceInfo` structures. | -
-
- -
- -### `getCurrentPricesBySymbols` { #fn_getcurrentpricesbysymbols_79d5ea4b } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPricesBySymbols( - string[] _symbols -) external view returns ( - struct IFtsoRegistry.PriceInfo[]); -``` - -Returns the current price of a list of asset symbols. -Reverts if any of the symbols is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbols` | `string[]` | Array of symbols to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IFtsoRegistry.PriceInfo[]` | Array of `PriceInfo` structures. | -
-
- -
- -### `getFtso` { #fn_getftso_d75f6d81 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getFtso( - uint256 _activeFtso -) external view returns ( - contract IIFtso _activeFtsoAddress); -``` - -Returns the address of the FTSO contract for a given index. -Reverts if unsupported index is passed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_activeFtso` | `uint256` | The queried index. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_activeFtsoAddress` | `contract IIFtso` | FTSO contract address for the queried index. | -
-
- -
- -### `getFtsoBySymbol` { #fn_getftsobysymbol_97da6af4 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getFtsoBySymbol( - string _symbol -) external view returns ( - contract IIFtso _activeFtsoAddress); -``` - -Returns the address of the FTSO contract for a given symbol. -Reverts if unsupported symbol is passed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | The queried symbol. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_activeFtsoAddress` | `contract IIFtso` | FTSO contract address for the queried symbol. | -
-
- -
- -### `getFtsoIndex` { #fn_getftsoindex_e848da30 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getFtsoIndex( - string _symbol -) external view returns ( - uint256 _assetIndex); -``` - -Returns the FTSO index corresponding to a given asset symbol. -Reverts if the symbol is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Symbol to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_assetIndex` | `uint256` | The corresponding asset index. | -
-
- -
- -### `getFtsoSymbol` { #fn_getftsosymbol_136d3f64 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getFtsoSymbol( - uint256 _ftsoIndex -) external view returns ( - string _symbol); -``` - -Returns the asset symbol corresponding to a given FTSO index. -Reverts if the index is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_symbol` | `string` | The corresponding asset symbol. | -
-
- -
- -### `getFtsos` { #fn_getftsos_9cb47538 } - -
-Defined in `IFtsoRegistryGenesis` ([Docs](./IFtsoRegistryGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoRegistryGenesis.sol)). -
- -
- -```solidity -function getFtsos( - uint256[] _indices -) external view returns ( - contract IFtsoGenesis[] _ftsos); -``` - -Get the addresses of the active FTSOs at the given indices. -Reverts if any of the provided indices is non-existing or inactive. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_indices` | `uint256[]` | Array of FTSO indices to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IFtsoGenesis[]` | The array of FTSO addresses. | -
-
- -
- -### `getSupportedFtsos` { #fn_getsupportedftsos_a40060ba } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedFtsos( -) external view returns ( - contract IIFtso[] _ftsos); -``` - -Get array of all FTSO contracts for all supported asset indices. -The index of FTSO in returned array does not necessarily correspond to the asset's index. -Due to deletion, some indices might be unsupported. - -Use [`getSupportedIndicesAndFtsos`](#fn_getsupportedindicesandftsos_06a2ba29) to retrieve pairs of correct indices and FTSOs, -where possible "null" holes are readily apparent. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSOs. | -
-
- -
- -### `getSupportedIndices` { #fn_getsupportedindices_798aac5b } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndices( -) external view returns ( - uint256[] _supportedIndices); -``` - -Returns the indices of the currently supported FTSOs. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all active FTSO indices in increasing order. | -
-
- -
- -### `getSupportedIndicesAndFtsos` { #fn_getsupportedindicesandftsos_06a2ba29 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndicesAndFtsos( -) external view returns ( - uint256[] _supportedIndices, - contract IIFtso[] _ftsos); -``` - -Get all supported indices and corresponding FTSO addresses. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all supported indices. | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSO addresses. | -
-
- -
- -### `getSupportedIndicesAndSymbols` { #fn_getsupportedindicesandsymbols_e68f283b } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndicesAndSymbols( -) external view returns ( - uint256[] _supportedIndices, - string[] _supportedSymbols); -``` - -Get all supported indices and corresponding symbols. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all supported indices. | -| `_supportedSymbols` | `string[]` | Array of all supported symbols. | -
-
- -
- -### `getSupportedIndicesSymbolsAndFtsos` { #fn_getsupportedindicessymbolsandftsos_7687542c } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndicesSymbolsAndFtsos( -) external view returns ( - uint256[] _supportedIndices, - string[] _supportedSymbols, - contract IIFtso[] _ftsos); -``` - -Get all supported indices, symbols, and corresponding FTSO addresses. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all supported indices. | -| `_supportedSymbols` | `string[]` | Array of all supported symbols. | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSO addresses. | -
-
- -
- -### `getSupportedSymbols` { #fn_getsupportedsymbols_ce1c0e4d } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedSymbols( -) external view returns ( - string[] _supportedSymbols); -``` - -Returns the symbols of the currently supported FTSOs. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedSymbols` | `string[]` | Array of all active FTSO symbols in increasing order. | -
-
- -
- -### `getSupportedSymbolsAndFtsos` { #fn_getsupportedsymbolsandftsos_0cf48497 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedSymbolsAndFtsos( -) external view returns ( - string[] _supportedSymbols, - contract IIFtso[] _ftsos); -``` - -Get all supported symbols and corresponding FTSO addresses. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedSymbols` | `string[]` | Array of all supported symbols. | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSO addresses. | -
-
- -
- -
- -## Structures - -
- -### `PriceInfo` { #st_priceinfo } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -
-```solidity -struct PriceInfo { - uint256 ftsoIndex; - uint256 price; - uint256 decimals; - uint256 timestamp; -} -``` - -
- -
- diff --git a/docs/apis/smart-contracts/IFtsoRegistryGenesis.md b/docs/apis/smart-contracts/IFtsoRegistryGenesis.md deleted file mode 100644 index 0ffb90066..000000000 --- a/docs/apis/smart-contracts/IFtsoRegistryGenesis.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: IFtsoRegistryGenesis -search: - boost: 0.5 ---- - - - -# `IFtsoRegistryGenesis` { #ct_iftsoregistrygenesis } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoRegistryGenesis.sol) -
- -
- -Portion of the [`IFtsoRegistry`](./IFtsoRegistry.md) interface that is available to contracts deployed at genesis. - -
- -
- -## Functions - -
- -### `getFtsos` { #fn_getftsos_9cb47538 } - -
-Defined in `IFtsoRegistryGenesis` ([Docs](./IFtsoRegistryGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoRegistryGenesis.sol)). -
- -
- -```solidity -function getFtsos( - uint256[] _indices -) external view returns ( - contract IFtsoGenesis[] _ftsos); -``` - -Get the addresses of the active FTSOs at the given indices. -Reverts if any of the provided indices is non-existing or inactive. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_indices` | `uint256[]` | Array of FTSO indices to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IFtsoGenesis[]` | The array of FTSO addresses. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IFtsoRewardManager.md b/docs/apis/smart-contracts/IFtsoRewardManager.md deleted file mode 100644 index ca8feae7f..000000000 --- a/docs/apis/smart-contracts/IFtsoRewardManager.md +++ /dev/null @@ -1,970 +0,0 @@ ---- -title: IFtsoRewardManager -search: - boost: 0.5 ---- - - - -# `IFtsoRewardManager` { #ct_iftsorewardmanager } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol) -
- -
- -Interface for the [`FtsoRewardManager`](./FtsoRewardManager.md) contract. - -
- -
- -## Events - -
- -### `FeePercentageChanged` { #ev_feepercentagechanged } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event FeePercentageChanged( - address dataProvider, - uint256 value, - uint256 validFromEpoch -) -``` - -Emitted when a data provider changes its fee. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `dataProvider` | `address` | Address of the data provider. | -| `value` | `uint256` | New fee, in BIPS. | -| `validFromEpoch` | `uint256` | Epoch ID where the new fee takes effect. | - -
-
- -
- -### `FtsoRewardManagerActivated` { #ev_ftsorewardmanageractivated } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event FtsoRewardManagerActivated( - address ftsoRewardManager -) -``` - -Emitted when the reward manager contract is activated. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftsoRewardManager` | `address` | The reward manager contract. | - -
-
- -
- -### `FtsoRewardManagerDeactivated` { #ev_ftsorewardmanagerdeactivated } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event FtsoRewardManagerDeactivated( - address ftsoRewardManager -) -``` - -Emitted when the reward manager contract is deactivated. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftsoRewardManager` | `address` | The reward manager contract. | - -
-
- -
- -### `RewardClaimed` { #ev_rewardclaimed } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event RewardClaimed( - address dataProvider, - address whoClaimed, - address sentTo, - uint256 rewardEpoch, - uint256 amount -) -``` - -Emitted when a data provider claims its FTSO rewards. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `dataProvider` | `address` | Address of the data provider that accrued the reward. | -| `whoClaimed` | `address` | Address that actually performed the claim. | -| `sentTo` | `address` | Address that received the reward. | -| `rewardEpoch` | `uint256` | ID of the reward epoch where the reward was accrued. | -| `amount` | `uint256` | Amount of rewarded native tokens (wei). | - -
-
- -
- -### `RewardClaimsEnabled` { #ev_rewardclaimsenabled } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event RewardClaimsEnabled( - uint256 rewardEpochId -) -``` - -Emitted when reward claims have been enabled. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `rewardEpochId` | `uint256` | First claimable reward epoch. | - -
-
- -
- -### `RewardClaimsExpired` { #ev_rewardclaimsexpired } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event RewardClaimsExpired( - uint256 rewardEpochId -) -``` - -Unclaimed rewards have expired and are now inaccessible. - -`getUnclaimedReward()` can be used to retrieve more information. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `rewardEpochId` | `uint256` | ID of the reward epoch that has just expired. | - -
-
- -
- -### `RewardsDistributed` { #ev_rewardsdistributed } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event RewardsDistributed( - address ftso, - uint256 epochId, - address[] addresses, - uint256[] rewards -) -``` - -Emitted every price epoch, when rewards have been distributed to each contributing data provider. -Note that rewards are not claimable until the reward epoch finishes. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `address` | Address of the FTSO that generated the rewards. | -| `epochId` | `uint256` | ID of the reward epoch where the rewards were accrued. | -| `addresses` | `address[]` | Data provider addresses that have rewards to claim. | -| `rewards` | `uint256[]` | Amounts available for claiming (wei). | - -
-
- -
- -### `UnearnedRewardsAccrued` { #ev_unearnedrewardsaccrued } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event UnearnedRewardsAccrued( - uint256 epochId, - uint256 reward -) -``` - -Emitted when rewards cannot be distributed during a reward epoch -(for example, because the FTSO went into fallback mode) and they are accrued -for later burning. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `epochId` | `uint256` | ID of the reward epoch where the reward was accrued. | -| `reward` | `uint256` | Total amount of accrued rewards (wei). | - -
-
- -
- -
- -## Functions - -
- -### `active` { #fn_active_02fb0c5e } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function active( -) external view returns ( - bool); -``` - -Whether rewards can be claimed from this reward manager. - -
-
- -
- -### `autoClaim` { #fn_autoclaim_8dc305fa } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function autoClaim( - address[] _rewardOwners, - uint256 _rewardEpoch -) external; -``` - -Allows claiming rewards simultaneously for a list of reward owners and all unclaimed epochs before the -specified one. - -This is meant as a convenience all-in-one reward claiming method to be used both by reward owners and -[registered executors](https://docs.flare.network/tech/automatic-claiming/#registered-claiming-process). -It performs a series of operations, besides claiming rewards: - -* If a reward owner has enabled its -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account), rewards are also -claimed for the PDA and the total claimed amount is sent to that PDA. -Otherwise, the claimed amount is sent to the reward owner's account. - -* Claimed amount is automatically wrapped through the [`WNat`](./WNat.md) contract. - -* If the caller is a registered executor with a non-zero fee, the fee is paid to the executor for each claimed -address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwners` | `address[]` | List of reward owners to claim for. | -| `_rewardEpoch` | `uint256` | Last reward epoch ID to claim for. All previous epochs with pending rewards will be claimed too. | - -
-
- -
- -### `claim` { #fn_claim_b2c12192 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function claim( - address _rewardOwner, - address payable _recipient, - uint256 _rewardEpoch, - bool _wrap -) external returns ( - uint256 _rewardAmount); -``` - -Allows the caller to [`claim`](#fn_claim_b2c12192) rewards for a reward owner. -The caller does not have to be the owner of the rewards, but must be approved by the owner to [`claim`](#fn_claim_b2c12192) on his -behalf by using `setClaimExecutors` on the `claimSetupManager`. - -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by percentage. -Reverts if `msg.sender` is delegating by amount. - -Anybody can call this method, but rewards can only be sent to the reward owner, therefore no funds can be -stolen. However, by limiting the authorized callers, the owner can control the timing of the calls. - -When the reward owner is the caller, rewards can be sent to any recipient set by `setAllowedClaimRecipients` on -the `claimSetupManager`. -The reward owner's [Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) -is always an authorized recipient. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | Address of the reward owner. | -| `_recipient` | `address payable` | Address to transfer claimed rewards to. | -| `_rewardEpoch` | `uint256` | Last reward epoch to claim for. All previous epochs with pending rewards will be claimed too. | -| `_wrap` | `bool` | Whether claimed rewards should be wrapped through the [`WNat`](./WNat.md) contract before transferring them to the `_recipient`. This parameter is offered as a convenience. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Total amount of claimed rewards (wei). | -
-
- -
- -### `claimFromDataProviders` { #fn_claimfromdataproviders_21bb25af } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function claimFromDataProviders( - address _rewardOwner, - address payable _recipient, - uint256[] _rewardEpochs, - address[] _dataProviders, - bool _wrap -) external returns ( - uint256 _rewardAmount); -``` - -Allows the caller to [`claim`](#fn_claim_b2c12192) rewards for a reward owner from specific data providers. -The caller does not have to be the owner of the rewards, but must be approved by the owner to [`claim`](#fn_claim_b2c12192) on his -behalf by using `setClaimExecutors` on the `claimSetupManager`. - -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by amount (explicit delegation). -Reverts if `msg.sender` is delegating by percentage. - -Anybody can call this method, but rewards can only be sent to the reward owner, therefore no funds can be -stolen. However, by limiting the authorized callers, the owner can control the timing of the calls. - -When the reward owner is the caller, rewards can be sent to any recipient set by `setAllowedClaimRecipients` on -the `claimSetupManager`. -The reward owner's [Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) -is always an authorized recipient. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | Address of the reward owner. | -| `_recipient` | `address payable` | Address to transfer claimed rewards to. | -| `_rewardEpochs` | `uint256[]` | Array of reward epoch IDs to claim for. | -| `_dataProviders` | `address[]` | Array of addresses of the data providers to claim the reward from. | -| `_wrap` | `bool` | Whether claimed rewards should be wrapped through the [`WNat`](./WNat.md) contract before transferring them to the `_recipient`. This parameter is offered as a convenience. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Total amount of claimed rewards (wei). | -
-
- -
- -### `claimReward` { #fn_claimreward_b2af870a } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function claimReward( - address payable _recipient, - uint256[] _rewardEpochs -) external returns ( - uint256 _rewardAmount); -``` - -Allows a percentage delegator to [`claim`](#fn_claim_b2c12192) rewards. -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by percentage. - -**This function is deprecated**: use [`claim`](#fn_claim_b2c12192) instead. - -Reverts if `msg.sender` is delegating by amount. -Claims for all unclaimed reward epochs to the 'max(_rewardEpochs)'. -Retained for backward compatibility. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipient` | `address payable` | Address to transfer funds to. | -| `_rewardEpochs` | `uint256[]` | Array of reward epoch numbers to claim for. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Amount of total claimed rewards (wei). | -
-
- -
- -### `claimRewardFromDataProviders` { #fn_claimrewardfromdataproviders_d20bb542 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function claimRewardFromDataProviders( - address payable _recipient, - uint256[] _rewardEpochs, - address[] _dataProviders -) external returns ( - uint256 _rewardAmount); -``` - -Allows the caller to [`claim`](#fn_claim_b2c12192) rewards from specific data providers. -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by amount. - -**This function is deprecated**: use [`claimFromDataProviders`](#fn_claimfromdataproviders_21bb25af) instead. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipient` | `address payable` | Address to transfer funds to. | -| `_rewardEpochs` | `uint256[]` | Array of reward epoch numbers to claim for. | -| `_dataProviders` | `address[]` | Array of addresses of the data providers to claim the reward from. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Total amount of claimed rewards (wei). | -
-
- -
- -### `getClaimedReward` { #fn_getclaimedreward_85b4c538 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getClaimedReward( - uint256 _rewardEpoch, - address _dataProvider, - address _claimer -) external view returns ( - bool _claimed, - uint256 _amount); -``` - -Returns information on the rewards accrued by a reward owner from a specific data provider at a specific -reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID to query. | -| `_dataProvider` | `address` | Address of the data provider to query. | -| `_claimer` | `address` | Address of the reward owner to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_claimed` | `bool` | Whether the reward has been claimed or not. | -| `_amount` | `uint256` | Accrued amount in wei. | -
-
- -
- -### `getCurrentRewardEpoch` { #fn_getcurrentrewardepoch_e7c830d4 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getCurrentRewardEpoch( -) external view returns ( - uint256); -``` - -Returns the current reward epoch ID. - -
-
- -
- -### `getDataProviderCurrentFeePercentage` { #fn_getdataprovidercurrentfeepercentage_cfbcd25f } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderCurrentFeePercentage( - address _dataProvider -) external view returns ( - uint256 _feePercentageBIPS); -``` - -Returns the current [fee](https://docs.flare.network/tech/ftso/#rewards) percentage of a data provider. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_dataProvider` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256` | Fee percentage in BIPS. | -
-
- -
- -### `getDataProviderFeePercentage` { #fn_getdataproviderfeepercentage_961c00ed } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderFeePercentage( - address _dataProvider, - uint256 _rewardEpoch -) external view returns ( - uint256 _feePercentageBIPS); -``` - -Returns the [fee](https://docs.flare.network/tech/ftso/#rewards) percentage of a data provider at a -given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_dataProvider` | `address` | Address of the queried data provider. | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256` | Fee percentage in BIPS. | -
-
- -
- -### `getDataProviderPerformanceInfo` { #fn_getdataproviderperformanceinfo_eb82dd7f } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderPerformanceInfo( - uint256 _rewardEpoch, - address _dataProvider -) external view returns ( - uint256 _rewardAmount, - uint256 _votePowerIgnoringRevocation); -``` - -Returns information on rewards and vote power of a data provider at a given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | -| `_dataProvider` | `address` | Address of the data provider to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Amount of rewards (wei). | -| `_votePowerIgnoringRevocation` | `uint256` | Vote power, not including revocations. | -
-
- -
- -### `getDataProviderScheduledFeePercentageChanges` { #fn_getdataproviderscheduledfeepercentagechanges_33b7971e } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderScheduledFeePercentageChanges( - address _dataProvider -) external view returns ( - uint256[] _feePercentageBIPS, - uint256[] _validFromEpoch, - bool[] _fixed); -``` - -Returns the scheduled [fee](https://docs.flare.network/tech/ftso/#rewards) percentage changes for a data -provider. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_dataProvider` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256[]` | Array of fee percentages in BIPS. | -| `_validFromEpoch` | `uint256[]` | Array of block numbers from which the fee settings are effective. | -| `_fixed` | `bool[]` | Array of boolean values indicating whether settings are subject to change or not. | -
-
- -
- -### `getEpochReward` { #fn_getepochreward_d418634a } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getEpochReward( - uint256 _rewardEpoch -) external view returns ( - uint256 _totalReward, - uint256 _claimedReward); -``` - -Returns information on an epoch's rewards. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_totalReward` | `uint256` | Total amount of rewards accrued on that epoch, in wei. | -| `_claimedReward` | `uint256` | Total amount of rewards that have already been claimed, in wei. | -
-
- -
- -### `getEpochsWithClaimableRewards` { #fn_getepochswithclaimablerewards_0441218e } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getEpochsWithClaimableRewards( -) external view returns ( - uint256 _startEpochId, - uint256 _endEpochId); -``` - -Returns the reward epoch range for which rewards can be claimed. -Rewards outside this range are unclaimable, either because they have expired or because the reward epoch is -still ongoing. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_startEpochId` | `uint256` | The oldest epoch ID that allows reward claiming. | -| `_endEpochId` | `uint256` | The newest epoch ID that allows reward claiming. | -
-
- -
- -### `getEpochsWithUnclaimedRewards` { #fn_getepochswithunclaimedrewards_b4a2043d } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getEpochsWithUnclaimedRewards( - address _beneficiary -) external view returns ( - uint256[] _epochIds); -``` - -Returns the array of claimable epoch IDs for which the rewards of a reward owner have not yet been claimed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_beneficiary` | `address` | Address of the reward owner to query. Reverts if it uses delegation by amount. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_epochIds` | `uint256[]` | Array of epoch IDs. | -
-
- -
- -### `getInitialRewardEpoch` { #fn_getinitialrewardepoch_3123b7d8 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getInitialRewardEpoch( -) external view returns ( - uint256); -``` - -Returns the initial reward epoch ID for this reward manager contract. -This corresponds to the oldest reward epoch with claimable rewards in the previous reward manager when this -one took over. -Set by governance through `setInitialRewardData`. - -
-
- -
- -### `getRewardEpochToExpireNext` { #fn_getrewardepochtoexpirenext_3e7ff857 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getRewardEpochToExpireNext( -) external view returns ( - uint256); -``` - -Returns the reward epoch that will expire next once a new reward epoch starts. - -
-
- -
- -### `getRewardEpochVotePowerBlock` { #fn_getrewardepochvotepowerblock_f2edab5a } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getRewardEpochVotePowerBlock( - uint256 _rewardEpoch -) external view returns ( - uint256); -``` - -Returns the [vote power block](https://docs.flare.network/tech/ftso/#vote-power) of a given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | - -
-
- -
- -### `getStateOfRewards` { #fn_getstateofrewards_a4472c10 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getStateOfRewards( - address _beneficiary, - uint256 _rewardEpoch -) external view returns ( - address[] _dataProviders, - uint256[] _rewardAmounts, - bool[] _claimed, - bool _claimable); -``` - -Returns the state of rewards for a given address at a specific reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_beneficiary` | `address` | Address of the beneficiary to query. It can be a data provider or a delegator, for example.
Reverts if the queried address is delegating by amount. | -| `_rewardEpoch` | `uint256` | Reward epoch ID to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_dataProviders` | `address[]` | Array of addresses of data providers. | -| `_rewardAmounts` | `uint256[]` | Array of reward amounts received from each provider, in wei. | -| `_claimed` | `bool[]` | Array of boolean values indicating whether each reward has been claimed or not. | -| `_claimable` | `bool` | Boolean value indicating whether rewards are claimable or not. | -
-
- -
- -### `getStateOfRewardsFromDataProviders` { #fn_getstateofrewardsfromdataproviders_e416b7e1 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getStateOfRewardsFromDataProviders( - address _beneficiary, - uint256 _rewardEpoch, - address[] _dataProviders -) external view returns ( - uint256[] _rewardAmounts, - bool[] _claimed, - bool _claimable); -``` - -Returns the state of rewards for a given address coming from a specific set of data providers, at a specific -reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_beneficiary` | `address` | Address of beneficiary to query. | -| `_rewardEpoch` | `uint256` | Reward epoch ID to query. | -| `_dataProviders` | `address[]` | Array of addresses of the data providers to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmounts` | `uint256[]` | Array of reward amounts received from each provider, in wei. | -| `_claimed` | `bool[]` | Array of boolean values indicating whether each reward has been claimed or not. | -| `_claimable` | `bool` | Boolean value indicating whether rewards are claimable or not. | -
-
- -
- -### `nextClaimableRewardEpoch` { #fn_nextclaimablerewardepoch_69b91b59 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function nextClaimableRewardEpoch( - address _rewardOwner -) external view returns ( - uint256); -``` - -Returns the next claimable reward epoch for a reward owner. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | Address of the reward owner to query. | - -
-
- -
- -### `setDataProviderFeePercentage` { #fn_setdataproviderfeepercentage_16e69328 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function setDataProviderFeePercentage( - uint256 _feePercentageBIPS -) external returns ( - uint256 _validFromEpoch); -``` - -Sets the [fee](https://docs.flare.network/tech/ftso/#rewards) a data provider keeps from all delegations. - -Takes effect after `feeValueUpdateOffset` reward epochs have elapsed. - -When called multiple times inside the same reward epoch, only the last value remains. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256` | Fee percentage in BIPS. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_validFromEpoch` | `uint256` | Reward epoch number when the new fee percentage will become effective. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IGovernanceSettings.md b/docs/apis/smart-contracts/IGovernanceSettings.md deleted file mode 100644 index 794cce2f6..000000000 --- a/docs/apis/smart-contracts/IGovernanceSettings.md +++ /dev/null @@ -1,136 +0,0 @@ ---- -title: IGovernanceSettings -search: - boost: 0.5 ---- - - - -# `IGovernanceSettings` { #ct_igovernancesettings } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceSettings.sol) -
- -
- -Interface for the [`GovernanceSettings`](./GovernanceSettings.md) that hold the Flare governance address and its timelock. - -All governance calls are delayed by the timelock specified in this contract. - -**NOTE**: This contract enables updating the governance address and timelock only -by hard-forking the network, meaning only by updating validator code. - -
- -
- -## Functions - -
- -### `getExecutors` { #fn_getexecutors_ef09e78f } - -
-Defined in `IGovernanceSettings` ([Docs](./IGovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceSettings.sol)). -
- -
- -```solidity -function getExecutors( -) external view returns ( - address[] _addresses); -``` - -Gets the addresses of the accounts that are allowed to execute the timelocked governance calls, -once the timelock period expires. -Executors can be changed without a hard fork, via a normal governance call. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_addresses` | `address[]` | Array of executor addresses. | -
-
- -
- -### `getGovernanceAddress` { #fn_getgovernanceaddress_73252494 } - -
-Defined in `IGovernanceSettings` ([Docs](./IGovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceSettings.sol)). -
- -
- -```solidity -function getGovernanceAddress( -) external view returns ( - address _address); -``` - -Gets the governance account address. -The governance address can only be changed by a hard fork. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_address` | `address` | The governance account address. | -
-
- -
- -### `getTimelock` { #fn_gettimelock_6221a54b } - -
-Defined in `IGovernanceSettings` ([Docs](./IGovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceSettings.sol)). -
- -
- -```solidity -function getTimelock( -) external view returns ( - uint256 _timelock); -``` - -Gets the time in seconds that must pass between a governance call and its execution. -The timelock value can only be changed by a hard fork. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_timelock` | `uint256` | Time in seconds that passes between the governance call and execution. | -
-
- -
- -### `isExecutor` { #fn_isexecutor_debfda30 } - -
-Defined in `IGovernanceSettings` ([Docs](./IGovernanceSettings.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceSettings.sol)). -
- -
- -```solidity -function isExecutor( - address _address -) external view returns ( - bool); -``` - -Checks whether an address is one of the allowed executors. See [`getExecutors`](#fn_getexecutors_ef09e78f). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_address` | `address` | The address to check. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | True if `_address` is in the executors list. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IGovernanceVotePower.md b/docs/apis/smart-contracts/IGovernanceVotePower.md deleted file mode 100644 index e302ae653..000000000 --- a/docs/apis/smart-contracts/IGovernanceVotePower.md +++ /dev/null @@ -1,193 +0,0 @@ ---- -title: IGovernanceVotePower -search: - boost: 0.5 ---- - - - -# `IGovernanceVotePower` { #ct_igovernancevotepower } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol) -
- -
- -Interface for contracts delegating their governance vote power. - -
- -
- -## Functions - -
- -### `delegate` { #fn_delegate_5c19a95c } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function delegate( - address _to -) external; -``` - -Delegates all governance vote power of `msg.sender` to address `_to`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | - -
-
- -
- -### `getDelegateOfAt` { #fn_getdelegateofat_3c028e9d } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function getDelegateOfAt( - address _who, - uint256 _blockNumber -) external view returns ( - address); -``` - -Gets the address an account is delegating its governance vote power to, at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number at which to fetch the address. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address where `_who` was delegating its governance vote power at block `_blockNumber`. | -
-
- -
- -### `getDelegateOfAtNow` { #fn_getdelegateofatnow_b3e871ee } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function getDelegateOfAtNow( - address _who -) external view returns ( - address); -``` - -Gets the address an account is delegating its governance vote power to, at the latest block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address where `_who` is currently delegating its governance vote power. | -
-
- -
- -### `getVotes` { #fn_getvotes_9ab24eb0 } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function getVotes( - address _who -) external view returns ( - uint256); -``` - -Gets the governance vote power of an address at the latest block, including -all delegations made to it. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Governance vote power of `account` at the lastest block. | -
-
- -
- -### `undelegate` { #fn_undelegate_92ab89bb } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function undelegate( -) external; -``` - -Undelegates all governance vote power of `msg.sender`. - -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_92bfe6d8 } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function votePowerOfAt( - address _who, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Gets the governance vote power of an address at a given block number, including -all delegations made to it. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number at which to fetch the vote power. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Governance vote power of `_who` at `_blockNumber`. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IIAddressUpdatable.md b/docs/apis/smart-contracts/IIAddressUpdatable.md deleted file mode 100644 index c84247dd0..000000000 --- a/docs/apis/smart-contracts/IIAddressUpdatable.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: IIAddressUpdatable -search: - boost: 0.5 ---- - - - -# `IIAddressUpdatable` { #ct_iiaddressupdatable } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/interface/IIAddressUpdatable.sol) -
- -
- -Internal interface for contracts that depend on other contracts whose addresses can change. - -See [`AddressUpdatable`](./AddressUpdatable.md). - -
- -
- -## Functions - -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `IIAddressUpdatable` ([Docs](./IIAddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/interface/IIAddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -Updates contract addresses. -Can only be called from the [`AddressUpdater`](./AddressUpdater.md) contract typically set at construction time. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_contractNameHashes` | `bytes32[]` | List of keccak256(abi.encode(...)) contract names. | -| `_contractAddresses` | `address[]` | List of contract addresses corresponding to the contract names. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IIAddressUpdater.md b/docs/apis/smart-contracts/IIAddressUpdater.md deleted file mode 100644 index c8f1c133b..000000000 --- a/docs/apis/smart-contracts/IIAddressUpdater.md +++ /dev/null @@ -1,168 +0,0 @@ ---- -title: IIAddressUpdater -search: - boost: 0.5 ---- - - - -# `IIAddressUpdater` { #ct_iiaddressupdater } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/interface/IIAddressUpdater.sol) -
- -
- -Internal interface for [`AddressUpdater`](./AddressUpdater.md). - -
- -
- -## Functions - -
- -### `getContractAddress` { #fn_getcontractaddress_04433bbc } - -
-Defined in `IIAddressUpdater` ([Docs](./IIAddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/interface/IIAddressUpdater.sol)). -
- -
- -```solidity -function getContractAddress( - string _name -) external view returns ( - address); -``` - -Returns contract address for the given name, which might be address(0). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_name` | `string` | Name of the contract to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Current address for the queried contract. | -
-
- -
- -### `getContractAddressByHash` { #fn_getcontractaddressbyhash_159354a2 } - -
-Defined in `IIAddressUpdater` ([Docs](./IIAddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/interface/IIAddressUpdater.sol)). -
- -
- -```solidity -function getContractAddressByHash( - bytes32 _nameHash -) external view returns ( - address); -``` - -Returns contract address for the given name hash, which might be address(0). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nameHash` | `bytes32` | Hash of the contract name: `keccak256(abi.encode(name))` | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Current address for the queried contract. | -
-
- -
- -### `getContractAddresses` { #fn_getcontractaddresses_ee6f63c3 } - -
-Defined in `IIAddressUpdater` ([Docs](./IIAddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/interface/IIAddressUpdater.sol)). -
- -
- -```solidity -function getContractAddresses( - string[] _names -) external view returns ( - address[]); -``` - -Returns contract addresses for the given names, which might be address(0). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_names` | `string[]` | Names of the contracts to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Current addresses for the queried contracts. | -
-
- -
- -### `getContractAddressesByHash` { #fn_getcontractaddressesbyhash_5e11e2d1 } - -
-Defined in `IIAddressUpdater` ([Docs](./IIAddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/interface/IIAddressUpdater.sol)). -
- -
- -```solidity -function getContractAddressesByHash( - bytes32[] _nameHashes -) external view returns ( - address[]); -``` - -Returns contract addresses for the given name hashes, which might be address(0). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nameHashes` | `bytes32[]` | Hashes of the contract names: `keccak256(abi.encode(name))` | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Current addresses for the queried contracts. | -
-
- -
- -### `getContractNamesAndAddresses` { #fn_getcontractnamesandaddresses_2f26c5c3 } - -
-Defined in `IIAddressUpdater` ([Docs](./IIAddressUpdater.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/interface/IIAddressUpdater.sol)). -
- -
- -```solidity -function getContractNamesAndAddresses( -) external view returns ( - string[] _contractNames, - address[] _contractAddresses); -``` - -Returns all contract names and corresponding addresses currently being tracked. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_contractNames` | `string[]` | Array of contract names. | -| `_contractAddresses` | `address[]` | Array of contract addresses. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IIClaimSetupManager.md b/docs/apis/smart-contracts/IIClaimSetupManager.md deleted file mode 100644 index acfd539d1..000000000 --- a/docs/apis/smart-contracts/IIClaimSetupManager.md +++ /dev/null @@ -1,1194 +0,0 @@ ---- -title: IIClaimSetupManager -search: - boost: 0.5 ---- - - - -# `IIClaimSetupManager` { #ct_iiclaimsetupmanager } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/interface/IIClaimSetupManager.sol) | Inherits from [IClaimSetupManager](./IClaimSetupManager.md) -
- -
- -Internal interface for the [`ClaimSetupManager`](./ClaimSetupManager.md) contract. - -
- -
- -## Events - -
- -### `AllowedClaimRecipientsChanged` { #ev_allowedclaimrecipientschanged } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event AllowedClaimRecipientsChanged( - address owner, - address[] recipients -) -``` - -
-
- -
- -### `ClaimExecutorFeeValueChanged` { #ev_claimexecutorfeevaluechanged } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event ClaimExecutorFeeValueChanged( - address executor, - uint256 validFromRewardEpoch, - uint256 feeValueWei -) -``` - -
-
- -
- -### `ClaimExecutorsChanged` { #ev_claimexecutorschanged } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event ClaimExecutorsChanged( - address owner, - address[] executors -) -``` - -
-
- -
- -### `DelegationAccountCreated` { #ev_delegationaccountcreated } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event DelegationAccountCreated( - address owner, - contract IDelegationAccount delegationAccount -) -``` - -
-
- -
- -### `DelegationAccountUpdated` { #ev_delegationaccountupdated } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event DelegationAccountUpdated( - address owner, - contract IDelegationAccount delegationAccount, - bool enabled -) -``` - -
-
- -
- -### `ExecutorRegistered` { #ev_executorregistered } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event ExecutorRegistered( - address executor -) -``` - -
-
- -
- -### `ExecutorUnregistered` { #ev_executorunregistered } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event ExecutorUnregistered( - address executor, - uint256 validFromRewardEpoch -) -``` - -
-
- -
- -### `MaxFeeSet` { #ev_maxfeeset } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event MaxFeeSet( - uint256 maxFeeValueWei -) -``` - -
-
- -
- -### `MinFeeSet` { #ev_minfeeset } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event MinFeeSet( - uint256 minFeeValueWei -) -``` - -
-
- -
- -### `RegisterExecutorFeeSet` { #ev_registerexecutorfeeset } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event RegisterExecutorFeeSet( - uint256 registerExecutorFeeValueWei -) -``` - -
-
- -
- -### `SetExecutorsExcessAmountRefunded` { #ev_setexecutorsexcessamountrefunded } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -event SetExecutorsExcessAmountRefunded( - address owner, - uint256 excessAmount -) -``` - -
-
- -
- -### `SetLibraryAddress` { #ev_setlibraryaddress } - -
-Defined in `IIClaimSetupManager` ([Docs](./IIClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/interface/IIClaimSetupManager.sol)). -
- -
- -```solidity -event SetLibraryAddress( - address libraryAddress -) -``` - -Emitted when the `libraryAddress` has been set. - -
-
- -
- -
- -## Functions - -
- -### `accountToDelegationAccount` { #fn_accounttodelegationaccount_69ea2387 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function accountToDelegationAccount( - address _owner -) external view returns ( - address); -``` - -Gets the [PDA](https://docs.flare.network/tech/personal-delegation-account) of an account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address of its PDA or `address(0)` if it has not been created yet. | -
-
- -
- -### `allowedClaimRecipients` { #fn_allowedclaimrecipients_dfd14c34 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function allowedClaimRecipients( - address _rewardOwner -) external view returns ( - address[]); -``` - -Gets the addresses of recipients allowed to receive rewards on behalf of an account. -Beside these, the owner of the rewards is always authorized. -See [`setAllowedClaimRecipients`](#fn_setallowedclaimrecipients_d2a4ac61). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | The account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Addresses of all set authorized recipients. | -
-
- -
- -### `batchDelegate` { #fn_batchdelegate_dc4fcda7 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function batchDelegate( - address[] _delegatees, - uint256[] _bips -) external; -``` - -Undelegates all percentage delegations from the caller's -[PDA](https://docs.flare.network/tech/personal-delegation-account) and then [`delegate`](#fn_delegate_026e402b) to a list of accounts. - -See [`delegate`](#fn_delegate_026e402b). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegatees` | `address[]` | The addresses of the new recipients. | -| `_bips` | `uint256[]` | The percentage of voting power to be delegated to each delegatee, expressed in basis points (1/100 of one percent). Total of all `_bips` values must be lower than 10000. | - -
-
- -
- -### `checkExecutorAndAllowedRecipient` { #fn_checkexecutorandallowedrecipient_ce2caa57 } - -
-Defined in `IIClaimSetupManager` ([Docs](./IIClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/interface/IIClaimSetupManager.sol)). -
- -
- -```solidity -function checkExecutorAndAllowedRecipient( - address _executor, - address _owner, - address _recipient -) external view; -``` - -Checks if an executor can claim on behalf of a given account and send funds to a given recipient address. - -Reverts if claiming is not possible, does nothing otherwise. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | -| `_owner` | `address` | The reward owner to query. | -| `_recipient` | `address` | The address where the reward would be sent. | - -
-
- -
- -### `claimExecutors` { #fn_claimexecutors_3f317fe1 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function claimExecutors( - address _owner -) external view returns ( - address[]); -``` - -Gets the addresses of executors authorized to claim for an account. -See [`setClaimExecutors`](#fn_setclaimexecutors_9119c494). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Addresses of all set executors. | -
-
- -
- -### `delegate` { #fn_delegate_026e402b } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function delegate( - address _to, - uint256 _bips -) external; -``` - -Delegates a percentage of the caller's -[PDA](https://docs.flare.network/tech/personal-delegation-account)'s voting power to another address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_bips` | `uint256` | The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: Every call resets the delegation value. A value of 0 revokes delegation. | - -
-
- -
- -### `delegateGovernance` { #fn_delegategovernance_7a68a508 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function delegateGovernance( - address _to -) external; -``` - -Delegates all the [governance](https://docs.flare.network/tech/governance/) vote power of the caller's -[PDA](https://docs.flare.network/tech/personal-delegation-account) to another account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | Address of the recipient of the delegation. | - -
-
- -
- -### `disableDelegationAccount` { #fn_disabledelegationaccount_2394deb1 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function disableDelegationAccount( -) external; -``` - -Disables the -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA). - -When using automatic claiming, all airdrops and FTSO rewards will be sent to the owner's account. -Rewards accrued by the PDA will no longer be automatically claimed. - -Reverts if there is no PDA. - -
-
- -
- -### `enableDelegationAccount` { #fn_enabledelegationaccount_f0977215 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function enableDelegationAccount( -) external returns ( - contract IDelegationAccount); -``` - -Enables (or creates) a -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA). - -When using automatic claiming, all airdrops and FTSO rewards will be sent to the PDA, and any rewards -accrued by the PDA will be claimed too. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IDelegationAccount` | Address of the delegation account contract. | -
-
- -
- -### `getAutoClaimAddressesAndExecutorFee` { #fn_getautoclaimaddressesandexecutorfee_e24883b2 } - -
-Defined in `IIClaimSetupManager` ([Docs](./IIClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/interface/IIClaimSetupManager.sol)). -
- -
- -```solidity -function getAutoClaimAddressesAndExecutorFee( - address _executor, - address[] _owners -) external view returns ( - address[] _recipients, - uint256 _executorFeeValue); -``` - -Gets the [Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA) for -a list of accounts for which an executor is claiming. -Returns owner address instead if the PDA is not created yet or not enabled. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | Executor to query. | -| `_owners` | `address[]` | Array of reward owners which must have set `_executor` as their executor. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_recipients` | `address[]` | Addresses which will receive the claimed rewards. Can be the reward owners or their PDAs. | -| `_executorFeeValue` | `uint256` | Executor's fee value, in wei. | -
-
- -
- -### `getDelegationAccountData` { #fn_getdelegationaccountdata_17a1e3fc } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getDelegationAccountData( - address _owner -) external view returns ( - contract IDelegationAccount _delegationAccount, - bool _enabled); -``` - -Gets [PDA](https://docs.flare.network/tech/personal-delegation-account) data for an account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Account to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegationAccount` | `contract IDelegationAccount` | Account's PDA address or `address(0)` if it has not been created yet. | -| `_enabled` | `bool` | Whether the PDA is enabled. | -
-
- -
- -### `getExecutorCurrentFeeValue` { #fn_getexecutorcurrentfeevalue_e25547f8 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorCurrentFeeValue( - address _executor -) external view returns ( - uint256); -``` - -Returns the current fee of a registered executor. -Reverts if the executor is not registered. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Fee in wei. | -
-
- -
- -### `getExecutorFeeValue` { #fn_getexecutorfeevalue_3f8f784c } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorFeeValue( - address _executor, - uint256 _rewardEpoch -) external view returns ( - uint256); -``` - -Returns the fee of an executor at a given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | -| `_rewardEpoch` | `uint256` | Reward Epoch ID to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Fee in wei at that reward epoch. | -
-
- -
- -### `getExecutorInfo` { #fn_getexecutorinfo_8e28b923 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorInfo( - address _executor -) external view returns ( - bool _registered, - uint256 _currentFeeValue); -``` - -Returns information about an executor. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | The executor to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_registered` | `bool` | Whether the executor is registered. | -| `_currentFeeValue` | `uint256` | Executor's current fee value, if registered. | -
-
- -
- -### `getExecutorScheduledFeeValueChanges` { #fn_getexecutorscheduledfeevaluechanges_950b028c } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getExecutorScheduledFeeValueChanges( - address _executor -) external view returns ( - uint256[] _feeValue, - uint256[] _validFromEpoch, - bool[] _fixed); -``` - -Returns the currently scheduled fee changes of an executor. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executor` | `address` | Executor to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feeValue` | `uint256[]` | Array of scheduled fees. | -| `_validFromEpoch` | `uint256[]` | Array of reward epochs ID where the scheduled fees will become effective. | -| `_fixed` | `bool[]` | Array of booleans indicating if an scheduled fee change is fixed or it might still be changed. | -
-
- -
- -### `getRegisteredExecutors` { #fn_getregisteredexecutors_6e927e61 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function getRegisteredExecutors( - uint256 _start, - uint256 _end -) external view returns ( - address[] _registeredExecutors, - uint256 _totalLength); -``` - -Returns the list of executors registered through [`registerExecutor`](#fn_registerexecutor_ccce7e86). -Supports paging. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_start` | `uint256` | First executor to return. | -| `_end` | `uint256` | Last executor to return. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_registeredExecutors` | `address[]` | Addresses of the registered executors. | -| `_totalLength` | `uint256` | Total amount of executors. | -
-
- -
- -### `isClaimExecutor` { #fn_isclaimexecutor_87962abe } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function isClaimExecutor( - address _owner, - address _executor -) external view returns ( - bool); -``` - -Returns whether an executor is authorized to claim on behalf of a reward owner. -See [`setClaimExecutors`](#fn_setclaimexecutors_9119c494). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The reward owner to query. | -| `_executor` | `address` | The executor to query. | - -
-
- -
- -### `registerExecutor` { #fn_registerexecutor_ccce7e86 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function registerExecutor( - uint256 _feeValue -) external payable returns ( - uint256); -``` - -Registers the caller as an executor and sets its initial fee value. - -If the executor was already registered, this method only updates the fee, which will take effect after -`feeValueUpdateOffset` reward epochs have elapsed. - -Executor must pay a fee in order to register. See `registerExecutorFeeValueWei`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_feeValue` | `uint256` | Desired fee, in wei. Must be between `minFeeValueWei` and `maxFeeValueWei`. 0 means no fee. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID when the changes become effective. | -
-
- -
- -### `revokeDelegationAt` { #fn_revokedelegationat_bbd6fbf8 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function revokeDelegationAt( - address _who, - uint256 _blockNumber -) external; -``` - -Revokes all delegation from the caller's [PDA](https://docs.flare.network/tech/personal-delegation-account) -to a given account at a given block. - -Only affects the reads via `votePowerOfAtCached()` in the specified block. - -This method should be used only to prevent rogue [`delegate`](#fn_delegate_026e402b) voting in the current voting block. -To stop delegating use [`delegate`](#fn_delegate_026e402b) with percentage of 0 or [`undelegateAll`](#fn_undelegateall_b302f393). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The account to revoke. | -| `_blockNumber` | `uint256` | Block number where the revoking will take place. Must be in the past. | - -
-
- -
- -### `setAllowedClaimRecipients` { #fn_setallowedclaimrecipients_d2a4ac61 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function setAllowedClaimRecipients( - address[] _recipients -) external; -``` - -Set the addresses of allowed recipients. -The reward owner is always an allowed recipient. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipients` | `address[]` | The new allowed recipients. All old recipients will be deleted and replaced by these. | - -
-
- -
- -### `setAutoClaiming` { #fn_setautoclaiming_e72dcdbb } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function setAutoClaiming( - address[] _executors, - bool _enableDelegationAccount -) external payable; -``` - -Sets the addresses of executors and optionally enables (creates) a -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) (PDA). - -If any of the executors is a registered executor, some fee needs to be paid. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executors` | `address[]` | The new executors. All old executors will be deleted and replaced by these. | -| `_enableDelegationAccount` | `bool` | Whether the PDA should be enabled. | - -
-
- -
- -### `setClaimExecutors` { #fn_setclaimexecutors_9119c494 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function setClaimExecutors( - address[] _executors -) external payable; -``` - -Sets the addresses of executors. - -If any of the executors is a registered executor, some fee needs to be paid. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_executors` | `address[]` | The new executors. All old executors will be deleted and replaced by these. | - -
-
- -
- -### `setLibraryAddress` { #fn_setlibraryaddress_4863ba17 } - -
-Defined in `IIClaimSetupManager` ([Docs](./IIClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/interface/IIClaimSetupManager.sol)). -
- -
- -```solidity -function setLibraryAddress( - address _libraryAddress -) external; -``` - -Sets new library address. - -
-
- -
- -### `setMaxFeeValueWei` { #fn_setmaxfeevaluewei_2e9b6afa } - -
-Defined in `IIClaimSetupManager` ([Docs](./IIClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/interface/IIClaimSetupManager.sol)). -
- -
- -```solidity -function setMaxFeeValueWei( - uint256 _maxFeeValueWei -) external; -``` - -Sets maximum fee allowed for executors, in wei. - -
-
- -
- -### `setMinFeeValueWei` { #fn_setminfeevaluewei_d8343550 } - -
-Defined in `IIClaimSetupManager` ([Docs](./IIClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/interface/IIClaimSetupManager.sol)). -
- -
- -```solidity -function setMinFeeValueWei( - uint256 _minFeeValueWei -) external; -``` - -Sets minimum fee allowed for executors, in wei. - -
-
- -
- -### `setRegisterExecutorFeeValueWei` { #fn_setregisterexecutorfeevaluewei_869d90a5 } - -
-Defined in `IIClaimSetupManager` ([Docs](./IIClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/interface/IIClaimSetupManager.sol)). -
- -
- -```solidity -function setRegisterExecutorFeeValueWei( - uint256 _registerExecutorFeeValueWei -) external; -``` - -Sets the fee required to register an executor, which must be higher than 0. - -
-
- -
- -### `transferExternalToken` { #fn_transferexternaltoken_489a8a47 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function transferExternalToken( - contract IERC20 _token, - uint256 _amount -) external; -``` - -Allows the caller to transfer ERC-20 tokens from their -[PDA](https://docs.flare.network/tech/personal-delegation-account) to the owner account. - -The main use case is to move ERC-20 tokes received by mistake (by an airdrop, for example) out of the PDA -and into the main account, where they can be more easily managed. - -Reverts if the target token is the [`WNat`](./WNat.md) contract: use method [`withdraw`](#fn_withdraw_2e1a7d4d) for that. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_token` | `contract IERC20` | Target token contract address. | -| `_amount` | `uint256` | Amount of tokens to transfer. | - -
-
- -
- -### `undelegateAll` { #fn_undelegateall_b302f393 } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function undelegateAll( -) external; -``` - -Removes all delegations from the caller's [PDA](https://docs.flare.network/tech/personal-delegation-account). - -
-
- -
- -### `undelegateGovernance` { #fn_undelegategovernance_87a2a0dc } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function undelegateGovernance( -) external; -``` - -Undelegates all [governance](https://docs.flare.network/tech/governance/) vote power currently delegated by -the caller's [PDA](https://docs.flare.network/tech/personal-delegation-account). - -
-
- -
- -### `unregisterExecutor` { #fn_unregisterexecutor_868a660f } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function unregisterExecutor( -) external returns ( - uint256); -``` - -Unregisters the caller as an executor. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID when the change becomes effective. | -
-
- -
- -### `updateExecutorFeeValue` { #fn_updateexecutorfeevalue_831f16af } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function updateExecutorFeeValue( - uint256 _feeValue -) external returns ( - uint256); -``` - -Sets the caller's executor fee. The caller must be an executor registered through [`registerExecutor`](#fn_registerexecutor_ccce7e86). - -When called multiple times inside the same reward epoch, only the last value remains. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_feeValue` | `uint256` | Desired fee, in wei. Must be between `minFeeValueWei` and `maxFeeValueWei`. 0 means no fee. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID when the changes become effective. | -
-
- -
- -### `wNat` { #fn_wnat_9edbf007 } - -
-Defined in `IIClaimSetupManager` ([Docs](./IIClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/claiming/interface/IIClaimSetupManager.sol)). -
- -
- -```solidity -function wNat( -) external view returns ( - contract WNat); -``` - -Returns the [`WNat`](./WNat.md) contract. - -
-
- -
- -### `withdraw` { #fn_withdraw_2e1a7d4d } - -
-Defined in `IClaimSetupManager` ([Docs](./IClaimSetupManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IClaimSetupManager.sol)). -
- -
- -```solidity -function withdraw( - uint256 _amount -) external; -``` - -Allows the caller to transfer [`WNat`](./WNat.md) wrapped tokens from their -[PDA](https://docs.flare.network/tech/personal-delegation-account) to the owner account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_amount` | `uint256` | Amount of tokens to transfer, in wei. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IICleanable.md b/docs/apis/smart-contracts/IICleanable.md deleted file mode 100644 index 984a5503f..000000000 --- a/docs/apis/smart-contracts/IICleanable.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: IICleanable -search: - boost: 0.5 ---- - - - -# `IICleanable` { #ct_iicleanable } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IICleanable.sol) -
- -
- -Internal interface for entities that can have their block history cleaned. - -
- -
- -## Functions - -
- -### `cleanupBlockNumber` { #fn_cleanupblocknumber_deea13e7 } - -
-Defined in `IICleanable` ([Docs](./IICleanable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IICleanable.sol)). -
- -
- -```solidity -function cleanupBlockNumber( -) external view returns ( - uint256); -``` - -Get the current cleanup block number set with [`setCleanupBlockNumber`](#fn_setcleanupblocknumber_13de97f5). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The currently set cleanup block number. | -
-
- -
- -### `setCleanerContract` { #fn_setcleanercontract_f6a494af } - -
-Defined in `IICleanable` ([Docs](./IICleanable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IICleanable.sol)). -
- -
- -```solidity -function setCleanerContract( - address _cleanerContract -) external; -``` - -Set the contract that is allowed to call history cleaning methods. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanerContract` | `address` | Address of the cleanup contract. Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). | - -
-
- -
- -### `setCleanupBlockNumber` { #fn_setcleanupblocknumber_13de97f5 } - -
-Defined in `IICleanable` ([Docs](./IICleanable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IICleanable.sol)). -
- -
- -```solidity -function setCleanupBlockNumber( - uint256 _blockNumber -) external; -``` - -Set the cleanup block number. -Historic data for the blocks before [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7) can be erased. -History before that block should never be used since it can be inconsistent. -In particular, cleanup block number must be lower than the current vote power block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The new cleanup block number. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IIFtso.md b/docs/apis/smart-contracts/IIFtso.md deleted file mode 100644 index 3bb6145b7..000000000 --- a/docs/apis/smart-contracts/IIFtso.md +++ /dev/null @@ -1,983 +0,0 @@ ---- -title: IIFtso -search: - boost: 0.5 ---- - - - -# `IIFtso` { #ct_iiftso } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol) | Inherits from [IFtso](./IFtso.md), [IFtsoGenesis](./IFtsoGenesis.md) -
- -
- -Internal interface for each of the FTSO contracts that handles an asset. -Read the [FTSO documentation page](https://docs.flare.network/tech/ftso/) -for general information about the FTSO system. - -
- -
- -## Functions - -
- -### `activateFtso` { #fn_activateftso_2f0a6f3c } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function activateFtso( - uint256 _firstEpochStartTs, - uint256 _submitPeriodSeconds, - uint256 _revealPeriodSeconds -) external; -``` - -Initializes FTSO immutable settings and activates the contract. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_firstEpochStartTs` | `uint256` | Timestamp of the first epoch in seconds from UNIX epoch. | -| `_submitPeriodSeconds` | `uint256` | Duration of epoch submission window in seconds. | -| `_revealPeriodSeconds` | `uint256` | Duration of epoch reveal window in seconds. | - -
-
- -
- -### `active` { #fn_active_02fb0c5e } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function active( -) external view returns ( - bool); -``` - -Returns whether FTSO is [`active`](#fn_active_02fb0c5e) or not. - -
-
- -
- -### `configureEpochs` { #fn_configureepochs_5a3c9d8e } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function configureEpochs( - uint256 _maxVotePowerNatThresholdFraction, - uint256 _maxVotePowerAssetThresholdFraction, - uint256 _lowAssetUSDThreshold, - uint256 _highAssetUSDThreshold, - uint256 _highAssetTurnoutThresholdBIPS, - uint256 _lowNatTurnoutThresholdBIPS, - uint256 _elasticBandRewardBIPS, - uint256 _elasticBandWidthPPM, - address[] _trustedAddresses -) external; -``` - -Sets configurable settings related to epochs. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_maxVotePowerNatThresholdFraction` | `uint256` | High threshold for native token vote power per voter. | -| `_maxVotePowerAssetThresholdFraction` | `uint256` | High threshold for asset vote power per voter. | -| `_lowAssetUSDThreshold` | `uint256` | Threshold for low asset vote power (in scaled USD). | -| `_highAssetUSDThreshold` | `uint256` | Threshold for high asset vote power (in scaled USD). | -| `_highAssetTurnoutThresholdBIPS` | `uint256` | Threshold for high asset turnout (in BIPS). | -| `_lowNatTurnoutThresholdBIPS` | `uint256` | Threshold for low nat turnout (in BIPS). | -| `_elasticBandRewardBIPS` | `uint256` | Percentage of the rewards (in BIPS) that go to the [secondary reward band](https://docs.flare.network/tech/ftso/#rewards). The rest go to the primary reward band. | -| `_elasticBandWidthPPM` | `uint256` | Width of the secondary reward band, in parts-per-milion of the median. | -| `_trustedAddresses` | `address[]` | Trusted voters that will be used if low voter turnout is detected. | - -
-
- -
- -### `deactivateFtso` { #fn_deactivateftso_555989da } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function deactivateFtso( -) external; -``` - -Deactivates the contract. - -
-
- -
- -### `epochsConfiguration` { #fn_epochsconfiguration_e3749e0c } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function epochsConfiguration( -) external view returns ( - uint256 _maxVotePowerNatThresholdFraction, - uint256 _maxVotePowerAssetThresholdFraction, - uint256 _lowAssetUSDThreshold, - uint256 _highAssetUSDThreshold, - uint256 _highAssetTurnoutThresholdBIPS, - uint256 _lowNatTurnoutThresholdBIPS, - uint256 _elasticBandRewardBIPS, - uint256 _elasticBandWidthPPM, - address[] _trustedAddresses); -``` - -Returns current configuration of epoch state. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_maxVotePowerNatThresholdFraction` | `uint256` | High threshold for native token vote power per voter. | -| `_maxVotePowerAssetThresholdFraction` | `uint256` | High threshold for asset vote power per voter. | -| `_lowAssetUSDThreshold` | `uint256` | Threshold for low asset vote power (in scaled USD). | -| `_highAssetUSDThreshold` | `uint256` | Threshold for high asset vote power (in scaled USD). | -| `_highAssetTurnoutThresholdBIPS` | `uint256` | Threshold for high asset turnout (in BIPS). | -| `_lowNatTurnoutThresholdBIPS` | `uint256` | Threshold for low nat turnout (in BIPS). | -| `_elasticBandRewardBIPS` | `uint256` | Percentage of the rewards (in BIPS) that go to the [secondary reward band](https://docs.flare.network/tech/ftso/#rewards). The rest go to the primary reward band. | -| `_elasticBandWidthPPM` | `uint256` | Width of the secondary reward band, in parts-per-milion of the median. | -| `_trustedAddresses` | `address[]` | Trusted voters that will be used if low voter turnout is detected. | -
-
- -
- -### `fallbackFinalizePriceEpoch` { #fn_fallbackfinalizepriceepoch_4afd5102 } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function fallbackFinalizePriceEpoch( - uint256 _epochId -) external; -``` - -Forces finalization of a price epoch, calculating the median price from trusted addresses only. - -Used as a fallback method, for example, due to an unexpected error during normal epoch finalization or -because the [`ftsoManager`](#fn_ftsomanager_11a7aaaa) enabled the fallback mode. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch to finalize. | - -
-
- -
- -### `finalizePriceEpoch` { #fn_finalizepriceepoch_40462a2d } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function finalizePriceEpoch( - uint256 _epochId, - bool _returnRewardData -) external returns ( - address[] _eligibleAddresses, - uint256[] _natWeights, - uint256 _totalNatWeight); -``` - -Computes epoch price based on gathered votes. - -* If the price reveal window for the epoch has ended, finalize the epoch. -* Iterate list of price submissions. -* Find weighted median. -* Find adjacent 50% of price submissions. -* Allocate rewards for price submissions. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch to finalize. | -| `_returnRewardData` | `bool` | Parameter that determines if the reward data is returned. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_eligibleAddresses` | `address[]` | List of addresses eligible for reward. | -| `_natWeights` | `uint256[]` | List of native token weights corresponding to the eligible addresses. | -| `_totalNatWeight` | `uint256` | Sum of weights in `_natWeights`. | -
-
- -
- -### `forceFinalizePriceEpoch` { #fn_forcefinalizepriceepoch_974d7a6b } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function forceFinalizePriceEpoch( - uint256 _epochId -) external; -``` - -Forces finalization of a price epoch by copying the price from the previous epoch. - -Used as a fallback method if [`fallbackFinalizePriceEpoch`](#fn_fallbackfinalizepriceepoch_4afd5102) fails due to an exception. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch to finalize. | - -
-
- -
- -### `ftsoManager` { #fn_ftsomanager_11a7aaaa } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function ftsoManager( -) external view returns ( - address); -``` - -Returns the FTSO manager's address. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address of the FTSO manager contract. | -
-
- -
- -### `getAsset` { #fn_getasset_5c222bad } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function getAsset( -) external view returns ( - contract IIVPToken); -``` - -Returns the FTSO asset. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IIVPToken` | Address of the [`IIVPToken`](./IIVPToken.md) tracked by this FTSO. `null` in case of multi-asset FTSO. | -
-
- -
- -### `getAssetFtsos` { #fn_getassetftsos_18931c35 } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function getAssetFtsos( -) external view returns ( - contract IIFtso[]); -``` - -Returns the asset FTSOs. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IIFtso[]` | Array of [`IIFtso`](./IIFtso.md) contract addresses. `null` in case of single-asset FTSO. | -
-
- -
- -### `getCurrentEpochId` { #fn_getcurrentepochid_a29a839f } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentEpochId( -) external view returns ( - uint256); -``` - -Returns the current epoch ID. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Currently running epoch ID. IDs are consecutive numbers starting from zero. | -
-
- -
- -### `getCurrentPrice` { #fn_getcurrentprice_eb91d37e } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentPrice( -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Returns the current asset price. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -
-
- -
- -### `getCurrentPriceDetails` { #fn_getcurrentpricedetails_040d73b8 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentPriceDetails( -) external view returns ( - uint256 _price, - uint256 _priceTimestamp, - enum IFtso.PriceFinalizationType _priceFinalizationType, - uint256 _lastPriceEpochFinalizationTimestamp, - enum IFtso.PriceFinalizationType _lastPriceEpochFinalizationType); -``` - -Returns asset's current price details. -All timestamps are in seconds from UNIX epoch. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_priceTimestamp` | `uint256` | Time when price was updated for the last time. | -| `_priceFinalizationType` | `enum IFtso.PriceFinalizationType` | Finalization type when price was updated for the last time. | -| `_lastPriceEpochFinalizationTimestamp` | `uint256` | Time when last price epoch was finalized. | -| `_lastPriceEpochFinalizationType` | `enum IFtso.PriceFinalizationType` | Finalization type of last finalized price epoch. | -
-
- -
- -### `getCurrentPriceFromTrustedProviders` { #fn_getcurrentpricefromtrustedproviders_af52df08 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentPriceFromTrustedProviders( -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Returns current asset price calculated only using input from trusted providers. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -
-
- -
- -### `getCurrentPriceWithDecimals` { #fn_getcurrentpricewithdecimals_65f5cd86 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimals( -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Returns current asset price and number of decimals. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`_assetPriceUsdDecimals`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the USD price. | -
-
- -
- -### `getCurrentPriceWithDecimalsFromTrustedProviders` { #fn_getcurrentpricewithdecimalsfromtrustedproviders_3cacb3ae } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimalsFromTrustedProviders( -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Returns current asset price calculated only using input from trusted providers and number of decimals. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Time when price was updated for the last time, in seconds from UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the USD price. | -
-
- -
- -### `getCurrentRandom` { #fn_getcurrentrandom_d89601fd } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getCurrentRandom( -) external view returns ( - uint256); -``` - -Returns the random number for the previous price epoch, obtained from the random numbers -provided by all data providers along with their data submissions. - -
-
- -
- -### `getEpochId` { #fn_getepochid_5303548b } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getEpochId( - uint256 _timestamp -) external view returns ( - uint256); -``` - -Returns the ID of the epoch that was opened for price submission at the specified timestamp. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_timestamp` | `uint256` | Queried timestamp in seconds from UNIX epoch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Epoch ID corresponding to that timestamp. IDs are consecutive numbers starting from zero. | -
-
- -
- -### `getEpochPrice` { #fn_getepochprice_7d1d6f12 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getEpochPrice( - uint256 _epochId -) external view returns ( - uint256); -``` - -Returns agreed asset price in the specified epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch. Only the last 200 epochs can be queried. Out-of-bounds queries revert. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -
-
- -
- -### `getEpochPriceForVoter` { #fn_getepochpriceforvoter_c5d8b9e7 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getEpochPriceForVoter( - uint256 _epochId, - address _voter -) external view returns ( - uint256); -``` - -Returns asset price submitted by a voter in the specified epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch being queried. Only the last 200 epochs can be queried. Out-of-bounds queries revert. | -| `_voter` | `address` | Address of the voter being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Price in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -
-
- -
- -### `getPriceEpochConfiguration` { #fn_getpriceepochconfiguration_144e1591 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getPriceEpochConfiguration( -) external view returns ( - uint256 _firstEpochStartTs, - uint256 _submitPeriodSeconds, - uint256 _revealPeriodSeconds); -``` - -Returns current epoch's configuration. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_firstEpochStartTs` | `uint256` | First epoch start timestamp in seconds from UNIX epoch. | -| `_submitPeriodSeconds` | `uint256` | Submit period in seconds. | -| `_revealPeriodSeconds` | `uint256` | Reveal period in seconds. | -
-
- -
- -### `getPriceEpochData` { #fn_getpriceepochdata_e3b3a3b3 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getPriceEpochData( -) external view returns ( - uint256 _epochId, - uint256 _epochSubmitEndTime, - uint256 _epochRevealEndTime, - uint256 _votePowerBlock, - bool _fallbackMode); -``` - -Returns current epoch data. -Intervals are open on the right: End times are not included. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_epochId` | `uint256` | Current epoch ID. | -| `_epochSubmitEndTime` | `uint256` | End time of the price submission window in seconds from UNIX epoch. | -| `_epochRevealEndTime` | `uint256` | End time of the price reveal window in seconds from UNIX epoch. | -| `_votePowerBlock` | `uint256` | Vote power block for the current epoch. | -| `_fallbackMode` | `bool` | Whether the current epoch is in fallback mode. Only votes from trusted addresses are used in this mode. | -
-
- -
- -### `getRandom` { #fn_getrandom_cd4b6914 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function getRandom( - uint256 _epochId -) external view returns ( - uint256); -``` - -Returns the random number used in a specific past epoch, obtained from the random numbers -provided by all data providers along with their data submissions. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the queried epoch. Current epoch cannot be queried, and the previous epoch is constantly updated as data providers reveal their prices and random numbers. Only the last 50 epochs can be queried and there is no bounds checking for this parameter. Out-of-bounds queries return undefined values. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The random number used in that epoch. | -
-
- -
- -### `getVoteWeightingParameters` { #fn_getvoteweightingparameters_8357d08c } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function getVoteWeightingParameters( -) external view returns ( - contract IIVPToken[] _assets, - uint256[] _assetMultipliers, - uint256 _totalVotePowerNat, - uint256 _totalVotePowerAsset, - uint256 _assetWeightRatio, - uint256 _votePowerBlock); -``` - -Returns parameters necessary for replicating vote weighting (used in [`VoterWhitelister`](./VoterWhitelister.md)). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_assets` | `contract IIVPToken[]` | The list of assets that are accounted in vote. | -| `_assetMultipliers` | `uint256[]` | Weight multiplier of each asset in (multiasset) FTSO. | -| `_totalVotePowerNat` | `uint256` | Total native token vote power at block. | -| `_totalVotePowerAsset` | `uint256` | Total combined asset vote power at block. | -| `_assetWeightRatio` | `uint256` | Ratio of combined asset vote power vs. native token vp (in BIPS). | -| `_votePowerBlock` | `uint256` | Vote power block for the epoch. | -
-
- -
- -### `initializeCurrentEpochStateForReveal` { #fn_initializecurrentepochstateforreveal_f670ebe3 } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function initializeCurrentEpochStateForReveal( - uint256 _circulatingSupplyNat, - bool _fallbackMode -) external; -``` - -Initializes current epoch instance for reveal. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_circulatingSupplyNat` | `uint256` | Epoch native token circulating supply. | -| `_fallbackMode` | `bool` | Whether the current epoch is in fallback mode. | - -
-
- -
- -### `revealPriceSubmitter` { #fn_revealpricesubmitter_c1f6c36e } - -
-Defined in `IFtsoGenesis` ([Docs](./IFtsoGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoGenesis.sol)). -
- -
- -```solidity -function revealPriceSubmitter( - address _voter, - uint256 _epochId, - uint256 _price, - uint256 _voterWNatVP -) external; -``` - -Reveals the price submitted by a voter on a specific epoch. -The hash of _price and _random must be equal to the submitted hash - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Voter address. | -| `_epochId` | `uint256` | ID of the epoch in which the price hash was submitted. | -| `_price` | `uint256` | Submitted price. | -| `_voterWNatVP` | `uint256` | Voter's vote power in [`WNat`](./WNat.md) units. | - -
-
- -
- -### `setAsset` { #fn_setasset_d0d552dd } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function setAsset( - contract IIVPToken _asset -) external; -``` - -Sets asset for FTSO to operate as single-asset oracle. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_asset` | `contract IIVPToken` | Address of the [`IIVPToken`](./IIVPToken.md) contract that will be the asset tracked by this FTSO. | - -
-
- -
- -### `setAssetFtsos` { #fn_setassetftsos_131fdee2 } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function setAssetFtsos( - contract IIFtso[] _assetFtsos -) external; -``` - -Sets an array of FTSOs for FTSO to operate as multi-asset oracle. -FTSOs implicitly determine the FTSO assets. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_assetFtsos` | `contract IIFtso[]` | Array of FTSOs. | - -
-
- -
- -### `setVotePowerBlock` { #fn_setvotepowerblock_e536f396 } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function setVotePowerBlock( - uint256 _blockNumber -) external; -``` - -Sets the current vote power block. -Current vote power block will update per reward epoch. -The FTSO doesn't have notion of reward epochs. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | Vote power block. | - -
-
- -
- -### `symbol` { #fn_symbol_95d89b41 } - -
-Defined in `IFtso` ([Docs](./IFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtso.sol)). -
- -
- -```solidity -function symbol( -) external view returns ( - string); -``` - -Returns the FTSO [`symbol`](#fn_symbol_95d89b41). - -
-
- -
- -### `updateInitialPrice` { #fn_updateinitialprice_306ba253 } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function updateInitialPrice( - uint256 _initialPriceUSD, - uint256 _initialPriceTimestamp -) external; -``` - -Updates initial asset price when the contract is not [`active`](#fn_active_02fb0c5e) yet. - -
-
- -
- -### `wNat` { #fn_wnat_9edbf007 } - -
-Defined in `IIFtso` ([Docs](./IIFtso.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtso.sol)). -
- -
- -```solidity -function wNat( -) external view returns ( - contract IIVPToken); -``` - -Address of the [`WNat`](./WNat.md) contract. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IIVPToken` | Address of the [`WNat`](./WNat.md) contract. | -
-
- -
- -### `wNatVotePowerCached` { #fn_wnatvotepowercached_f72cab28 } - -
-Defined in `IFtsoGenesis` ([Docs](./IFtsoGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoGenesis.sol)). -
- -
- -```solidity -function wNatVotePowerCached( - address _voter, - uint256 _epochId -) external returns ( - uint256); -``` - -Get and cache the vote power of a voter on a specific epoch, in [`WNat`](./WNat.md) units. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Voter address. | -| `_epochId` | `uint256` | ID of the epoch in which the price hash was submitted. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Voter's vote power in [`WNat`](./WNat.md) units. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IIFtsoManager.md b/docs/apis/smart-contracts/IIFtsoManager.md deleted file mode 100644 index dca5a6f35..000000000 --- a/docs/apis/smart-contracts/IIFtsoManager.md +++ /dev/null @@ -1,1389 +0,0 @@ ---- -title: IIFtsoManager -search: - boost: 0.5 ---- - - - -# `IIFtsoManager` { #ct_iiftsomanager } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol) | Inherits from [IFtsoManager](./IFtsoManager.md), [IFlareDaemonize](./IFlareDaemonize.md) -
- -
- -Internal interface for the [`FtsoManager`](./FtsoManager.md) contract. - -
- -
- -## Events - -
- -### `AccruingUnearnedRewardsFailed` { #ev_accruingunearnedrewardsfailed } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event AccruingUnearnedRewardsFailed( - uint256 epochId -) -``` - -Unexpected failure while accruing unearned rewards. -This should be a rare occurrence. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `epochId` | `uint256` | Epoch ID of the failure. | - -
-
- -
- -### `ChillingNonrevealingDataProvidersFailed` { #ev_chillingnonrevealingdataprovidersfailed } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -event ChillingNonrevealingDataProvidersFailed( -) -``` - -Unexpected failure. This should be a rare occurrence. - -
-
- -
- -### `CleanupBlockNumberManagerFailedForBlock` { #ev_cleanupblocknumbermanagerfailedforblock } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -event CleanupBlockNumberManagerFailedForBlock( - uint256 blockNumber -) -``` - -Unexpected failure. This should be a rare occurrence. - -
-
- -
- -### `ClosingExpiredRewardEpochFailed` { #ev_closingexpiredrewardepochfailed } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -event ClosingExpiredRewardEpochFailed( - uint256 rewardEpoch -) -``` - -Unexpected failure. This should be a rare occurrence. - -
-
- -
- -### `DistributingRewardsFailed` { #ev_distributingrewardsfailed } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event DistributingRewardsFailed( - address ftso, - uint256 epochId -) -``` - -Unexpected failure while distributing rewards. -This should be a rare occurrence. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `address` | Contract address of the FTSO where the failure happened. | -| `epochId` | `uint256` | Epoch ID of the failure. | - -
-
- -
- -### `FallbackMode` { #ev_fallbackmode } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event FallbackMode( - bool fallbackMode -) -``` - -Emitted when the fallback mode of the FTSO manager changes its state. -Fallback mode is a recovery mode, where only data from a trusted subset of FTSO -data providers is used to calculate the final price. - -The FTSO Manager enters the fallback mode when ALL FTSOs are in fallback mode. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `fallbackMode` | `bool` | New state of the FTSO Manager fallback mode. | - -
-
- -
- -### `FinalizingPriceEpochFailed` { #ev_finalizingpriceepochfailed } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event FinalizingPriceEpochFailed( - contract IIFtso ftso, - uint256 epochId, - enum IFtso.PriceFinalizationType failingType -) -``` - -Unexpected failure while finalizing a price epoch. -This should be a rare occurrence. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `contract IIFtso` | Contract address of the FTSO where the failure happened. | -| `epochId` | `uint256` | Epoch ID of the failure. | -| `failingType` | `enum IFtso.PriceFinalizationType` | How was the epoch finalized. | - -
-
- -
- -### `FtsoAdded` { #ev_ftsoadded } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event FtsoAdded( - contract IIFtso ftso, - bool add -) -``` - -Emitted when a new FTSO has been added or an existing one has been removed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `contract IIFtso` | Contract address of the FTSO. | -| `add` | `bool` | True if added, removed otherwise. | - -
-
- -
- -### `FtsoDeactivationFailed` { #ev_ftsodeactivationfailed } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -event FtsoDeactivationFailed( - contract IIFtso ftso -) -``` - -Unexpected failure. This should be a rare occurrence. - -
-
- -
- -### `FtsoFallbackMode` { #ev_ftsofallbackmode } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event FtsoFallbackMode( - contract IIFtso ftso, - bool fallbackMode -) -``` - -Emitted when the fallback mode of an FTSO changes its state. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `contract IIFtso` | Contract address of the FTSO. | -| `fallbackMode` | `bool` | New state of its fallback mode. | - -
-
- -
- -### `InitializingCurrentEpochStateForRevealFailed` { #ev_initializingcurrentepochstateforrevealfailed } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event InitializingCurrentEpochStateForRevealFailed( - contract IIFtso ftso, - uint256 epochId -) -``` - -Unexpected failure while initializing a price epoch. -This should be a rare occurrence. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `contract IIFtso` | Contract address of the FTSO where the failure happened. | -| `epochId` | `uint256` | Epoch ID that failed initialization. | - -
-
- -
- -### `PriceEpochFinalized` { #ev_priceepochfinalized } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event PriceEpochFinalized( - address chosenFtso, - uint256 rewardEpochId -) -``` - -Emitted when a [price epoch](https://docs.flare.network/tech/ftso/#procedure-overview) ends, this is, -after the reveal phase, when final prices are calculated. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `chosenFtso` | `address` | Contract address of the FTSO asset that was randomly chosen to be the basis for reward calculation. On this price epoch, rewards will be calculated based on how close each data provider was to the median of all submitted prices FOR THIS FTSO. | -| `rewardEpochId` | `uint256` | Reward epoch ID this price epoch belongs to. | - -
-
- -
- -### `RewardEpochFinalized` { #ev_rewardepochfinalized } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event RewardEpochFinalized( - uint256 votepowerBlock, - uint256 startBlock -) -``` - -Emitted when a [reward epoch](https://docs.flare.network/tech/ftso/#procedure-overview) -ends and rewards are available. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `votepowerBlock` | `uint256` | The [vote power block](https://docs.flare.network/tech/ftso/#vote-power) of the epoch. | -| `startBlock` | `uint256` | The first block of the epoch. | - -
-
- -
- -### `UpdatingActiveValidatorsTriggerFailed` { #ev_updatingactivevalidatorstriggerfailed } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -event UpdatingActiveValidatorsTriggerFailed( - uint256 rewardEpoch -) -``` - -Unexpected failure. This should be a rare occurrence. - -
-
- -
- -### `UseGoodRandomSet` { #ev_usegoodrandomset } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -event UseGoodRandomSet( - bool useGoodRandom, - uint256 maxWaitForGoodRandomSeconds -) -``` - -Emitted when the requirement to provide good random numbers has changed. - -As part of [the FTSO protocol](https://docs.flare.network/tech/ftso/#data-submission-process), -data providers must submit a random number along with their price reveals. -When good random numbers are enforced, all providers that submit a hash must then -submit a reveal with a random number or they will be punished. -This is a measure against random number manipulation. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `useGoodRandom` | `bool` | Whether good random numbers are now enforced or not. | -| `maxWaitForGoodRandomSeconds` | `uint256` | Max number of seconds to wait for a good random number to be submitted. | - -
-
- -
- -
- -## Functions - -
- -### `activate` { #fn_activate_0f15f4c0 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function activate( -) external; -``` - -Activates FTSO manager ([`daemonize`](#fn_daemonize_6d0e8c34) will run jobs). - -
-
- -
- -### `active` { #fn_active_02fb0c5e } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function active( -) external view returns ( - bool); -``` - -Returns whether the FTSO Manager is [`active`](#fn_active_02fb0c5e) or not. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | bool Active status. | -
-
- -
- -### `addFtso` { #fn_addftso_2663f1b4 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function addFtso( - contract IIFtso _ftso -) external; -``` - -Adds FTSO to the list of managed FTSOs, to support a new price pair. -All FTSOs in a multi-asset FTSO must be managed by the same FTSO manager. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | FTSO contract address to add. | - -
-
- -
- -### `addFtsosBulk` { #fn_addftsosbulk_d429cfe5 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function addFtsosBulk( - contract IIFtso[] _ftsos -) external; -``` - -Adds a list of FTSOs to the list of managed FTSOs, to support new price pairs. -All FTSOs in a multi-asset FTSO must be managed by the same FTSO manager. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsos` | `contract IIFtso[]` | Array of FTSO contract addresses to add. | - -
-
- -
- -### `currentRewardEpochEnds` { #fn_currentrewardepochends_d89c39e6 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function currentRewardEpochEnds( -) external view returns ( - uint256); -``` - -Returns when the current reward epoch finishes. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Time in seconds since the UNIX epoch when the current reward epoch will finish. | -
-
- -
- -### `daemonize` { #fn_daemonize_6d0e8c34 } - -
-Defined in `IFlareDaemonize` ([Docs](./IFlareDaemonize.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFlareDaemonize.sol)). -
- -
- -```solidity -function daemonize( -) external returns ( - bool); -``` - -Implement this function to receive a trigger from the [`FlareDaemon`](./FlareDaemon.md). -The trigger method is called by the validator right at the end of block state transition. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | bool Whether the contract is still active after the call. Currently unused. | -
-
- -
- -### `getContractName` { #fn_getcontractname_f5f5ba72 } - -
-Defined in `IFlareDaemonize` ([Docs](./IFlareDaemonize.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFlareDaemonize.sol)). -
- -
- -```solidity -function getContractName( -) external view returns ( - string); -``` - -Implement this function to allow updating daemonized contracts through the [`AddressUpdater`](./AddressUpdater.md). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `string` | string Contract name. | -
-
- -
- -### `getCurrentPriceEpochData` { #fn_getcurrentpriceepochdata_93a79025 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getCurrentPriceEpochData( -) external view returns ( - uint256 _priceEpochId, - uint256 _priceEpochStartTimestamp, - uint256 _priceEpochEndTimestamp, - uint256 _priceEpochRevealEndTimestamp, - uint256 _currentTimestamp); -``` - -Returns timing information for the current price epoch. -All intervals are half-closed: end time is not included. -All timestamps are in seconds since UNIX epoch. - -See the [FTSO page](https://docs.flare.network/tech/ftso/#data-submission-process) -for information about the different submission phases. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_priceEpochId` | `uint256` | Price epoch ID. | -| `_priceEpochStartTimestamp` | `uint256` | Beginning of the commit phase. | -| `_priceEpochEndTimestamp` | `uint256` | End of the commit phase. | -| `_priceEpochRevealEndTimestamp` | `uint256` | End of the reveal phase. | -| `_currentTimestamp` | `uint256` | Current time. | -
-
- -
- -### `getCurrentPriceEpochId` { #fn_getcurrentpriceepochid_08a7f402 } - -
-Defined in `IFtsoManagerGenesis` ([Docs](./IFtsoManagerGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoManagerGenesis.sol)). -
- -
- -```solidity -function getCurrentPriceEpochId( -) external view returns ( - uint256 _priceEpochId); -``` - -Returns current price epoch ID. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_priceEpochId` | `uint256` | Currently running epoch ID. IDs are consecutive numbers starting from zero. | -
-
- -
- -### `getCurrentRewardEpoch` { #fn_getcurrentrewardepoch_e7c830d4 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getCurrentRewardEpoch( -) external view returns ( - uint256); -``` - -Returns current reward epoch ID (the one currently running). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Reward epoch ID. A monotonically increasing integer. | -
-
- -
- -### `getElasticBandWidthPPMFtso` { #fn_getelasticbandwidthppmftso_5bb44e9a } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function getElasticBandWidthPPMFtso( - contract IIFtso _ftso -) external view returns ( - uint256); -``` - -Returns the secondary band's width in PPM (parts-per-million) of the median value, -for a given FTSO. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | The queried FTSO contract address. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Secondary band width in PPM. To obtain the actual band width, divide this number by 10^6 and multiply by the price median value. | -
-
- -
- -### `getFallbackMode` { #fn_getfallbackmode_4b48dd5e } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getFallbackMode( -) external view returns ( - bool _fallbackMode, - contract IIFtso[] _ftsos, - bool[] _ftsoInFallbackMode); -``` - -Returns whether the FTSO Manager is currently in fallback mode. - -In this mode only submissions from trusted providers are used. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_fallbackMode` | `bool` | True if fallback mode is enabled for the manager. | -| `_ftsos` | `contract IIFtso[]` | Array of all currently active FTSO assets. | -| `_ftsoInFallbackMode` | `bool[]` | Boolean array indicating which FTSO assets are in fallback mode. If the FTSO Manager is in fallback mode then ALL FTSOs are in fallback mode. | -
-
- -
- -### `getFtsos` { #fn_getftsos_ce69f833 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getFtsos( -) external view returns ( - contract IIFtso[] _ftsos); -``` - -Returns the list of currently [`active`](#fn_active_02fb0c5e) FTSOs. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IIFtso[]` | Array of contract addresses for the FTSOs. | -
-
- -
- -### `getLastUnprocessedPriceEpochData` { #fn_getlastunprocessedpriceepochdata_6ca051e6 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function getLastUnprocessedPriceEpochData( -) external view returns ( - uint256 _lastUnprocessedPriceEpoch, - uint256 _lastUnprocessedPriceEpochRevealEnds, - bool _lastUnprocessedPriceEpochInitialized); -``` - -Returns information regarding the currently unprocessed price epoch. -This epoch is not necessarily the last one, in case the network halts for some -time due to validator node problems, for example. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_lastUnprocessedPriceEpoch` | `uint256` | ID of the price epoch that is currently waiting finalization. | -| `_lastUnprocessedPriceEpochRevealEnds` | `uint256` | When that price epoch can be finalized, in seconds since UNIX epoch. | -| `_lastUnprocessedPriceEpochInitialized` | `bool` | Whether this price epoch has been already initialized and therefore it must be finalized before the corresponding reward epoch can be finalized. | -
-
- -
- -### `getPriceEpochConfiguration` { #fn_getpriceepochconfiguration_144e1591 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getPriceEpochConfiguration( -) external view returns ( - uint256 _firstPriceEpochStartTs, - uint256 _priceEpochDurationSeconds, - uint256 _revealEpochDurationSeconds); -``` - -Returns the current values for price epoch timing configuration. - -See the [FTSO page](https://docs.flare.network/tech/ftso/#data-submission-process) -for information about the different submission phases. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_firstPriceEpochStartTs` | `uint256` | Timestamp, in seconds since UNIX epoch, of the first price epoch. | -| `_priceEpochDurationSeconds` | `uint256` | Duration in seconds of the commit phase. | -| `_revealEpochDurationSeconds` | `uint256` | Duration in seconds of the reveal phase. | -
-
- -
- -### `getRewardEpochConfiguration` { #fn_getrewardepochconfiguration_1cb513f7 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochConfiguration( -) external view returns ( - uint256 _firstRewardEpochStartTs, - uint256 _rewardEpochDurationSeconds); -``` - -Returns the current values for reward epoch timing configuration. - -See the [Reward epochs](https://docs.flare.network/tech/ftso/#vote-power) box. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_firstRewardEpochStartTs` | `uint256` | Timestamp, in seconds since UNIX epoch, of the first reward epoch. | -| `_rewardEpochDurationSeconds` | `uint256` | Duration in seconds of the reward epochs. | -
-
- -
- -### `getRewardEpochData` { #fn_getrewardepochdata_e5399da3 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochData( - uint256 _rewardEpochId -) external view returns ( - struct IIFtsoManager.RewardEpochData); -``` - -Returns data regarding a specific reward epoch ID. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpochId` | `uint256` | Epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IIFtsoManager.RewardEpochData` | RewardEpochData Its associated data. | -
-
- -
- -### `getRewardEpochToExpireNext` { #fn_getrewardepochtoexpirenext_3e7ff857 } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochToExpireNext( -) external view returns ( - uint256); -``` - -Return reward epoch that will expire next, when a new reward epoch is initialized. - -Reward epochs older than 90 days expire, and any unclaimed rewards in them become -inaccessible. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Reward epoch ID. | -
-
- -
- -### `getRewardEpochVotePowerBlock` { #fn_getrewardepochvotepowerblock_f2edab5a } - -
-Defined in `IFtsoManager` ([Docs](./IFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoManager.sol)). -
- -
- -```solidity -function getRewardEpochVotePowerBlock( - uint256 _rewardEpoch -) external view returns ( - uint256); -``` - -Returns the [vote power block](https://docs.flare.network/tech/ftso/#vote-power) -that was used for a past reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | The queried reward epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 The block number of that reward epoch's vote power block. | -
-
- -
- -### `getRewardExpiryOffsetSeconds` { #fn_getrewardexpiryoffsetseconds_ec31db0c } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function getRewardExpiryOffsetSeconds( -) external view returns ( - uint256); -``` - -Returns the currently configured reward expiration time. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Unclaimed rewards accrued in reward epochs more than this amount of seconds in the past expire and become inaccessible. | -
-
- -
- -### `notInitializedFtsos` { #fn_notinitializedftsos_823033a9 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function notInitializedFtsos( - contract IIFtso -) external view returns ( - bool); -``` - -Returns whether an FTSO has been initialized. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | bool Initialization state. | -
-
- -
- -### `removeFtso` { #fn_removeftso_a670ff87 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function removeFtso( - contract IIFtso _ftso -) external; -``` - -Removes an FTSO from the list of managed FTSOs. -Reverts if FTSO is used in a multi-asset FTSO. -Deactivates the `_ftso`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | FTSO contract address to remove. | - -
-
- -
- -### `replaceFtso` { #fn_replaceftso_3758e679 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function replaceFtso( - contract IIFtso _ftsoToAdd, - bool copyCurrentPrice, - bool copyAssetOrAssetFtsos -) external; -``` - -Replaces one FTSO with another with the same symbol. -All FTSOs in a multi-asset FTSO must be managed by the same FTSO manager. -Deactivates the old FTSO. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoToAdd` | `contract IIFtso` | FTSO contract address to add. An existing FTSO with the same symbol will be removed. | -| `copyCurrentPrice` | `bool` | When true, initializes the new FTSO with the current price of the previous FTSO. | -| `copyAssetOrAssetFtsos` | `bool` | When true, initializes the new FTSO with the current asset or asset FTSOs of the previous FTSO. | - -
-
- -
- -### `replaceFtsosBulk` { #fn_replaceftsosbulk_758ff1da } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function replaceFtsosBulk( - contract IIFtso[] _ftsosToAdd, - bool copyCurrentPrice, - bool copyAssetOrAssetFtsos -) external; -``` - -Replaces a list of FTSOs with other FTSOs with the same symbol. -All FTSOs in a multi-asset FTSO must be managed by the same FTSO manager. -Deactivates the old FTSOs. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsosToAdd` | `contract IIFtso[]` | Array of FTSO contract addresses to add. Every existing FTSO with the same symbols will be removed. | -| `copyCurrentPrice` | `bool` | When true, initializes the new FTSOs with the current price of the previous FTSOs. | -| `copyAssetOrAssetFtsos` | `bool` | When true, initializes the new FTSOs with the current asset or asset FTSOs of the previous FTSOs. | - -
-
- -
- -### `rewardEpochDurationSeconds` { #fn_rewardepochdurationseconds_85f3c9c9 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function rewardEpochDurationSeconds( -) external view returns ( - uint256); -``` - -Currently configured reward epoch duration. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Reward epoch duration, in seconds. | -
-
- -
- -### `rewardEpochs` { #fn_rewardepochs_a795f409 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function rewardEpochs( - uint256 _rewardEpochId -) external view returns ( - uint256 _votepowerBlock, - uint256 _startBlock, - uint256 _startTimestamp); -``` - -Returns information about a reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpochId` | `uint256` | The epoch ID to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_votepowerBlock` | `uint256` | The [vote power block](https://docs.flare.network/tech/ftso/#vote-power) of the epoch. | -| `_startBlock` | `uint256` | The first block of the epoch. | -| `_startTimestamp` | `uint256` | Timestamp of the epoch start, in seconds since UNIX epoch. | -
-
- -
- -### `rewardEpochsStartTs` { #fn_rewardepochsstartts_a578f55b } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function rewardEpochsStartTs( -) external view returns ( - uint256); -``` - -Time when the current reward epoch started. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Timestamp, in seconds since UNIX epoch. | -
-
- -
- -### `setFallbackMode` { #fn_setfallbackmode_ff882fbb } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function setFallbackMode( - bool _fallbackMode -) external; -``` - -Sets whether the FTSO Manager is currently in fallback mode. -In this mode only submissions from trusted providers are used. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_fallbackMode` | `bool` | True if fallback mode is enabled. | - -
-
- -
- -### `setFtsoAsset` { #fn_setftsoasset_6b65cc34 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function setFtsoAsset( - contract IIFtso _ftso, - contract IIVPToken _asset -) external; -``` - -Sets the asset tracked by an FTSO. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | The FTSO contract address. | -| `_asset` | `contract IIVPToken` | The [`VPToken`](./VPToken.md) contract address of the asset to track. | - -
-
- -
- -### `setFtsoAssetFtsos` { #fn_setftsoassetftsos_a93a6f42 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function setFtsoAssetFtsos( - contract IIFtso _ftso, - contract IIFtso[] _assetFtsos -) external; -``` - -Sets an array of FTSOs to be tracked by a multi-asset FTSO. -FTSOs implicitly determine the FTSO assets. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | The multi-asset FTSO contract address. | -| `_assetFtsos` | `contract IIFtso[]` | Array of FTSOs to be tracked. | - -
-
- -
- -### `setFtsoFallbackMode` { #fn_setftsofallbackmode_af946af7 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function setFtsoFallbackMode( - contract IIFtso _ftso, - bool _fallbackMode -) external; -``` - -Sets whether an FTSO is currently in fallback mode. -In this mode only submissions from trusted providers are used. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | The FTSO contract address. | -| `_fallbackMode` | `bool` | Fallback mode. | - -
-
- -
- -### `setGovernanceParameters` { #fn_setgovernanceparameters_13226793 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function setGovernanceParameters( - uint256 _updateTs, - uint256 _maxVotePowerNatThresholdFraction, - uint256 _maxVotePowerAssetThresholdFraction, - uint256 _lowAssetUSDThreshold, - uint256 _highAssetUSDThreshold, - uint256 _highAssetTurnoutThresholdBIPS, - uint256 _lowNatTurnoutThresholdBIPS, - uint256 _elasticBandRewardBIPS, - uint256 _rewardExpiryOffsetSeconds, - address[] _trustedAddresses -) external; -``` - -Sets governance parameters for FTSOs - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_updateTs` | `uint256` | Time, in seconds since UNIX epoch, when updated settings should be pushed to FTSOs. | -| `_maxVotePowerNatThresholdFraction` | `uint256` | High threshold for native token vote power per voter. | -| `_maxVotePowerAssetThresholdFraction` | `uint256` | High threshold for asset vote power per voter | -| `_lowAssetUSDThreshold` | `uint256` | Threshold for low asset vote power (in scaled USD). | -| `_highAssetUSDThreshold` | `uint256` | Threshold for high asset vote power (in scaled USD). | -| `_highAssetTurnoutThresholdBIPS` | `uint256` | Threshold for high asset turnout (in BIPS). | -| `_lowNatTurnoutThresholdBIPS` | `uint256` | Threshold for low nat turnout (in BIPS). | -| `_elasticBandRewardBIPS` | `uint256` | Secondary reward band, where _elasticBandRewardBIPS goes to the secondary band and 10000 - _elasticBandRewardBIPS to the primary (IQR) band. | -| `_rewardExpiryOffsetSeconds` | `uint256` | Reward epochs closed earlier than block.timestamp - _rewardExpiryOffsetSeconds expire. | -| `_trustedAddresses` | `address[]` | Trusted addresses will be used as a fallback mechanism for setting the price. | - -
-
- -
- -### `setInitialRewardData` { #fn_setinitialrewarddata_e080a970 } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -```solidity -function setInitialRewardData( - uint256 _nextRewardEpochToExpire, - uint256 _rewardEpochsLength, - uint256 _currentRewardEpochEnds -) external; -``` - -Set reward data to values from old ftso manager. -Can only be called before activation. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nextRewardEpochToExpire` | `uint256` | See `getRewardEpochToExpireNext`. | -| `_rewardEpochsLength` | `uint256` | See `getRewardEpochConfiguration`. | -| `_currentRewardEpochEnds` | `uint256` | See `getCurrentRewardEpoch`. | - -
-
- -
- -### `switchToFallbackMode` { #fn_switchtofallbackmode_e22fdece } - -
-Defined in `IFlareDaemonize` ([Docs](./IFlareDaemonize.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFlareDaemonize.sol)). -
- -
- -```solidity -function switchToFallbackMode( -) external returns ( - bool); -``` - -This function will be called after an error is caught in [`daemonize`](#fn_daemonize_6d0e8c34). -It will switch the contract to a simpler fallback mode, which hopefully works when full mode doesn't. -Not every contract needs to support fallback mode ([`FtsoManager`](./FtsoManager.md) does), so this method may be empty. -Switching back to normal mode is left to the contract (typically a governed method call). -This function may be called due to low-gas error, so it shouldn't use more than ~30.000 gas. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | True if switched to fallback mode, false if already in fallback mode or if fallback mode is not supported. | -
-
- -
- -
- -## Structures - -
- -### `RewardEpochData` { #st_rewardepochdata } - -
-Defined in `IIFtsoManager` ([Docs](./IIFtsoManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/ftso/interface/IIFtsoManager.sol)). -
- -
- -
-```solidity -struct RewardEpochData { - uint256 votepowerBlock; - uint256 startBlock; - uint256 startTimestamp; -} -``` - -
- -
- diff --git a/docs/apis/smart-contracts/IIFtsoRegistry.md b/docs/apis/smart-contracts/IIFtsoRegistry.md deleted file mode 100644 index 0bccf6a46..000000000 --- a/docs/apis/smart-contracts/IIFtsoRegistry.md +++ /dev/null @@ -1,639 +0,0 @@ ---- -title: IIFtsoRegistry -search: - boost: 0.5 ---- - - - -# `IIFtsoRegistry` { #ct_iiftsoregistry } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/interface/IIFtsoRegistry.sol) | Inherits from [IFtsoRegistry](./IFtsoRegistry.md) -
- -
- -Internal interface for the [`FtsoRegistry`](./FtsoRegistry.md) contract. - -
- -
- -## Functions - -
- -### `addFtso` { #fn_addftso_2663f1b4 } - -
-Defined in `IIFtsoRegistry` ([Docs](./IIFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/interface/IIFtsoRegistry.sol)). -
- -
- -```solidity -function addFtso( - contract IIFtso _ftsoContract -) external returns ( - uint256); -``` - -Add a new FTSO contract to the registry. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoContract` | `contract IIFtso` | New target FTSO contract. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The FTSO index assigned to the new asset. | -
-
- -
- -### `getAllCurrentPrices` { #fn_getallcurrentprices_58f9296f } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getAllCurrentPrices( -) external view returns ( - struct IFtsoRegistry.PriceInfo[]); -``` - -Returns the current price of all supported assets. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IFtsoRegistry.PriceInfo[]` | Array of `PriceInfo` structures. | -
-
- -
- -### `getCurrentPrice` { #fn_getcurrentprice_c55d0f56 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPrice( - uint256 _ftsoIndex -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Public view function to get the current price of a given active FTSO index. -Reverts if the index is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -
-
- -
- -### `getCurrentPrice` { #fn_getcurrentprice_42a0f243 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPrice( - string _symbol -) external view returns ( - uint256 _price, - uint256 _timestamp); -``` - -Public view function to get the current price of a given active asset symbol. -Reverts if the symbol is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Symbol to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`ASSET_PRICE_USD_DECIMALS`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -
-
- -
- -### `getCurrentPriceWithDecimals` { #fn_getcurrentpricewithdecimals_257cbd3a } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimals( - uint256 _assetIndex -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Public view function to get the current price and decimals of a given active FTSO index. -Reverts if the index is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_assetIndex` | `uint256` | Index to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`_assetPriceUsdDecimals`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the `_price`. | -
-
- -
- -### `getCurrentPriceWithDecimals` { #fn_getcurrentpricewithdecimals_a69afdc6 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPriceWithDecimals( - string _symbol -) external view returns ( - uint256 _price, - uint256 _timestamp, - uint256 _assetPriceUsdDecimals); -``` - -Public view function to get the current price and decimals of a given active asset symbol. -Reverts if the symbol is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Symbol to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_price` | `uint256` | Current price of the asset in USD multiplied by 10^`_assetPriceUsdDecimals`. | -| `_timestamp` | `uint256` | Timestamp for when this price was updated, in seconds since UNIX epoch. | -| `_assetPriceUsdDecimals` | `uint256` | Number of decimals used to return the `_price`. | -
-
- -
- -### `getCurrentPricesByIndices` { #fn_getcurrentpricesbyindices_6ba31fa1 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPricesByIndices( - uint256[] _indices -) external view returns ( - struct IFtsoRegistry.PriceInfo[]); -``` - -Returns the current price of a list of indices. -Reverts if any of the indices is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_indices` | `uint256[]` | Array of indices to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IFtsoRegistry.PriceInfo[]` | Array of `PriceInfo` structures. | -
-
- -
- -### `getCurrentPricesBySymbols` { #fn_getcurrentpricesbysymbols_79d5ea4b } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getCurrentPricesBySymbols( - string[] _symbols -) external view returns ( - struct IFtsoRegistry.PriceInfo[]); -``` - -Returns the current price of a list of asset symbols. -Reverts if any of the symbols is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbols` | `string[]` | Array of symbols to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct IFtsoRegistry.PriceInfo[]` | Array of `PriceInfo` structures. | -
-
- -
- -### `getFtso` { #fn_getftso_d75f6d81 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getFtso( - uint256 _activeFtso -) external view returns ( - contract IIFtso _activeFtsoAddress); -``` - -Returns the address of the FTSO contract for a given index. -Reverts if unsupported index is passed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_activeFtso` | `uint256` | The queried index. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_activeFtsoAddress` | `contract IIFtso` | FTSO contract address for the queried index. | -
-
- -
- -### `getFtsoBySymbol` { #fn_getftsobysymbol_97da6af4 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getFtsoBySymbol( - string _symbol -) external view returns ( - contract IIFtso _activeFtsoAddress); -``` - -Returns the address of the FTSO contract for a given symbol. -Reverts if unsupported symbol is passed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | The queried symbol. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_activeFtsoAddress` | `contract IIFtso` | FTSO contract address for the queried symbol. | -
-
- -
- -### `getFtsoIndex` { #fn_getftsoindex_e848da30 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getFtsoIndex( - string _symbol -) external view returns ( - uint256 _assetIndex); -``` - -Returns the FTSO index corresponding to a given asset symbol. -Reverts if the symbol is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Symbol to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_assetIndex` | `uint256` | The corresponding asset index. | -
-
- -
- -### `getFtsoSymbol` { #fn_getftsosymbol_136d3f64 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getFtsoSymbol( - uint256 _ftsoIndex -) external view returns ( - string _symbol); -``` - -Returns the asset symbol corresponding to a given FTSO index. -Reverts if the index is not supported. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_symbol` | `string` | The corresponding asset symbol. | -
-
- -
- -### `getFtsos` { #fn_getftsos_9cb47538 } - -
-Defined in `IFtsoRegistryGenesis` ([Docs](./IFtsoRegistryGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFtsoRegistryGenesis.sol)). -
- -
- -```solidity -function getFtsos( - uint256[] _indices -) external view returns ( - contract IFtsoGenesis[] _ftsos); -``` - -Get the addresses of the active FTSOs at the given indices. -Reverts if any of the provided indices is non-existing or inactive. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_indices` | `uint256[]` | Array of FTSO indices to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IFtsoGenesis[]` | The array of FTSO addresses. | -
-
- -
- -### `getSupportedFtsos` { #fn_getsupportedftsos_a40060ba } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedFtsos( -) external view returns ( - contract IIFtso[] _ftsos); -``` - -Get array of all FTSO contracts for all supported asset indices. -The index of FTSO in returned array does not necessarily correspond to the asset's index. -Due to deletion, some indices might be unsupported. - -Use [`getSupportedIndicesAndFtsos`](#fn_getsupportedindicesandftsos_06a2ba29) to retrieve pairs of correct indices and FTSOs, -where possible "null" holes are readily apparent. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSOs. | -
-
- -
- -### `getSupportedIndices` { #fn_getsupportedindices_798aac5b } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndices( -) external view returns ( - uint256[] _supportedIndices); -``` - -Returns the indices of the currently supported FTSOs. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all active FTSO indices in increasing order. | -
-
- -
- -### `getSupportedIndicesAndFtsos` { #fn_getsupportedindicesandftsos_06a2ba29 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndicesAndFtsos( -) external view returns ( - uint256[] _supportedIndices, - contract IIFtso[] _ftsos); -``` - -Get all supported indices and corresponding FTSO addresses. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all supported indices. | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSO addresses. | -
-
- -
- -### `getSupportedIndicesAndSymbols` { #fn_getsupportedindicesandsymbols_e68f283b } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndicesAndSymbols( -) external view returns ( - uint256[] _supportedIndices, - string[] _supportedSymbols); -``` - -Get all supported indices and corresponding symbols. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all supported indices. | -| `_supportedSymbols` | `string[]` | Array of all supported symbols. | -
-
- -
- -### `getSupportedIndicesSymbolsAndFtsos` { #fn_getsupportedindicessymbolsandftsos_7687542c } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedIndicesSymbolsAndFtsos( -) external view returns ( - uint256[] _supportedIndices, - string[] _supportedSymbols, - contract IIFtso[] _ftsos); -``` - -Get all supported indices, symbols, and corresponding FTSO addresses. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of all supported indices. | -| `_supportedSymbols` | `string[]` | Array of all supported symbols. | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSO addresses. | -
-
- -
- -### `getSupportedSymbols` { #fn_getsupportedsymbols_ce1c0e4d } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedSymbols( -) external view returns ( - string[] _supportedSymbols); -``` - -Returns the symbols of the currently supported FTSOs. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedSymbols` | `string[]` | Array of all active FTSO symbols in increasing order. | -
-
- -
- -### `getSupportedSymbolsAndFtsos` { #fn_getsupportedsymbolsandftsos_0cf48497 } - -
-Defined in `IFtsoRegistry` ([Docs](./IFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRegistry.sol)). -
- -
- -```solidity -function getSupportedSymbolsAndFtsos( -) external view returns ( - string[] _supportedSymbols, - contract IIFtso[] _ftsos); -``` - -Get all supported symbols and corresponding FTSO addresses. -Active FTSOs are ones that currently receive price feeds. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedSymbols` | `string[]` | Array of all supported symbols. | -| `_ftsos` | `contract IIFtso[]` | Array of all supported FTSO addresses. | -
-
- -
- -### `removeFtso` { #fn_removeftso_a670ff87 } - -
-Defined in `IIFtsoRegistry` ([Docs](./IIFtsoRegistry.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/interface/IIFtsoRegistry.sol)). -
- -
- -```solidity -function removeFtso( - contract IIFtso _ftso -) external; -``` - -Removes the FTSO and keeps part of the history. -Reverts if the provided address is not supported. - -From now on, the index this asset was using is "reserved" and cannot be used again. -It will not be returned in any list of currently supported assets. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftso` | `contract IIFtso` | Address of the FTSO contract to remove. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IIFtsoRewardManager.md b/docs/apis/smart-contracts/IIFtsoRewardManager.md deleted file mode 100644 index 2a389ba13..000000000 --- a/docs/apis/smart-contracts/IIFtsoRewardManager.md +++ /dev/null @@ -1,1419 +0,0 @@ ---- -title: IIFtsoRewardManager -search: - boost: 0.5 ---- - - - -# `IIFtsoRewardManager` { #ct_iiftsorewardmanager } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol) | Inherits from [IFtsoRewardManager](./IFtsoRewardManager.md), [IIInflationReceiver](./IIInflationReceiver.md), [IITokenPool](./IITokenPool.md) -
- -
- -Internal interface for the [`FtsoRewardManager`](./FtsoRewardManager.md). - -
- -
- -## Events - -
- -### `DailyAuthorizedInflationSet` { #ev_dailyauthorizedinflationset } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -event DailyAuthorizedInflationSet( - uint256 authorizedAmountWei -) -``` - -Emitted when the contract's daily authorized inflation has been set. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `authorizedAmountWei` | `uint256` | Authorized amount of native tokens, in wei. | - -
-
- -
- -### `FeePercentageChanged` { #ev_feepercentagechanged } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event FeePercentageChanged( - address dataProvider, - uint256 value, - uint256 validFromEpoch -) -``` - -Emitted when a data provider changes its fee. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `dataProvider` | `address` | Address of the data provider. | -| `value` | `uint256` | New fee, in BIPS. | -| `validFromEpoch` | `uint256` | Epoch ID where the new fee takes effect. | - -
-
- -
- -### `FtsoRewardManagerActivated` { #ev_ftsorewardmanageractivated } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event FtsoRewardManagerActivated( - address ftsoRewardManager -) -``` - -Emitted when the reward manager contract is activated. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftsoRewardManager` | `address` | The reward manager contract. | - -
-
- -
- -### `FtsoRewardManagerDeactivated` { #ev_ftsorewardmanagerdeactivated } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event FtsoRewardManagerDeactivated( - address ftsoRewardManager -) -``` - -Emitted when the reward manager contract is deactivated. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftsoRewardManager` | `address` | The reward manager contract. | - -
-
- -
- -### `InflationReceived` { #ev_inflationreceived } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -event InflationReceived( - uint256 amountReceivedWei -) -``` - -Emitted when the contract has received the daily inflation amount. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `amountReceivedWei` | `uint256` | Received amount of native tokens, in wei. | - -
-
- -
- -### `RewardClaimed` { #ev_rewardclaimed } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event RewardClaimed( - address dataProvider, - address whoClaimed, - address sentTo, - uint256 rewardEpoch, - uint256 amount -) -``` - -Emitted when a data provider claims its FTSO rewards. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `dataProvider` | `address` | Address of the data provider that accrued the reward. | -| `whoClaimed` | `address` | Address that actually performed the claim. | -| `sentTo` | `address` | Address that received the reward. | -| `rewardEpoch` | `uint256` | ID of the reward epoch where the reward was accrued. | -| `amount` | `uint256` | Amount of rewarded native tokens (wei). | - -
-
- -
- -### `RewardClaimsEnabled` { #ev_rewardclaimsenabled } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event RewardClaimsEnabled( - uint256 rewardEpochId -) -``` - -Emitted when reward claims have been enabled. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `rewardEpochId` | `uint256` | First claimable reward epoch. | - -
-
- -
- -### `RewardClaimsExpired` { #ev_rewardclaimsexpired } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event RewardClaimsExpired( - uint256 rewardEpochId -) -``` - -Unclaimed rewards have expired and are now inaccessible. - -`getUnclaimedReward()` can be used to retrieve more information. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `rewardEpochId` | `uint256` | ID of the reward epoch that has just expired. | - -
-
- -
- -### `RewardsBurned` { #ev_rewardsburned } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -event RewardsBurned( - uint256 amountBurnedWei -) -``` - -Emitted when unclaimed rewards are burned. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `amountBurnedWei` | `uint256` | Burned amount of native tokens, in wei. | - -
-
- -
- -### `RewardsDistributed` { #ev_rewardsdistributed } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event RewardsDistributed( - address ftso, - uint256 epochId, - address[] addresses, - uint256[] rewards -) -``` - -Emitted every price epoch, when rewards have been distributed to each contributing data provider. -Note that rewards are not claimable until the reward epoch finishes. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `ftso` | `address` | Address of the FTSO that generated the rewards. | -| `epochId` | `uint256` | ID of the reward epoch where the rewards were accrued. | -| `addresses` | `address[]` | Data provider addresses that have rewards to claim. | -| `rewards` | `uint256[]` | Amounts available for claiming (wei). | - -
-
- -
- -### `UnearnedRewardsAccrued` { #ev_unearnedrewardsaccrued } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -event UnearnedRewardsAccrued( - uint256 epochId, - uint256 reward -) -``` - -Emitted when rewards cannot be distributed during a reward epoch -(for example, because the FTSO went into fallback mode) and they are accrued -for later burning. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `epochId` | `uint256` | ID of the reward epoch where the reward was accrued. | -| `reward` | `uint256` | Total amount of accrued rewards (wei). | - -
-
- -
- -
- -## Functions - -
- -### `accrueUnearnedRewards` { #fn_accrueunearnedrewards_67dcac53 } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -function accrueUnearnedRewards( - uint256 epochId, - uint256 priceEpochDurationSeconds, - uint256 priceEpochEndTime -) external; -``` - -Accrue unearned rewards for a given price epoch. -Typically done when the FTSO is in fallback mode or because of insufficient vote power. -Simply accrue them so they will not be distributed and will be burned later. - -The amount of rewards that will be burned is calculated in the same way as in [`distributeRewards`](#fn_distributerewards_a9b79e17). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `epochId` | `uint256` | Price epoch ID. | -| `priceEpochDurationSeconds` | `uint256` | Duration of price epochs (180s). | -| `priceEpochEndTime` | `uint256` | Timestamp of the price epoch end time (end of submit period), in seconds since UNIX epoch. | - -
-
- -
- -### `activate` { #fn_activate_0f15f4c0 } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -function activate( -) external; -``` - -Activates reward manager (allows claiming rewards). - -
-
- -
- -### `active` { #fn_active_02fb0c5e } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function active( -) external view returns ( - bool); -``` - -Whether rewards can be claimed from this reward manager. - -
-
- -
- -### `autoClaim` { #fn_autoclaim_8dc305fa } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function autoClaim( - address[] _rewardOwners, - uint256 _rewardEpoch -) external; -``` - -Allows claiming rewards simultaneously for a list of reward owners and all unclaimed epochs before the -specified one. - -This is meant as a convenience all-in-one reward claiming method to be used both by reward owners and -[registered executors](https://docs.flare.network/tech/automatic-claiming/#registered-claiming-process). -It performs a series of operations, besides claiming rewards: - -* If a reward owner has enabled its -[Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account), rewards are also -claimed for the PDA and the total claimed amount is sent to that PDA. -Otherwise, the claimed amount is sent to the reward owner's account. - -* Claimed amount is automatically wrapped through the [`WNat`](./WNat.md) contract. - -* If the caller is a registered executor with a non-zero fee, the fee is paid to the executor for each claimed -address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwners` | `address[]` | List of reward owners to claim for. | -| `_rewardEpoch` | `uint256` | Last reward epoch ID to claim for. All previous epochs with pending rewards will be claimed too. | - -
-
- -
- -### `claim` { #fn_claim_b2c12192 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function claim( - address _rewardOwner, - address payable _recipient, - uint256 _rewardEpoch, - bool _wrap -) external returns ( - uint256 _rewardAmount); -``` - -Allows the caller to [`claim`](#fn_claim_b2c12192) rewards for a reward owner. -The caller does not have to be the owner of the rewards, but must be approved by the owner to [`claim`](#fn_claim_b2c12192) on his -behalf by using `setClaimExecutors` on the `claimSetupManager`. - -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by percentage. -Reverts if `msg.sender` is delegating by amount. - -Anybody can call this method, but rewards can only be sent to the reward owner, therefore no funds can be -stolen. However, by limiting the authorized callers, the owner can control the timing of the calls. - -When the reward owner is the caller, rewards can be sent to any recipient set by `setAllowedClaimRecipients` on -the `claimSetupManager`. -The reward owner's [Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) -is always an authorized recipient. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | Address of the reward owner. | -| `_recipient` | `address payable` | Address to transfer claimed rewards to. | -| `_rewardEpoch` | `uint256` | Last reward epoch to claim for. All previous epochs with pending rewards will be claimed too. | -| `_wrap` | `bool` | Whether claimed rewards should be wrapped through the [`WNat`](./WNat.md) contract before transferring them to the `_recipient`. This parameter is offered as a convenience. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Total amount of claimed rewards (wei). | -
-
- -
- -### `claimFromDataProviders` { #fn_claimfromdataproviders_21bb25af } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function claimFromDataProviders( - address _rewardOwner, - address payable _recipient, - uint256[] _rewardEpochs, - address[] _dataProviders, - bool _wrap -) external returns ( - uint256 _rewardAmount); -``` - -Allows the caller to [`claim`](#fn_claim_b2c12192) rewards for a reward owner from specific data providers. -The caller does not have to be the owner of the rewards, but must be approved by the owner to [`claim`](#fn_claim_b2c12192) on his -behalf by using `setClaimExecutors` on the `claimSetupManager`. - -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by amount (explicit delegation). -Reverts if `msg.sender` is delegating by percentage. - -Anybody can call this method, but rewards can only be sent to the reward owner, therefore no funds can be -stolen. However, by limiting the authorized callers, the owner can control the timing of the calls. - -When the reward owner is the caller, rewards can be sent to any recipient set by `setAllowedClaimRecipients` on -the `claimSetupManager`. -The reward owner's [Personal Delegation Account](https://docs.flare.network/tech/personal-delegation-account) -is always an authorized recipient. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | Address of the reward owner. | -| `_recipient` | `address payable` | Address to transfer claimed rewards to. | -| `_rewardEpochs` | `uint256[]` | Array of reward epoch IDs to claim for. | -| `_dataProviders` | `address[]` | Array of addresses of the data providers to claim the reward from. | -| `_wrap` | `bool` | Whether claimed rewards should be wrapped through the [`WNat`](./WNat.md) contract before transferring them to the `_recipient`. This parameter is offered as a convenience. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Total amount of claimed rewards (wei). | -
-
- -
- -### `claimReward` { #fn_claimreward_b2af870a } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function claimReward( - address payable _recipient, - uint256[] _rewardEpochs -) external returns ( - uint256 _rewardAmount); -``` - -Allows a percentage delegator to [`claim`](#fn_claim_b2c12192) rewards. -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by percentage. - -**This function is deprecated**: use [`claim`](#fn_claim_b2c12192) instead. - -Reverts if `msg.sender` is delegating by amount. -Claims for all unclaimed reward epochs to the 'max(_rewardEpochs)'. -Retained for backward compatibility. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipient` | `address payable` | Address to transfer funds to. | -| `_rewardEpochs` | `uint256[]` | Array of reward epoch numbers to claim for. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Amount of total claimed rewards (wei). | -
-
- -
- -### `claimRewardFromDataProviders` { #fn_claimrewardfromdataproviders_d20bb542 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function claimRewardFromDataProviders( - address payable _recipient, - uint256[] _rewardEpochs, - address[] _dataProviders -) external returns ( - uint256 _rewardAmount); -``` - -Allows the caller to [`claim`](#fn_claim_b2c12192) rewards from specific data providers. -This function is intended to be used to [`claim`](#fn_claim_b2c12192) rewards in case of delegation by amount. - -**This function is deprecated**: use [`claimFromDataProviders`](#fn_claimfromdataproviders_21bb25af) instead. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipient` | `address payable` | Address to transfer funds to. | -| `_rewardEpochs` | `uint256[]` | Array of reward epoch numbers to claim for. | -| `_dataProviders` | `address[]` | Array of addresses of the data providers to claim the reward from. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Total amount of claimed rewards (wei). | -
-
- -
- -### `closeExpiredRewardEpoch` { #fn_closeexpiredrewardepoch_d6c1dbee } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -function closeExpiredRewardEpoch( - uint256 _rewardEpochId -) external; -``` - -Collects funds from expired reward epoch and calculates totals. - -Triggered by ftsoManager on finalization of a reward epoch. -Operation is irreversible: when some reward epoch is closed according to current -settings, it cannot be reopened even if new parameters would -allow it, because `nextRewardEpochToExpire` in ftsoManager never decreases. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpochId` | `uint256` | ID of the epoch to close. | - -
-
- -
- -### `deactivate` { #fn_deactivate_51b42b00 } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -function deactivate( -) external; -``` - -Deactivates reward manager (prevents claiming rewards). - -
-
- -
- -### `distributeRewards` { #fn_distributerewards_a9b79e17 } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -function distributeRewards( - address[] addresses, - uint256[] weights, - uint256 totalWeight, - uint256 epochId, - address ftso, - uint256 priceEpochDurationSeconds, - uint256 currentRewardEpoch, - uint256 priceEpochEndTime, - uint256 votePowerBlock -) external; -``` - -Distributes price epoch rewards to data provider accounts, according to input parameters. -Must be called with `totalWeight` > 0 and `addresses.length` > 0. - -The amount of rewards for a given price epoch ID are calculated in [`FtsoRewardManager`](./FtsoRewardManager.md) from -`priceEpochDurationSeconds`, `priceEpochEndTime` and inflation authorization data -(see `_getTotalPriceEpochRewardWei` in [`FtsoRewardManager`](./FtsoRewardManager.md). -Then each data provider address is given a portion of this amount according to corresponding weight -and total sum of weights. - -Parameters `epochId` and `ftso` are only needed so they can be passed onto the emitted event. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `addresses` | `address[]` | Data provider addresses to reward. | -| `weights` | `uint256[]` | Weights corresponding to rewarded addresses. | -| `totalWeight` | `uint256` | Sum of all weights. | -| `epochId` | `uint256` | Price epoch ID. | -| `ftso` | `address` | Randomly chosen FTSO contract used to calculate the weights. | -| `priceEpochDurationSeconds` | `uint256` | Duration of price epochs (180s). | -| `currentRewardEpoch` | `uint256` | ID of the current reward epoch. Rewards for the price epoch are added to this reward epoch. | -| `priceEpochEndTime` | `uint256` | Timestamp of the price epoch end time (end of submit period), in seconds since UNIX epoch. | -| `votePowerBlock` | `uint256` | Vote power block used in the given reward epoch. | - -
-
- -
- -### `enableClaims` { #fn_enableclaims_ea28edad } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -function enableClaims( -) external; -``` - -Enable claiming for current and all future reward epochs. - -
-
- -
- -### `firstClaimableRewardEpoch` { #fn_firstclaimablerewardepoch_7b6b2c0a } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -function firstClaimableRewardEpoch( -) external view returns ( - uint256); -``` - -Epochs before the token distribution event at Flare launch were not be claimable. -Use this method to know the first reward epoch that was claimable. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 The first reward epoch that can be claimed. | -
-
- -
- -### `getClaimedReward` { #fn_getclaimedreward_85b4c538 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getClaimedReward( - uint256 _rewardEpoch, - address _dataProvider, - address _claimer -) external view returns ( - bool _claimed, - uint256 _amount); -``` - -Returns information on the rewards accrued by a reward owner from a specific data provider at a specific -reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID to query. | -| `_dataProvider` | `address` | Address of the data provider to query. | -| `_claimer` | `address` | Address of the reward owner to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_claimed` | `bool` | Whether the reward has been claimed or not. | -| `_amount` | `uint256` | Accrued amount in wei. | -
-
- -
- -### `getContractName` { #fn_getcontractname_f5f5ba72 } - -
-Defined in `IIInflationReceiver` ([Docs](./IIInflationReceiver.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol)). -
- -
- -```solidity -function getContractName( -) external view returns ( - string); -``` - -Implement this function to allow updating inflation receiver contracts through [`AddressUpdater`](./AddressUpdater.md). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `string` | Contract name. | -
-
- -
- -### `getCurrentRewardEpoch` { #fn_getcurrentrewardepoch_e7c830d4 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getCurrentRewardEpoch( -) external view returns ( - uint256); -``` - -Returns the current reward epoch ID. - -
-
- -
- -### `getDataProviderCurrentFeePercentage` { #fn_getdataprovidercurrentfeepercentage_cfbcd25f } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderCurrentFeePercentage( - address _dataProvider -) external view returns ( - uint256 _feePercentageBIPS); -``` - -Returns the current [fee](https://docs.flare.network/tech/ftso/#rewards) percentage of a data provider. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_dataProvider` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256` | Fee percentage in BIPS. | -
-
- -
- -### `getDataProviderFeePercentage` { #fn_getdataproviderfeepercentage_961c00ed } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderFeePercentage( - address _dataProvider, - uint256 _rewardEpoch -) external view returns ( - uint256 _feePercentageBIPS); -``` - -Returns the [fee](https://docs.flare.network/tech/ftso/#rewards) percentage of a data provider at a -given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_dataProvider` | `address` | Address of the queried data provider. | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256` | Fee percentage in BIPS. | -
-
- -
- -### `getDataProviderPerformanceInfo` { #fn_getdataproviderperformanceinfo_eb82dd7f } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderPerformanceInfo( - uint256 _rewardEpoch, - address _dataProvider -) external view returns ( - uint256 _rewardAmount, - uint256 _votePowerIgnoringRevocation); -``` - -Returns information on rewards and vote power of a data provider at a given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | -| `_dataProvider` | `address` | Address of the data provider to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmount` | `uint256` | Amount of rewards (wei). | -| `_votePowerIgnoringRevocation` | `uint256` | Vote power, not including revocations. | -
-
- -
- -### `getDataProviderScheduledFeePercentageChanges` { #fn_getdataproviderscheduledfeepercentagechanges_33b7971e } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getDataProviderScheduledFeePercentageChanges( - address _dataProvider -) external view returns ( - uint256[] _feePercentageBIPS, - uint256[] _validFromEpoch, - bool[] _fixed); -``` - -Returns the scheduled [fee](https://docs.flare.network/tech/ftso/#rewards) percentage changes for a data -provider. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_dataProvider` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256[]` | Array of fee percentages in BIPS. | -| `_validFromEpoch` | `uint256[]` | Array of block numbers from which the fee settings are effective. | -| `_fixed` | `bool[]` | Array of boolean values indicating whether settings are subject to change or not. | -
-
- -
- -### `getEpochReward` { #fn_getepochreward_d418634a } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getEpochReward( - uint256 _rewardEpoch -) external view returns ( - uint256 _totalReward, - uint256 _claimedReward); -``` - -Returns information on an epoch's rewards. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_totalReward` | `uint256` | Total amount of rewards accrued on that epoch, in wei. | -| `_claimedReward` | `uint256` | Total amount of rewards that have already been claimed, in wei. | -
-
- -
- -### `getEpochsWithClaimableRewards` { #fn_getepochswithclaimablerewards_0441218e } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getEpochsWithClaimableRewards( -) external view returns ( - uint256 _startEpochId, - uint256 _endEpochId); -``` - -Returns the reward epoch range for which rewards can be claimed. -Rewards outside this range are unclaimable, either because they have expired or because the reward epoch is -still ongoing. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_startEpochId` | `uint256` | The oldest epoch ID that allows reward claiming. | -| `_endEpochId` | `uint256` | The newest epoch ID that allows reward claiming. | -
-
- -
- -### `getEpochsWithUnclaimedRewards` { #fn_getepochswithunclaimedrewards_b4a2043d } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getEpochsWithUnclaimedRewards( - address _beneficiary -) external view returns ( - uint256[] _epochIds); -``` - -Returns the array of claimable epoch IDs for which the rewards of a reward owner have not yet been claimed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_beneficiary` | `address` | Address of the reward owner to query. Reverts if it uses delegation by amount. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_epochIds` | `uint256[]` | Array of epoch IDs. | -
-
- -
- -### `getExpectedBalance` { #fn_getexpectedbalance_af04cd3b } - -
-Defined in `IIInflationReceiver` ([Docs](./IIInflationReceiver.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol)). -
- -
- -```solidity -function getExpectedBalance( -) external view returns ( - uint256); -``` - -Returns the contract's expected balance -(actual balance may be higher due to self-destruct funds). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Expected native token balance. | -
-
- -
- -### `getInflationAddress` { #fn_getinflationaddress_ed39d3f8 } - -
-Defined in `IIInflationReceiver` ([Docs](./IIInflationReceiver.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol)). -
- -
- -```solidity -function getInflationAddress( -) external returns ( - address); -``` - -Returns the address of the [`Inflation`](./Inflation.md) contract. - -
-
- -
- -### `getInitialRewardEpoch` { #fn_getinitialrewardepoch_3123b7d8 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getInitialRewardEpoch( -) external view returns ( - uint256); -``` - -Returns the initial reward epoch ID for this reward manager contract. -This corresponds to the oldest reward epoch with claimable rewards in the previous reward manager when this -one took over. -Set by governance through `setInitialRewardData`. - -
-
- -
- -### `getRewardEpochToExpireNext` { #fn_getrewardepochtoexpirenext_3e7ff857 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getRewardEpochToExpireNext( -) external view returns ( - uint256); -``` - -Returns the reward epoch that will expire next once a new reward epoch starts. - -
-
- -
- -### `getRewardEpochVotePowerBlock` { #fn_getrewardepochvotepowerblock_f2edab5a } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getRewardEpochVotePowerBlock( - uint256 _rewardEpoch -) external view returns ( - uint256); -``` - -Returns the [vote power block](https://docs.flare.network/tech/ftso/#vote-power) of a given reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Reward epoch ID. | - -
-
- -
- -### `getStateOfRewards` { #fn_getstateofrewards_a4472c10 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getStateOfRewards( - address _beneficiary, - uint256 _rewardEpoch -) external view returns ( - address[] _dataProviders, - uint256[] _rewardAmounts, - bool[] _claimed, - bool _claimable); -``` - -Returns the state of rewards for a given address at a specific reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_beneficiary` | `address` | Address of the beneficiary to query. It can be a data provider or a delegator, for example.
Reverts if the queried address is delegating by amount. | -| `_rewardEpoch` | `uint256` | Reward epoch ID to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_dataProviders` | `address[]` | Array of addresses of data providers. | -| `_rewardAmounts` | `uint256[]` | Array of reward amounts received from each provider, in wei. | -| `_claimed` | `bool[]` | Array of boolean values indicating whether each reward has been claimed or not. | -| `_claimable` | `bool` | Boolean value indicating whether rewards are claimable or not. | -
-
- -
- -### `getStateOfRewardsFromDataProviders` { #fn_getstateofrewardsfromdataproviders_e416b7e1 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function getStateOfRewardsFromDataProviders( - address _beneficiary, - uint256 _rewardEpoch, - address[] _dataProviders -) external view returns ( - uint256[] _rewardAmounts, - bool[] _claimed, - bool _claimable); -``` - -Returns the state of rewards for a given address coming from a specific set of data providers, at a specific -reward epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_beneficiary` | `address` | Address of beneficiary to query. | -| `_rewardEpoch` | `uint256` | Reward epoch ID to query. | -| `_dataProviders` | `address[]` | Array of addresses of the data providers to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_rewardAmounts` | `uint256[]` | Array of reward amounts received from each provider, in wei. | -| `_claimed` | `bool[]` | Array of boolean values indicating whether each reward has been claimed or not. | -| `_claimable` | `bool` | Boolean value indicating whether rewards are claimable or not. | -
-
- -
- -### `getTokenPoolSupplyData` { #fn_gettokenpoolsupplydata_2dafdbbf } - -
-Defined in `IITokenPool` ([Docs](./IITokenPool.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IITokenPool.sol)). -
- -
- -```solidity -function getTokenPoolSupplyData( -) external returns ( - uint256 _lockedFundsWei, - uint256 _totalInflationAuthorizedWei, - uint256 _totalClaimedWei); -``` - -Returns token pool supply data. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_lockedFundsWei` | `uint256` | Total amount of funds ever locked in the token pool (wei). `_lockedFundsWei` - `_totalClaimedWei` is the amount currently locked and outside the circulating supply. | -| `_totalInflationAuthorizedWei` | `uint256` | Total inflation authorized amount (wei). | -| `_totalClaimedWei` | `uint256` | Total claimed amount (wei). | -
-
- -
- -### `getUnclaimedReward` { #fn_getunclaimedreward_657d9695 } - -
-Defined in `IIFtsoRewardManager` ([Docs](./IIFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IIFtsoRewardManager.sol)). -
- -
- -```solidity -function getUnclaimedReward( - uint256 _rewardEpoch, - address _dataProvider -) external view returns ( - uint256 _amount, - uint256 _weight); -``` - -Returns information on unclaimed rewards for a given data provider and epoch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardEpoch` | `uint256` | Queried reward epoch ID. | -| `_dataProvider` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_amount` | `uint256` | Amount available to be claimed, in wei. | -| `_weight` | `uint256` | Portion of total vote power used in this reward epoch that has not yet claimed its reward, in BIPS. It decreases to 0 when all data providers have claimed their rewards. | -
-
- -
- -### `nextClaimableRewardEpoch` { #fn_nextclaimablerewardepoch_69b91b59 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function nextClaimableRewardEpoch( - address _rewardOwner -) external view returns ( - uint256); -``` - -Returns the next claimable reward epoch for a reward owner. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_rewardOwner` | `address` | Address of the reward owner to query. | - -
-
- -
- -### `receiveInflation` { #fn_receiveinflation_06201f1d } - -
-Defined in `IIInflationReceiver` ([Docs](./IIInflationReceiver.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol)). -
- -
- -```solidity -function receiveInflation( -) external payable; -``` - -Receive native tokens from inflation. - -
-
- -
- -### `setDailyAuthorizedInflation` { #fn_setdailyauthorizedinflation_e2739563 } - -
-Defined in `IIInflationReceiver` ([Docs](./IIInflationReceiver.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol)). -
- -
- -```solidity -function setDailyAuthorizedInflation( - uint256 _toAuthorizeWei -) external; -``` - -Notify the receiver that it is entitled to receive a new inflation amount. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_toAuthorizeWei` | `uint256` | The amount of inflation that can be awarded in the coming day, in wei. | - -
-
- -
- -### `setDataProviderFeePercentage` { #fn_setdataproviderfeepercentage_16e69328 } - -
-Defined in `IFtsoRewardManager` ([Docs](./IFtsoRewardManager.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IFtsoRewardManager.sol)). -
- -
- -```solidity -function setDataProviderFeePercentage( - uint256 _feePercentageBIPS -) external returns ( - uint256 _validFromEpoch); -``` - -Sets the [fee](https://docs.flare.network/tech/ftso/#rewards) a data provider keeps from all delegations. - -Takes effect after `feeValueUpdateOffset` reward epochs have elapsed. - -When called multiple times inside the same reward epoch, only the last value remains. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_feePercentageBIPS` | `uint256` | Fee percentage in BIPS. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_validFromEpoch` | `uint256` | Reward epoch number when the new fee percentage will become effective. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IIGovernanceVotePower.md b/docs/apis/smart-contracts/IIGovernanceVotePower.md deleted file mode 100644 index 11ea21da9..000000000 --- a/docs/apis/smart-contracts/IIGovernanceVotePower.md +++ /dev/null @@ -1,424 +0,0 @@ ---- -title: IIGovernanceVotePower -search: - boost: 0.5 ---- - - - -# `IIGovernanceVotePower` { #ct_iigovernancevotepower } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol) | Inherits from [IGovernanceVotePower](./IGovernanceVotePower.md) -
- -
- -Internal interface for contracts delegating their governance vote power. - -
- -
- -## Events - -
- -### `DelegateChanged` { #ev_delegatechanged } - -
-Defined in `IIGovernanceVotePower` ([Docs](./IIGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol)). -
- -
- -```solidity -event DelegateChanged( - address delegator, - address fromDelegate, - address toDelegate -) -``` - -Emitted when an account starts delegating vote power or switches its delegation -to another address. - -The event is always emitted from a [`GovernanceVotePower`](./GovernanceVotePower.md) contract. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `delegator` | `address` | Account delegating its vote power. | -| `fromDelegate` | `address` | Account receiving the delegation before the change. Can be address(0) if there was no previous delegation. | -| `toDelegate` | `address` | Account receiving the delegation after the change. Can be address(0) if `delegator` just undelegated all its vote power. | - -
-
- -
- -### `DelegateVotesChanged` { #ev_delegatevoteschanged } - -
-Defined in `IIGovernanceVotePower` ([Docs](./IIGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol)). -
- -
- -```solidity -event DelegateVotesChanged( - address delegate, - uint256 previousBalance, - uint256 newBalance -) -``` - -Emitted when a [`delegate`](#fn_delegate_5c19a95c)'s vote power changes, as a result of a new delegation -or a token transfer, for example. - -The event is always emitted from a [`GovernanceVotePower`](./GovernanceVotePower.md) contract. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `delegate` | `address` | The account receiving the changing delegated vote power. | -| `previousBalance` | `uint256` | Delegated vote power before the change. | -| `newBalance` | `uint256` | Delegated vote power after the change. | - -
-
- -
- -
- -## Functions - -
- -### `delegate` { #fn_delegate_5c19a95c } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function delegate( - address _to -) external; -``` - -Delegates all governance vote power of `msg.sender` to address `_to`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | - -
-
- -
- -### `getCleanupBlockNumber` { #fn_getcleanupblocknumber_a72ec4b6 } - -
-Defined in `IIGovernanceVotePower` ([Docs](./IIGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol)). -
- -
- -```solidity -function getCleanupBlockNumber( -) external view returns ( - uint256); -``` - -Get the current cleanup block number set with [`setCleanupBlockNumber`](#fn_setcleanupblocknumber_13de97f5). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The currently set cleanup block number. | -
-
- -
- -### `getDelegateOfAt` { #fn_getdelegateofat_3c028e9d } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function getDelegateOfAt( - address _who, - uint256 _blockNumber -) external view returns ( - address); -``` - -Gets the address an account is delegating its governance vote power to, at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number at which to fetch the address. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address where `_who` was delegating its governance vote power at block `_blockNumber`. | -
-
- -
- -### `getDelegateOfAtNow` { #fn_getdelegateofatnow_b3e871ee } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function getDelegateOfAtNow( - address _who -) external view returns ( - address); -``` - -Gets the address an account is delegating its governance vote power to, at the latest block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address` | Address where `_who` is currently delegating its governance vote power. | -
-
- -
- -### `getVotes` { #fn_getvotes_9ab24eb0 } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function getVotes( - address _who -) external view returns ( - uint256); -``` - -Gets the governance vote power of an address at the latest block, including -all delegations made to it. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Governance vote power of `account` at the lastest block. | -
-
- -
- -### `ownerToken` { #fn_ownertoken_65371883 } - -
-Defined in `IIGovernanceVotePower` ([Docs](./IIGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol)). -
- -
- -```solidity -function ownerToken( -) external view returns ( - contract IVPToken); -``` - -Get the token that this governance vote power contract belongs to. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IVPToken` | The [`IVPToken`](./IVPToken.md) interface owning this contract. | -
-
- -
- -### `pChainStakeMirror` { #fn_pchainstakemirror_62d9c89a } - -
-Defined in `IIGovernanceVotePower` ([Docs](./IIGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol)). -
- -
- -```solidity -function pChainStakeMirror( -) external view returns ( - contract IPChainStakeMirror); -``` - -Get the stake mirror contract that this governance vote power contract belongs to. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `contract IPChainStakeMirror` | The [`IPChainStakeMirror`](./IPChainStakeMirror.md) interface owning this contract. | -
-
- -
- -### `setCleanerContract` { #fn_setcleanercontract_f6a494af } - -
-Defined in `IIGovernanceVotePower` ([Docs](./IIGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol)). -
- -
- -```solidity -function setCleanerContract( - address _cleanerContract -) external; -``` - -Set the contract that is allowed to call history cleaning methods. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanerContract` | `address` | Address of the cleanup contract. Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). | - -
-
- -
- -### `setCleanupBlockNumber` { #fn_setcleanupblocknumber_13de97f5 } - -
-Defined in `IIGovernanceVotePower` ([Docs](./IIGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol)). -
- -
- -```solidity -function setCleanupBlockNumber( - uint256 _blockNumber -) external; -``` - -Set the cleanup block number. -Historic data for the blocks before `cleanupBlockNumber` can be erased. -History before that block should never be used since it can be inconsistent. -In particular, cleanup block number must be lower than the current vote power block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The new cleanup block number. | - -
-
- -
- -### `undelegate` { #fn_undelegate_92ab89bb } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function undelegate( -) external; -``` - -Undelegates all governance vote power of `msg.sender`. - -
-
- -
- -### `updateAtTokenTransfer` { #fn_updateattokentransfer_eadb4362 } - -
-Defined in `IIGovernanceVotePower` ([Docs](./IIGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIGovernanceVotePower.sol)). -
- -
- -```solidity -function updateAtTokenTransfer( - address _from, - address _to, - uint256 _fromBalance, - uint256 _toBalance, - uint256 _amount -) external; -``` - -Update governance vote power of all involved delegates after tokens are transferred. - -This function **MUST** be called after each governance token transfer for the -delegates to reflect the correct balance. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Source address of the transfer. | -| `_to` | `address` | Destination address of the transfer. | -| `_fromBalance` | `uint256` | _Ignored._ | -| `_toBalance` | `uint256` | _Ignored._ | -| `_amount` | `uint256` | Amount being transferred. | - -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_92bfe6d8 } - -
-Defined in `IGovernanceVotePower` ([Docs](./IGovernanceVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IGovernanceVotePower.sol)). -
- -
- -```solidity -function votePowerOfAt( - address _who, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Gets the governance vote power of an address at a given block number, including -all delegations made to it. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number at which to fetch the vote power. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Governance vote power of `_who` at `_blockNumber`. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IIInflationReceiver.md b/docs/apis/smart-contracts/IIInflationReceiver.md deleted file mode 100644 index 4eb5ea2ee..000000000 --- a/docs/apis/smart-contracts/IIInflationReceiver.md +++ /dev/null @@ -1,141 +0,0 @@ ---- -title: IIInflationReceiver -search: - boost: 0.5 ---- - - - -# `IIInflationReceiver` { #ct_iiinflationreceiver } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol) -
- -
- -Internal interface for contracts that can receive inflation. - -
- -
- -## Functions - -
- -### `getContractName` { #fn_getcontractname_f5f5ba72 } - -
-Defined in `IIInflationReceiver` ([Docs](./IIInflationReceiver.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol)). -
- -
- -```solidity -function getContractName( -) external view returns ( - string); -``` - -Implement this function to allow updating inflation receiver contracts through [`AddressUpdater`](./AddressUpdater.md). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `string` | Contract name. | -
-
- -
- -### `getExpectedBalance` { #fn_getexpectedbalance_af04cd3b } - -
-Defined in `IIInflationReceiver` ([Docs](./IIInflationReceiver.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol)). -
- -
- -```solidity -function getExpectedBalance( -) external view returns ( - uint256); -``` - -Returns the contract's expected balance -(actual balance may be higher due to self-destruct funds). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Expected native token balance. | -
-
- -
- -### `getInflationAddress` { #fn_getinflationaddress_ed39d3f8 } - -
-Defined in `IIInflationReceiver` ([Docs](./IIInflationReceiver.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol)). -
- -
- -```solidity -function getInflationAddress( -) external returns ( - address); -``` - -Returns the address of the [`Inflation`](./Inflation.md) contract. - -
-
- -
- -### `receiveInflation` { #fn_receiveinflation_06201f1d } - -
-Defined in `IIInflationReceiver` ([Docs](./IIInflationReceiver.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol)). -
- -
- -```solidity -function receiveInflation( -) external payable; -``` - -Receive native tokens from inflation. - -
-
- -
- -### `setDailyAuthorizedInflation` { #fn_setdailyauthorizedinflation_e2739563 } - -
-Defined in `IIInflationReceiver` ([Docs](./IIInflationReceiver.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/interface/IIInflationReceiver.sol)). -
- -
- -```solidity -function setDailyAuthorizedInflation( - uint256 _toAuthorizeWei -) external; -``` - -Notify the receiver that it is entitled to receive a new inflation amount. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_toAuthorizeWei` | `uint256` | The amount of inflation that can be awarded in the coming day, in wei. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IIPriceSubmitter.md b/docs/apis/smart-contracts/IIPriceSubmitter.md deleted file mode 100644 index 809a01b16..000000000 --- a/docs/apis/smart-contracts/IIPriceSubmitter.md +++ /dev/null @@ -1,341 +0,0 @@ ---- -title: IIPriceSubmitter -search: - boost: 0.5 ---- - - - -# `IIPriceSubmitter` { #ct_iipricesubmitter } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IIPriceSubmitter.sol) | Inherits from [IPriceSubmitter](./IPriceSubmitter.md) -
- -
- -Internal interface for the [`PriceSubmitter`](./PriceSubmitter.md) contract. - -
- -
- -## Functions - -
- -### `getCurrentRandom` { #fn_getcurrentrandom_d89601fd } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function getCurrentRandom( -) external view returns ( - uint256); -``` - -Returns the random number for the previous epoch, obtained from the random numbers -provided by all data providers along with their data submissions. -Note that the random number for the previous epoch keeps updating as new submissions are revealed. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Random number calculated from all data provider's submissions. | -
-
- -
- -### `getFtsoManager` { #fn_getftsomanager_b39c6858 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function getFtsoManager( -) external view returns ( - contract IFtsoManagerGenesis); -``` - -Returns the address of the [`FtsoManager`](./FtsoManager.md) contract. - -
-
- -
- -### `getFtsoRegistry` { #fn_getftsoregistry_8c9d28b6 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function getFtsoRegistry( -) external view returns ( - contract IFtsoRegistryGenesis); -``` - -Returns the address of the [`FtsoRegistry`](./FtsoRegistry.md) contract. - -
-
- -
- -### `getRandom` { #fn_getrandom_cd4b6914 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function getRandom( - uint256 _epochId -) external view returns ( - uint256); -``` - -Returns the random number used in a specific past epoch, obtained from the random numbers -provided by all data providers along with their data submissions. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the queried epoch. Current epoch cannot be queried, and the previous epoch is constantly updated as data providers reveal their prices and random numbers. Note that only the last 50 epochs can be queried and there is no bounds checking for this parameter. Out-of-bounds queries return undefined values. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The random number used in that epoch. | -
-
- -
- -### `getTrustedAddresses` { #fn_gettrustedaddresses_ffacb84e } - -
-Defined in `IIPriceSubmitter` ([Docs](./IIPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IIPriceSubmitter.sol)). -
- -
- -```solidity -function getTrustedAddresses( -) external view returns ( - address[]); -``` - -Returns the list of trusted addresses that are always allowed to submit and reveal. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | address[] Array of trusted voter addresses. | -
-
- -
- -### `getVoterWhitelister` { #fn_getvoterwhitelister_71e1fad9 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function getVoterWhitelister( -) external view returns ( - address); -``` - -Returns the address of the [`VoterWhitelister`](./VoterWhitelister.md) contract managing the data provider whitelist. - -
-
- -
- -### `revealPrices` { #fn_revealprices_e2db5a52 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function revealPrices( - uint256 _epochId, - uint256[] _ftsoIndices, - uint256[] _prices, - uint256 _random -) external; -``` - -Reveals submitted prices during the epoch reveal period. -The hash of FTSO indices, prices, random number, and voter address must be equal -to the hash previously submitted with [`submitHash`](#fn_submithash_8fc6f667). -Emits a [`PricesRevealed`](#ev_pricesrevealed) event. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch to which the price hashes are submitted. | -| `_ftsoIndices` | `uint256[]` | List of FTSO indices in ascending order. | -| `_prices` | `uint256[]` | List of submitted prices in USD. | -| `_random` | `uint256` | Submitted random number. | - -
-
- -
- -### `setTrustedAddresses` { #fn_settrustedaddresses_9ec2b581 } - -
-Defined in `IIPriceSubmitter` ([Docs](./IIPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IIPriceSubmitter.sol)). -
- -
- -```solidity -function setTrustedAddresses( - address[] _trustedAddresses -) external; -``` - -Set trusted addresses that are always allowed to submit and reveal. -Only ftso manager can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_trustedAddresses` | `address[]` | Array of voter addresses. | - -
-
- -
- -### `submitHash` { #fn_submithash_8fc6f667 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function submitHash( - uint256 _epochId, - bytes32 _hash -) external; -``` - -Submits a hash for the current epoch. Can only be called by FTSO data providers -whitelisted through the `VoterWhitelisted` contract. -Emits the [`HashSubmitted`](#ev_hashsubmitted) event. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the target epoch to which the hash is submitted. | -| `_hash` | `bytes32` | A hash of the FTSO indices, prices, random number, and voter address. | - -
-
- -
- -### `voterWhitelistBitmap` { #fn_voterwhitelistbitmap_7ac420ad } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function voterWhitelistBitmap( - address _voter -) external view returns ( - uint256); -``` - -Returns a bitmap of all FTSOs for which a data provider is allowed to submit prices or hashes. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the voter. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | If a data provider is allowed to vote for a given FTSO index, the corresponding bit in the result is 1. | -
-
- -
- -### `voterWhitelisted` { #fn_voterwhitelisted_9d986f91 } - -
-Defined in `IIPriceSubmitter` ([Docs](./IIPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IIPriceSubmitter.sol)). -
- -
- -```solidity -function voterWhitelisted( - address _voter, - uint256 _ftsoIndex -) external; -``` - -Called from the [`VoterWhitelister`](./VoterWhitelister.md) contract when a new voter has been whitelisted. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Voter address that has been added to the whitelist. | -| `_ftsoIndex` | `uint256` | Index of the FTSO to which the voter has registered. Each FTSO has its own whitelist. | - -
-
- -
- -### `votersRemovedFromWhitelist` { #fn_votersremovedfromwhitelist_76794efb } - -
-Defined in `IIPriceSubmitter` ([Docs](./IIPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IIPriceSubmitter.sol)). -
- -
- -```solidity -function votersRemovedFromWhitelist( - address[] _voters, - uint256 _ftsoIndex -) external; -``` - -Called from the [`VoterWhitelister`](./VoterWhitelister.md) contract when one or more voters have been removed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voters` | `address[]` | Array of voter addresses that have been removed. | -| `_ftsoIndex` | `uint256` | Index of the FTSO to which the voters were registered. Each FTSO has its own whitelist. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IITokenPool.md b/docs/apis/smart-contracts/IITokenPool.md deleted file mode 100644 index 3abb4357a..000000000 --- a/docs/apis/smart-contracts/IITokenPool.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: IITokenPool -search: - boost: 0.5 ---- - - - -# `IITokenPool` { #ct_iitokenpool } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IITokenPool.sol) -
- -
- -Internal interface for token pools. - -
- -
- -## Functions - -
- -### `getTokenPoolSupplyData` { #fn_gettokenpoolsupplydata_2dafdbbf } - -
-Defined in `IITokenPool` ([Docs](./IITokenPool.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/tokenPools/interface/IITokenPool.sol)). -
- -
- -```solidity -function getTokenPoolSupplyData( -) external returns ( - uint256 _lockedFundsWei, - uint256 _totalInflationAuthorizedWei, - uint256 _totalClaimedWei); -``` - -Returns token pool supply data. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_lockedFundsWei` | `uint256` | Total amount of funds ever locked in the token pool (wei). `_lockedFundsWei` - `_totalClaimedWei` is the amount currently locked and outside the circulating supply. | -| `_totalInflationAuthorizedWei` | `uint256` | Total inflation authorized amount (wei). | -| `_totalClaimedWei` | `uint256` | Total claimed amount (wei). | -
-
- -
- diff --git a/docs/apis/smart-contracts/IIVPContract.md b/docs/apis/smart-contracts/IIVPContract.md deleted file mode 100644 index 65dd16e70..000000000 --- a/docs/apis/smart-contracts/IIVPContract.md +++ /dev/null @@ -1,736 +0,0 @@ ---- -title: IIVPContract -search: - boost: 0.5 ---- - - - -# `IIVPContract` { #ct_iivpcontract } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol) | Inherits from [IICleanable](./IICleanable.md), [IVPContractEvents](./IVPContractEvents.md) -
- -
- -Internal interface for helper contracts handling functionality for an associated [`VPToken`](./VPToken.md). - -
- -
- -## Functions - -
- -### `batchVotePowerOfAt` { #fn_batchvotepowerofat_49e3c7e5 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function batchVotePowerOfAt( - address[] _owners, - uint256 _blockNumber -) external view returns ( - uint256[]); -``` - -Get the vote power of a set of addresses at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owners` | `address[]` | The list of addresses being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256[]` | Vote power of each address at `_blockNumber`, including any delegation received. | -
-
- -
- -### `cleanupBlockNumber` { #fn_cleanupblocknumber_deea13e7 } - -
-Defined in `IICleanable` ([Docs](./IICleanable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IICleanable.sol)). -
- -
- -```solidity -function cleanupBlockNumber( -) external view returns ( - uint256); -``` - -Get the current cleanup block number set with [`setCleanupBlockNumber`](#fn_setcleanupblocknumber_13de97f5). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The currently set cleanup block number. | -
-
- -
- -### `delegate` { #fn_delegate_6230001a } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function delegate( - address _from, - address _to, - uint256 _balance, - uint256 _bips -) external; -``` - -[`Delegate`](#ev_delegate) `_bips` percentage of voting power from a delegator address to a delegatee address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | The address of the delegator. | -| `_to` | `address` | The address of the delegatee. | -| `_balance` | `uint256` | The delegator's current balance | -| `_bips` | `uint256` | The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: every call resets the delegation value (and a value of 0 revokes delegation). | - -
-
- -
- -### `delegateExplicit` { #fn_delegateexplicit_404d9e82 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function delegateExplicit( - address _from, - address _to, - uint256 _balance, - uint256 _amount -) external; -``` - -Explicitly [`delegate`](#fn_delegate_6230001a) `_amount` tokens of voting power from a delegator address to a delegatee address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | The address of the delegator. | -| `_to` | `address` | The address of the delegatee. | -| `_balance` | `uint256` | The delegator's current balance. | -| `_amount` | `uint256` | An explicit vote power amount to be delegated. Not cumulative: every call resets the delegation value (and a value of 0 undelegates `_to`). | - -
-
- -
- -### `delegatesOf` { #fn_delegatesof_7de5b8ed } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function delegatesOf( - address _owner -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the percentages and addresses being delegated to by a vote power delegator. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address of the delegator being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Array of delegatee addresses. | -| `_bips` | `uint256[]` | Array of delegation percents specified in basis points (1/100 or 1 percent), for each delegatee. | -| `_count` | `uint256` | The number of returned delegatees. | -| `_delegationMode` | `uint256` | The mode of the delegation (NOTSET=0, PERCENTAGE=1, AMOUNT=2). See [`Delegatable`](./Delegatable.md).DelegationMode. | -
-
- -
- -### `delegatesOfAt` { #fn_delegatesofat_ed475a79 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function delegatesOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the percentages and addresses being delegated to by a vote power delegator, -at a given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address of the delegator being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Array of delegatee addresses. | -| `_bips` | `uint256[]` | Array of delegation percents specified in basis points (1/100 or 1 percent), for each delegatee. | -| `_count` | `uint256` | The number of returned delegatees. | -| `_delegationMode` | `uint256` | The mode of the delegation (NOTSET=0, PERCENTAGE=1, AMOUNT=2). See [`Delegatable`](./Delegatable.md).DelegationMode. | -
-
- -
- -### `delegationModeOf` { #fn_delegationmodeof_f6837767 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function delegationModeOf( - address _who -) external view returns ( - uint256); -``` - -Get the delegation mode of an address. This mode determines whether vote power is -allocated by percentage or by explicit value and cannot be changed once set with -[`delegate`](#fn_delegate_6230001a) or [`delegateExplicit`](#fn_delegateexplicit_404d9e82). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Delegation mode (NOTSET=0, PERCENTAGE=1, AMOUNT=2). See [`Delegatable`](./Delegatable.md).DelegationMode. | -
-
- -
- -### `isReplacement` { #fn_isreplacement_aa94d3f2 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function isReplacement( -) external view returns ( - bool); -``` - -Return true if this [`IIVPContract`](./IIVPContract.md) is configured to be used as a replacement for other contract. -It means that vote powers are not necessarily correct at the initialization, therefore -every method that reads vote power must check whether it is initialized for that address and block. - -
-
- -
- -### `ownerToken` { #fn_ownertoken_65371883 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function ownerToken( -) external view returns ( - contract IVPToken); -``` - -The [`VPToken`](./VPToken.md) (or some other contract) that owns this [`VPContract`](./VPContract.md). -All state changing methods may be called only from this address. -This is because original `msg.sender` is typically sent in a parameter -and we must make sure that it cannot be faked by directly calling -[`IIVPContract`](./IIVPContract.md) methods. -Owner token is also used in case of replacement to recover vote powers from balances. - -
-
- -
- -### `revokeDelegationAt` { #fn_revokedelegationat_c7c62fab } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function revokeDelegationAt( - address _from, - address _to, - uint256 _balance, - uint256 _blockNumber -) external; -``` - -[`Revoke`](#ev_revoke) all vote power delegation from a delegator address to a delegatee address at a given block. -Only affects the reads via [`votePowerOfAtCached`](#fn_votepowerofatcached_e587497e) in the block `_blockNumber`. -This method should be used only to prevent rogue [`delegate`](#fn_delegate_6230001a) voting in the current voting block. -To stop delegating use [`delegate`](#fn_delegate_6230001a) or [`delegateExplicit`](#fn_delegateexplicit_404d9e82) with value of 0, -or [`undelegateAll`](#fn_undelegateall_05109ecf)/ [`undelegateAllExplicit`](#fn_undelegateallexplicit_0f8b8af7). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | The address of the delegator. | -| `_to` | `address` | Address of the delegatee. | -| `_balance` | `uint256` | The delegator's current balance. | -| `_blockNumber` | `uint256` | The block number at which to revoke delegation. Must be in the past. | - -
-
- -
- -### `setCleanerContract` { #fn_setcleanercontract_f6a494af } - -
-Defined in `IICleanable` ([Docs](./IICleanable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IICleanable.sol)). -
- -
- -```solidity -function setCleanerContract( - address _cleanerContract -) external; -``` - -Set the contract that is allowed to call history cleaning methods. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanerContract` | `address` | Address of the cleanup contract. Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). | - -
-
- -
- -### `setCleanupBlockNumber` { #fn_setcleanupblocknumber_13de97f5 } - -
-Defined in `IICleanable` ([Docs](./IICleanable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IICleanable.sol)). -
- -
- -```solidity -function setCleanupBlockNumber( - uint256 _blockNumber -) external; -``` - -Set the cleanup block number. -Historic data for the blocks before [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7) can be erased. -History before that block should never be used since it can be inconsistent. -In particular, cleanup block number must be lower than the current vote power block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The new cleanup block number. | - -
-
- -
- -### `undelegateAll` { #fn_undelegateall_05109ecf } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function undelegateAll( - address _from, - uint256 _balance -) external; -``` - -Undelegate all voting power for a delegator address. -Can only be used with percentage delegation. -Does not reset delegation mode back to `NOTSET`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | The address of the delegator. | -| `_balance` | `uint256` | The delegator's current balance. | - -
-
- -
- -### `undelegateAllExplicit` { #fn_undelegateallexplicit_0f8b8af7 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function undelegateAllExplicit( - address _from, - address[] _delegateAddresses -) external returns ( - uint256); -``` - -Undelegate all explicit vote power by amount for a delegator address. -Can only be used with explicit delegation. -Does not reset delegation mode back to `NOTSET`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | The address of the delegator. | -| `_delegateAddresses` | `address[]` | Explicit delegation does not store delegatees' addresses, so the caller must supply them. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The amount still delegated (in case the list of delegates was incomplete). | -
-
- -
- -### `undelegatedVotePowerOf` { #fn_undelegatedvotepowerof_4a03d556 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function undelegatedVotePowerOf( - address _owner, - uint256 _balance -) external view returns ( - uint256); -``` - -Compute the current undelegated vote power of an address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | -| `_balance` | `uint256` | Current balance of that address. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`, this is, the amount of vote power currently not being delegated to other addresses. | -
-
- -
- -### `undelegatedVotePowerOfAt` { #fn_undelegatedvotepowerofat_31503927 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function undelegatedVotePowerOfAt( - address _owner, - uint256 _balance, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Compute the undelegated vote power of an address at a given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | -| `_balance` | `uint256` | | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`, this is, the amount of vote power that was not being delegated to other addresses at that block number. | -
-
- -
- -### `updateAtTokenTransfer` { #fn_updateattokentransfer_eadb4362 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function updateAtTokenTransfer( - address _from, - address _to, - uint256 _fromBalance, - uint256 _toBalance, - uint256 _amount -) external; -``` - -Update vote powers when tokens are transferred. -Also update delegated vote powers for percentage delegation -and check for enough funds for explicit delegations. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Source account of the transfer. | -| `_to` | `address` | Destination account of the transfer. | -| `_fromBalance` | `uint256` | Balance of the source account before the transfer. | -| `_toBalance` | `uint256` | Balance of the destination account before the transfer. | -| `_amount` | `uint256` | Amount that has been transferred. | - -
-
- -
- -### `votePowerFromTo` { #fn_votepowerfromto_9dc6b9f2 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function votePowerFromTo( - address _from, - address _to, - uint256 _balance -) external view returns ( - uint256); -``` - -Get current delegated vote power from a delegator to a delegatee. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of the delegator. | -| `_to` | `address` | Address of the delegatee. | -| `_balance` | `uint256` | The delegator's current balance. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The delegated vote power. | -
-
- -
- -### `votePowerFromToAt` { #fn_votepowerfromtoat_833aca92 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function votePowerFromToAt( - address _from, - address _to, - uint256 _balance, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get delegated the vote power from a delegator to a delegatee at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of the delegator. | -| `_to` | `address` | Address of the delegatee. | -| `_balance` | `uint256` | The delegator's current balance. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The delegated vote power. | -
-
- -
- -### `votePowerOf` { #fn_votepowerof_142d1018 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function votePowerOf( - address _who -) external view returns ( - uint256); -``` - -Get the current vote power of an address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Current vote power of `_who`, including any delegation received. | -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_92bfe6d8 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function votePowerOfAt( - address _who, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of an address at a given block number - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_who` at `_blockNumber`, including any delegation received. | -
-
- -
- -### `votePowerOfAtCached` { #fn_votepowerofatcached_e587497e } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function votePowerOfAtCached( - address _who, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the vote power of an address at a given block number. -Reads/updates cache and upholds revocations. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_who` at `_blockNumber`, including any delegation received. | -
-
- -
- -### `votePowerOfAtIgnoringRevocation` { #fn_votepowerofatignoringrevocation_04bb4e43 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function votePowerOfAtIgnoringRevocation( - address _who, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of an address at a given block number, ignoring revocation information and cache. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_who` at `_blockNumber`, including any delegation received. Result doesn't change if vote power is revoked. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IIVPToken.md b/docs/apis/smart-contracts/IIVPToken.md deleted file mode 100644 index 69ed604c6..000000000 --- a/docs/apis/smart-contracts/IIVPToken.md +++ /dev/null @@ -1,1168 +0,0 @@ ---- -title: IIVPToken -search: - boost: 0.5 ---- - - - -# `IIVPToken` { #ct_iivptoken } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPToken.sol) | Inherits from [IVPToken](./IVPToken.md), [IICleanable](./IICleanable.md) -
- -
- -Vote power token internal interface. - -
- -
- -## Functions - -
- -### `allowance` { #fn_allowance_dd62ed3e } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function allowance( - address owner, - address spender -) external view returns ( - uint256); -``` - -Returns the remaining number of tokens that `spender` will be -allowed to spend on behalf of `owner` through [`transferFrom`](#fn_transferfrom_23b872dd). This is -zero by default. - -This value changes when [`approve`](#fn_approve_095ea7b3) or [`transferFrom`](#fn_transferfrom_23b872dd) are called. - -
-
- -
- -### `approve` { #fn_approve_095ea7b3 } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function approve( - address spender, - uint256 amount -) external returns ( - bool); -``` - -Sets `amount` as the [`allowance`](#fn_allowance_dd62ed3e) of `spender` over the caller's tokens. - -Returns a boolean value indicating whether the operation succeeded. - -IMPORTANT: Beware that changing an [`allowance`](#fn_allowance_dd62ed3e) with this method brings the risk -that someone may use both the old and the new [`allowance`](#fn_allowance_dd62ed3e) by unfortunate -transaction ordering. One possible solution to mitigate this race -condition is to first reduce the spender's [`allowance`](#fn_allowance_dd62ed3e) to 0 and set the -desired value afterwards: -https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - -Emits an [`Approval`](#ev_approval) event. - -
-
- -
- -### `balanceOf` { #fn_balanceof_70a08231 } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function balanceOf( - address account -) external view returns ( - uint256); -``` - -Returns the amount of tokens owned by `account`. - -
-
- -
- -### `balanceOfAt` { #fn_balanceofat_4ee2cd7e } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function balanceOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Queries the token balance of `_owner` at a specific `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address from which the balance will be retrieved. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The balance at `_blockNumber`. | -
-
- -
- -### `batchDelegate` { #fn_batchdelegate_dc4fcda7 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function batchDelegate( - address[] _delegatees, - uint256[] _bips -) external; -``` - -Undelegate all percentage delegations from the sender and then [`delegate`](#fn_delegate_026e402b) corresponding - `_bips` percentage of voting power from the sender to each member of the `_delegatees` array. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegatees` | `address[]` | The addresses of the new recipients. | -| `_bips` | `uint256[]` | The percentages of voting power to be delegated expressed in basis points (1/100 of one percent). The sum of all `_bips` values must be at most 10000 (100%). | - -
-
- -
- -### `batchVotePowerOfAt` { #fn_batchvotepowerofat_49e3c7e5 } - -
-Defined in `IIVPToken` ([Docs](./IIVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPToken.sol)). -
- -
- -```solidity -function batchVotePowerOfAt( - address[] _owners, - uint256 _blockNumber -) external view returns ( - uint256[]); -``` - -Return the vote power for several addresses. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owners` | `address[]` | The list of addresses to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256[]` | Array of vote power for each queried address. | -
-
- -
- -### `cleanupBlockNumber` { #fn_cleanupblocknumber_deea13e7 } - -
-Defined in `IICleanable` ([Docs](./IICleanable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IICleanable.sol)). -
- -
- -```solidity -function cleanupBlockNumber( -) external view returns ( - uint256); -``` - -Get the current cleanup block number set with [`setCleanupBlockNumber`](#fn_setcleanupblocknumber_13de97f5). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The currently set cleanup block number. | -
-
- -
- -### `decimals` { #fn_decimals_313ce567 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function decimals( -) external view returns ( - uint8); -``` - -Returns the number of [`decimals`](#fn_decimals_313ce567) used to get its user representation. -For example, if [`decimals`](#fn_decimals_313ce567) equals 2, a balance of 505 tokens should -be displayed to a user as 5.05 (505 / 102). - -Tokens usually opt for a value of 18, imitating the relationship between -Ether and wei. This is the default value returned by this function, unless -it's overridden. - -NOTE: This information is only used for _display_ purposes: it in -no way affects any of the arithmetic of the contract, including -[`balanceOf`](#fn_balanceof_70a08231) and [`transfer`](#fn_transfer_a9059cbb). - -Should be compatible with ERC20 method. - -
-
- -
- -### `delegate` { #fn_delegate_026e402b } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function delegate( - address _to, - uint256 _bips -) external; -``` - -Delegate voting power to account `_to` from `msg.sender`, by percentage. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_bips` | `uint256` | The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: every call resets the delegation value (and a value of 0 revokes all previous delegations). | - -
-
- -
- -### `delegateExplicit` { #fn_delegateexplicit_d06dc3ad } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function delegateExplicit( - address _to, - uint256 _amount -) external; -``` - -Explicitly [`delegate`](#fn_delegate_026e402b) `_amount` voting power to account `_to` from `msg.sender`. -Compare with [`delegate`](#fn_delegate_026e402b) which delegates by percentage. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_amount` | `uint256` | An explicit vote power amount to be delegated. Not cumulative: every call resets the delegation value (and a value of 0 revokes all previous delegations). | - -
-
- -
- -### `delegatesOf` { #fn_delegatesof_7de5b8ed } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function delegatesOf( - address _who -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the list of addresses to which `_who` is delegating, and their percentages. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Positional array of addresses being delegated to. | -| `_bips` | `uint256[]` | Positional array of delegation percents specified in basis points (1/100 of 1 percent). Each one matches the address in the same position in the `_delegateAddresses` array. | -| `_count` | `uint256` | The number of delegates. | -| `_delegationMode` | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `delegatesOfAt` { #fn_delegatesofat_ed475a79 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function delegatesOfAt( - address _who, - uint256 _blockNumber -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the list of addresses to which `_who` is delegating, and their percentages, at the given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Positional array of addresses being delegated to. | -| `_bips` | `uint256[]` | Positional array of delegation percents specified in basis points (1/100 of 1 percent). Each one matches the address in the same position in the `_delegateAddresses` array. | -| `_count` | `uint256` | The number of delegates. | -| `_delegationMode` | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `delegationModeOf` { #fn_delegationmodeof_f6837767 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function delegationModeOf( - address _who -) external view returns ( - uint256); -``` - -Get the delegation mode for account '_who'. This mode determines whether vote power is -allocated by percentage or by explicit amount. Once the delegation mode is set, -it can never be changed, even if all delegations are removed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address to get delegation mode. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `governanceVotePower` { #fn_governancevotepower_8c2b8ae1 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function governanceVotePower( -) external view returns ( - contract IGovernanceVotePower); -``` - -When set, allows token owners to participate in governance voting -and delegating governance vote power. - -
-
- -
- -### `name` { #fn_name_06fdde03 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function name( -) external view returns ( - string); -``` - -Returns the [`name`](#fn_name_06fdde03) of the token. - -Should be compatible with ERC20 method. - -
-
- -
- -### `readVotePowerContract` { #fn_readvotepowercontract_9b3baa0e } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function readVotePowerContract( -) external view returns ( - contract IVPContractEvents); -``` - -Returns [`VPContract`](./VPContract.md) event interface used for read-only operations (view methods). -The only non-view method that might be called on it is [`revokeDelegationAt`](#fn_revokedelegationat_bbd6fbf8). - -[`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e) is almost always equal to [`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) -except during an upgrade from one [`VPContract`](./VPContract.md) to a new version (which should happen -rarely or never and will be announced beforehand). - -Do not call any methods on [`VPContract`](./VPContract.md) directly. -State changing methods are forbidden from direct calls. -All methods are exposed via [`VPToken`](./VPToken.md). -This is the reason that this method returns [`IVPContractEvents`](./IVPContractEvents.md). -Use it only for listening to events and revoking. - -
-
- -
- -### `revokeDelegationAt` { #fn_revokedelegationat_bbd6fbf8 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function revokeDelegationAt( - address _who, - uint256 _blockNumber -) external; -``` - -Revoke all delegation from sender to `_who` at given block. -Only affects the reads via `votePowerOfAtCached()` in the block `_blockNumber`. -Block `_blockNumber` must be in the past. -This method should be used only to prevent rogue [`delegate`](#fn_delegate_026e402b) voting in the current voting block. -To stop delegating use [`delegate`](#fn_delegate_026e402b) / [`delegateExplicit`](#fn_delegateexplicit_d06dc3ad) with value of 0 or [`undelegateAll`](#fn_undelegateall_b302f393) / [`undelegateAllExplicit`](#fn_undelegateallexplicit_5d6d11eb). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | Address of the delegatee. | -| `_blockNumber` | `uint256` | The block number at which to revoke delegation.. | - -
-
- -
- -### `setCleanerContract` { #fn_setcleanercontract_f6a494af } - -
-Defined in `IICleanable` ([Docs](./IICleanable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IICleanable.sol)). -
- -
- -```solidity -function setCleanerContract( - address _cleanerContract -) external; -``` - -Set the contract that is allowed to call history cleaning methods. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanerContract` | `address` | Address of the cleanup contract. Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). | - -
-
- -
- -### `setCleanupBlockNumber` { #fn_setcleanupblocknumber_13de97f5 } - -
-Defined in `IICleanable` ([Docs](./IICleanable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IICleanable.sol)). -
- -
- -```solidity -function setCleanupBlockNumber( - uint256 _blockNumber -) external; -``` - -Set the cleanup block number. -Historic data for the blocks before [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7) can be erased. -History before that block should never be used since it can be inconsistent. -In particular, cleanup block number must be lower than the current vote power block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The new cleanup block number. | - -
-
- -
- -### `setCleanupBlockNumberManager` { #fn_setcleanupblocknumbermanager_7f4fcaa9 } - -
-Defined in `IIVPToken` ([Docs](./IIVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPToken.sol)). -
- -
- -```solidity -function setCleanupBlockNumberManager( - address _cleanupBlockNumberManager -) external; -``` - -Set the contract that is allowed to set [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7). -Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). - -
-
- -
- -### `setGovernanceVotePower` { #fn_setgovernancevotepower_9ca2231a } - -
-Defined in `IIVPToken` ([Docs](./IIVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPToken.sol)). -
- -
- -```solidity -function setGovernanceVotePower( - contract IIGovernanceVotePower _governanceVotePower -) external; -``` - -Sets new governance vote power contract that allows token owners to participate in governance voting -and [`delegate`](#fn_delegate_026e402b) governance vote power. - -
-
- -
- -### `symbol` { #fn_symbol_95d89b41 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function symbol( -) external view returns ( - string); -``` - -Returns the [`symbol`](#fn_symbol_95d89b41) of the token, usually a shorter version of the [`name`](#fn_name_06fdde03). - -Should be compatible with ERC20 method. - -
-
- -
- -### `totalSupply` { #fn_totalsupply_18160ddd } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function totalSupply( -) external view returns ( - uint256); -``` - -Returns the amount of tokens in existence. - -
-
- -
- -### `totalSupplyAt` { #fn_totalsupplyat_981b24d0 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function totalSupplyAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Total amount of tokens held by all accounts at a specific block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total amount of tokens at `_blockNumber`. | -
-
- -
- -### `totalVotePower` { #fn_totalvotepower_f5f3d4f7 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function totalVotePower( -) external view returns ( - uint256); -``` - -Get the current total vote power. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current total vote power (sum of all accounts' vote power). | -
-
- -
- -### `totalVotePowerAt` { #fn_totalvotepowerat_3e5aa26a } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function totalVotePowerAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the queried block (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAtCached` { #fn_totalvotepoweratcached_caeb942b } - -
-Defined in `IIVPToken` ([Docs](./IIVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPToken.sol)). -
- -
- -```solidity -function totalVotePowerAtCached( - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` using cache. - It tries to read the cached value and if it is not found, reads the actual value and stores it in the cache. - Can only be used if `_blockNumber` is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the queried block (sum of all accounts' vote powers). | -
-
- -
- -### `transfer` { #fn_transfer_a9059cbb } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function transfer( - address recipient, - uint256 amount -) external returns ( - bool); -``` - -Moves `amount` tokens from the caller's account to `recipient`. - -Returns a boolean value indicating whether the operation succeeded. - -Emits a [`Transfer`](#ev_transfer) event. - -
-
- -
- -### `transferFrom` { #fn_transferfrom_23b872dd } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function transferFrom( - address sender, - address recipient, - uint256 amount -) external returns ( - bool); -``` - -Moves `amount` tokens from `sender` to `recipient` using the -[`allowance`](#fn_allowance_dd62ed3e) mechanism. `amount` is then deducted from the caller's -[`allowance`](#fn_allowance_dd62ed3e). - -Returns a boolean value indicating whether the operation succeeded. - -Emits a [`Transfer`](#ev_transfer) event. - -
-
- -
- -### `undelegateAll` { #fn_undelegateall_b302f393 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function undelegateAll( -) external; -``` - -Undelegate all voting power of `msg.sender`. This effectively revokes all previous delegations. -Can only be used with percentage delegation. -Does not reset delegation mode back to NOT SET. - -
-
- -
- -### `undelegateAllExplicit` { #fn_undelegateallexplicit_5d6d11eb } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function undelegateAllExplicit( - address[] _delegateAddresses -) external returns ( - uint256); -``` - -Undelegate all explicit vote power by amount of `msg.sender`. -Can only be used with explicit delegation. -Does not reset delegation mode back to NOT SET. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Explicit delegation does not store delegatees' addresses, so the caller must supply them. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The amount still delegated (in case the list of delegates was incomplete). | -
-
- -
- -### `undelegatedVotePowerOf` { #fn_undelegatedvotepowerof_d6aa0b77 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function undelegatedVotePowerOf( - address _owner -) external view returns ( - uint256); -``` - -Compute the current undelegated vote power of the `_owner` account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`. | -
-
- -
- -### `undelegatedVotePowerOfAt` { #fn_undelegatedvotepowerofat_83035a82 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function undelegatedVotePowerOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the undelegated vote power of the `_owner` account at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`. | -
-
- -
- -### `votePowerFromTo` { #fn_votepowerfromto_be0ca747 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function votePowerFromTo( - address _from, - address _to -) external view returns ( - uint256); -``` - -Get current delegated vote power from delegator `_from` to delegatee `_to`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of delegator. | -| `_to` | `address` | Address of delegatee. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | votePower The delegated vote power. | -
-
- -
- -### `votePowerFromToAt` { #fn_votepowerfromtoat_e64767aa } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function votePowerFromToAt( - address _from, - address _to, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get delegated vote power from delegator `_from` to delegatee `_to` at `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of delegator. | -| `_to` | `address` | Address of delegatee. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The delegated vote power. | -
-
- -
- -### `votePowerOf` { #fn_votepowerof_142d1018 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function votePowerOf( - address _owner -) external view returns ( - uint256); -``` - -Get the current vote power of `_owner`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Current vote power of `_owner`. | -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_92bfe6d8 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function votePowerOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at block number `_blockNumber`. | -
-
- -
- -### `votePowerOfAtCached` { #fn_votepowerofatcached_e587497e } - -
-Defined in `IIVPToken` ([Docs](./IIVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPToken.sol)). -
- -
- -```solidity -function votePowerOfAtCached( - address _owner, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` using cache. - It tries to read the cached value and if it is not found, reads the actual value and stores it in the cache. - Can only be used if `_blockNumber` is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at `_blockNumber`. | -
-
- -
- -### `votePowerOfAtIgnoringRevocation` { #fn_votepowerofatignoringrevocation_04bb4e43 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function votePowerOfAtIgnoringRevocation( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber`, ignoring revocation information (and cache). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at block number `_blockNumber`. Result doesn't change if vote power is revoked. | -
-
- -
- -### `writeVotePowerContract` { #fn_writevotepowercontract_1fec092a } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function writeVotePowerContract( -) external view returns ( - contract IVPContractEvents); -``` - -Returns [`VPContract`](./VPContract.md) event interface used for state-changing operations (non-view methods). -The only non-view method that might be called on it is [`revokeDelegationAt`](#fn_revokedelegationat_bbd6fbf8). - -[`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) is almost always equal to [`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e), -except during upgrade from one [`VPContract`](./VPContract.md) to a new version (which should happen -rarely or never and will be announced beforehand). -In the case of an upgrade, [`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) is replaced first to establish delegations. -After some period (e.g., after a reward epoch ends), [`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e) is set equal to it. - -Do not call any methods on [`VPContract`](./VPContract.md) directly. -State changing methods are forbidden from direct calls. -All are exposed via [`VPToken`](./VPToken.md). -This is the reason that this method returns [`IVPContractEvents`](./IVPContractEvents.md) -Use it only for listening to events, delegating, and revoking. - -
-
- -
- diff --git a/docs/apis/smart-contracts/IIVoterWhitelister.md b/docs/apis/smart-contracts/IIVoterWhitelister.md deleted file mode 100644 index 1415bd93c..000000000 --- a/docs/apis/smart-contracts/IIVoterWhitelister.md +++ /dev/null @@ -1,393 +0,0 @@ ---- -title: IIVoterWhitelister -search: - boost: 0.5 ---- - - - -# `IIVoterWhitelister` { #ct_iivoterwhitelister } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/interface/IIVoterWhitelister.sol) | Inherits from [IVoterWhitelister](./IVoterWhitelister.md) -
- -
- -Internal interface for managers of the [FTSO whitelist](https://docs.flare.network/infra/data/whitelisting/). - -Only addresses registered in this contract can submit data to the FTSO system. - -
- -
- -## Functions - -
- -### `addFtso` { #fn_addftso_345705a4 } - -
-Defined in `IIVoterWhitelister` ([Docs](./IIVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/interface/IIVoterWhitelister.sol)). -
- -
- -```solidity -function addFtso( - uint256 _ftsoIndex -) external; -``` - -Create an empty whitelist with default size for a new FTSO. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index of the new FTSO. | - -
-
- -
- -### `chillVoter` { #fn_chillvoter_2b4faebb } - -
-Defined in `IIVoterWhitelister` ([Docs](./IIVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/interface/IIVoterWhitelister.sol)). -
- -
- -```solidity -function chillVoter( - address _voter, - uint256 _noOfRewardEpochs, - uint256[] _ftsoIndices -) external returns ( - bool[] _removed, - uint256 _untilRewardEpoch); -``` - -Used to chill a data provider, this is, remove it from the whitelist for a -specified number of reward epochs. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Data provider being chilled. | -| `_noOfRewardEpochs` | `uint256` | Number of epochs to chill the provider for. | -| `_ftsoIndices` | `uint256[]` | Array of indices of the FTSOs that will not allow this provider to submit data. | - -
-
- -
- -### `chilledUntilRewardEpoch` { #fn_chilleduntilrewardepoch_46538074 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function chilledUntilRewardEpoch( - address _voter -) external view returns ( - uint256); -``` - -In case of providing bad prices (e.g. collusion), the voter can be chilled for a few reward epochs. -A voter can whitelist again from a returned reward epoch onwards. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 ID of the epoch where the data provider can start submitting prices again. | -
-
- -
- -### `defaultMaxVotersForFtso` { #fn_defaultmaxvotersforftso_47ed51b1 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function defaultMaxVotersForFtso( -) external view returns ( - uint256); -``` - -Maximum number of voters in the whitelist for a new FTSO. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Default maximum allowed voters. | -
-
- -
- -### `getFtsoWhitelistedPriceProviders` { #fn_getftsowhitelistedpriceproviders_09fcb400 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function getFtsoWhitelistedPriceProviders( - uint256 _ftsoIndex -) external view returns ( - address[]); -``` - -Gets whitelisted price providers for the FTSO at a given index. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Queried index. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Array of addresses of the whitelisted data providers. | -
-
- -
- -### `getFtsoWhitelistedPriceProvidersBySymbol` { #fn_getftsowhitelistedpriceprovidersbysymbol_aa89dfd4 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function getFtsoWhitelistedPriceProvidersBySymbol( - string _symbol -) external view returns ( - address[]); -``` - -Gets whitelisted price providers for the FTSO with a specified symbol. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Queried symbol. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Array of addresses of the whitelisted data providers. | -
-
- -
- -### `maxVotersForFtso` { #fn_maxvotersforftso_98dccfc2 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function maxVotersForFtso( - uint256 _ftsoIndex -) external view returns ( - uint256); -``` - -Maximum number of voters in the whitelist for a specific FTSO. -Adjustable separately for each index. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index of the FTSO. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Maximum allowed voters. | -
-
- -
- -### `removeFtso` { #fn_removeftso_d8736171 } - -
-Defined in `IIVoterWhitelister` ([Docs](./IIVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/interface/IIVoterWhitelister.sol)). -
- -
- -```solidity -function removeFtso( - uint256 _ftsoIndex -) external; -``` - -Clear whitelist for a removed FTSO. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index of the removed FTSO. | - -
-
- -
- -### `removeTrustedAddressFromWhitelist` { #fn_removetrustedaddressfromwhitelist_9dc950ab } - -
-Defined in `IIVoterWhitelister` ([Docs](./IIVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/interface/IIVoterWhitelister.sol)). -
- -
- -```solidity -function removeTrustedAddressFromWhitelist( - address _trustedAddress, - uint256 _ftsoIndex -) external; -``` - -Remove a trusted address from whitelist. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_trustedAddress` | `address` | Address to remove. | -| `_ftsoIndex` | `uint256` | Index of the FTSO being modified. | - -
-
- -
- -### `requestFullVoterWhitelisting` { #fn_requestfullvoterwhitelisting_b06cbaf7 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function requestFullVoterWhitelisting( - address _voter -) external returns ( - uint256[] _supportedIndices, - bool[] _success); -``` - -Requests whitelisting an account to act as a data provider for all active FTSOs. -May be called by any address, including the voter itself. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the voter to be whitelisted. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of currently supported FTSO indices. | -| `_success` | `bool[]` | Array of success flags by FTSO index. | -
-
- -
- -### `requestWhitelistingVoter` { #fn_requestwhitelistingvoter_3de2cb1c } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function requestWhitelistingVoter( - address _voter, - uint256 _ftsoIndex -) external; -``` - -Requests whitelisting an account to act as a data provider for a specific FTSO. -Reverts if the vote power of the account is too low. -May be called by any address, including the voter itself. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the voter to be whitelisted. | -| `_ftsoIndex` | `uint256` | Index of the FTSO. | - -
-
- -
- -### `setDefaultMaxVotersForFtso` { #fn_setdefaultmaxvotersforftso_2ee96140 } - -
-Defined in `IIVoterWhitelister` ([Docs](./IIVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/interface/IIVoterWhitelister.sol)). -
- -
- -```solidity -function setDefaultMaxVotersForFtso( - uint256 _defaultMaxVotersForFtso -) external; -``` - -Set the maximum number of voters in the whitelist for a new FTSOs. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_defaultMaxVotersForFtso` | `uint256` | New maximum default value. | - -
-
- -
- -### `setMaxVotersForFtso` { #fn_setmaxvotersforftso_7ecfcfa3 } - -
-Defined in `IIVoterWhitelister` ([Docs](./IIVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/interface/IIVoterWhitelister.sol)). -
- -
- -```solidity -function setMaxVotersForFtso( - uint256 _ftsoIndex, - uint256 _newMaxVoters -) external; -``` - -Set the maximum number of voters in the whitelist for a specific FTSO. -Can remove voters with the least votepower from the whitelist. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index of the FTSO to modify. | -| `_newMaxVoters` | `uint256` | New size of the whitelist. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IInflationGenesis.md b/docs/apis/smart-contracts/IInflationGenesis.md deleted file mode 100644 index cb98c15eb..000000000 --- a/docs/apis/smart-contracts/IInflationGenesis.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: IInflationGenesis -search: - boost: 0.5 ---- - - - -# `IInflationGenesis` { #ct_iinflationgenesis } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IInflationGenesis.sol) -
- -
- -Portion of the [`Inflation`](./Inflation.md) contract that is available to contracts deployed at genesis. - -
- -
- -## Functions - -
- -### `receiveMinting` { #fn_receiveminting_c611c2c5 } - -
-Defined in `IInflationGenesis` ([Docs](./IInflationGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IInflationGenesis.sol)). -
- -
- -```solidity -function receiveMinting( -) external payable; -``` - -Receive newly minted native tokens from the [`FlareDaemon`](./FlareDaemon.md). - -Assume that the received amount will be >= last topup requested across all services. -If there is not enough balance sent to cover the topup request, expect the library method to revert. -Also assume that any received balance greater than the calculated topup request -came from self-destructor sending a balance to this contract. - -
-
- -
- diff --git a/docs/apis/smart-contracts/IMerkleRootStorage.md b/docs/apis/smart-contracts/IMerkleRootStorage.md deleted file mode 100644 index 7536072bd..000000000 --- a/docs/apis/smart-contracts/IMerkleRootStorage.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: IMerkleRootStorage -search: - boost: 0.5 ---- - - - -# `IMerkleRootStorage` { #ct_imerklerootstorage } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/external/IMerkleRootStorage.sol) -
- -
- -Interface for accessing [State Connector](https://docs.flare.network/tech/state-connector) Merkle roots. -The Merkle roots are necessary to validate data retrieved from attestation providers. - -
- -
- -## Functions - -
- -### `merkleRoot` { #fn_merkleroot_3c70b357 } - -
-Defined in `IMerkleRootStorage` ([Docs](./IMerkleRootStorage.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/external/IMerkleRootStorage.sol)). -
- -
- -```solidity -function merkleRoot( - uint256 _roundId -) external view returns ( - bytes32); -``` - -Retrieves the Merkle root for a specified round. Requests are valid only within the range of TOTAL_STORED_PROOFS. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_roundId` | `uint256` | The ID of the round for which the Merkle root is being requested. It must be within the last 6720 rounds, which equals one week's worth of proofs, given the current 90-second BUFFER_WINDOW. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bytes32` | The Merkle root for the specified round. If the round ID is out of bounds, it reverts. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IPChainStakeMirror.md b/docs/apis/smart-contracts/IPChainStakeMirror.md deleted file mode 100644 index 22e1db3e9..000000000 --- a/docs/apis/smart-contracts/IPChainStakeMirror.md +++ /dev/null @@ -1,720 +0,0 @@ ---- -title: IPChainStakeMirror -search: - boost: 0.5 ---- - - - -# `IPChainStakeMirror` { #ct_ipchainstakemirror } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol) | Inherits from [IPChainVotePower](./IPChainVotePower.md) -
- -
- -Interface for the [`PChainStakeMirror`](./PChainStakeMirror.md) contract. - -
- -
- -## Events - -
- -### `MaxUpdatesPerBlockSet` { #ev_maxupdatesperblockset } - -
-Defined in `IPChainStakeMirror` ([Docs](./IPChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol)). -
- -
- -```solidity -event MaxUpdatesPerBlockSet( - uint256 maxUpdatesPerBlock -) -``` - -Event emitted when max updates per block is set. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `maxUpdatesPerBlock` | `uint256` | new number of max updated per block | - -
-
- -
- -### `StakeConfirmed` { #ev_stakeconfirmed } - -
-Defined in `IPChainStakeMirror` ([Docs](./IPChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol)). -
- -
- -```solidity -event StakeConfirmed( - address owner, - bytes20 nodeId, - bytes32 txHash, - uint256 amountWei, - bytes32 pChainTxId -) -``` - -Event emitted when the stake is confirmed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `owner` | `address` | The address who opened the stake. | -| `nodeId` | `bytes20` | Node id to which the stake was added. | -| `txHash` | `bytes32` | Unique tx hash - keccak256(abi.encode([`PChainStake`](./PChainStake.md).txId, [`PChainStake`](./PChainStake.md).inputAddress)); | -| `amountWei` | `uint256` | Stake amount (in wei). | -| `pChainTxId` | `bytes32` | P-chain transaction id. | - -
-
- -
- -### `StakeEnded` { #ev_stakeended } - -
-Defined in `IPChainStakeMirror` ([Docs](./IPChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol)). -
- -
- -```solidity -event StakeEnded( - address owner, - bytes20 nodeId, - bytes32 txHash, - uint256 amountWei -) -``` - -Event emitted when the stake has ended. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `owner` | `address` | The address whose stake has ended. | -| `nodeId` | `bytes20` | Node id from which the stake was removed. | -| `txHash` | `bytes32` | Unique tx hash - keccak256(abi.encode([`PChainStake`](./PChainStake.md).txId, [`PChainStake`](./PChainStake.md).inputAddress)); | -| `amountWei` | `uint256` | Stake amount (in wei). | - -
-
- -
- -### `StakeRevoked` { #ev_stakerevoked } - -
-Defined in `IPChainStakeMirror` ([Docs](./IPChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol)). -
- -
- -```solidity -event StakeRevoked( - address owner, - bytes20 nodeId, - bytes32 txHash, - uint256 amountWei -) -``` - -Event emitted when the stake was revoked. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `owner` | `address` | The address whose stake has ended. | -| `nodeId` | `bytes20` | Node id from which the stake was removed. | -| `txHash` | `bytes32` | Unique tx hash - keccak256(abi.encode([`PChainStake`](./PChainStake.md).txId, [`PChainStake`](./PChainStake.md).inputAddress)); | -| `amountWei` | `uint256` | Stake amount (in wei). | - -
-
- -
- -### `VotePowerCacheCreated` { #ev_votepowercachecreated } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -event VotePowerCacheCreated( - bytes20 nodeId, - uint256 blockNumber -) -``` - -Emitted when a vote power cache entry is created. -Allows history cleaners to track vote power cache cleanup opportunities off-chain. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `nodeId` | `bytes20` | The node id whose vote power has just been cached. | -| `blockNumber` | `uint256` | The block number at which the vote power has been cached. | - -
-
- -
- -### `VotePowerChanged` { #ev_votepowerchanged } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -event VotePowerChanged( - address owner, - bytes20 nodeId, - uint256 priorVotePower, - uint256 newVotePower -) -``` - -Event triggered when a stake is confirmed or at the time it ends. -Definition: [`votePowerFromTo`](#fn_votepowerfromto_59c345f5)(owner, nodeId)` is `changed` from `priorVotePower` to `newVotePower`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `owner` | `address` | The account that has changed the amount of vote power it is staking. | -| `nodeId` | `bytes20` | The node id whose received vote power has changed. | -| `priorVotePower` | `uint256` | The vote power originally on that node id. | -| `newVotePower` | `uint256` | The new vote power that triggered this event. | - -
-
- -
- -
- -## Functions - -
- -### `balanceOf` { #fn_balanceof_70a08231 } - -
-Defined in `IPChainStakeMirror` ([Docs](./IPChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol)). -
- -
- -```solidity -function balanceOf( - address _owner -) external view returns ( - uint256); -``` - -Queries the token balance of `_owner` at current block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address from which the balance will be retrieved. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current balance. | -
-
- -
- -### `balanceOfAt` { #fn_balanceofat_4ee2cd7e } - -
-Defined in `IPChainStakeMirror` ([Docs](./IPChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol)). -
- -
- -```solidity -function balanceOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Queries the token balance of `_owner` at a specific `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address from which the balance will be retrieved. | -| `_blockNumber` | `uint256` | The block number when the balance is queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The balance at `_blockNumber`. | -
-
- -
- -### `batchVotePowerOfAt` { #fn_batchvotepowerofat_a9e70199 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function batchVotePowerOfAt( - bytes20[] _nodeIds, - uint256 _blockNumber -) external view returns ( - uint256[]); -``` - -Return vote powers for several node ids in a batch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeIds` | `bytes20[]` | The list of node ids to fetch vote power of. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256[]` | A list of vote powers. | -
-
- -
- -### `isActiveStakeMirrored` { #fn_isactivestakemirrored_d9ab4dfe } - -
-Defined in `IPChainStakeMirror` ([Docs](./IPChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol)). -
- -
- -```solidity -function isActiveStakeMirrored( - bytes32 _txId, - bytes20 _inputAddress -) external view returns ( - bool); -``` - -Method for checking if active stake (stake start time <= block.timestamp < stake end time) was already mirrored. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_txId` | `bytes32` | P-chain stake transaction id. | -| `_inputAddress` | `bytes20` | P-chain address that opened stake. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | True if stake is active and mirrored. | -
-
- -
- -### `mirrorStake` { #fn_mirrorstake_2e335805 } - -
-Defined in `IPChainStakeMirror` ([Docs](./IPChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol)). -
- -
- -```solidity -function mirrorStake( - struct IPChainStakeMirrorVerifier.PChainStake _stakeData, - bytes32[] _merkleProof -) external; -``` - -Method for P-chain stake mirroring using [`PChainStake`](./PChainStake.md) data and Merkle proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_stakeData` | `struct IPChainStakeMirrorVerifier.PChainStake` | Information about P-chain stake. | -| `_merkleProof` | `bytes32[]` | Merkle proof that should be used to prove the P-chain stake. | - -
-
- -
- -### `stakesOf` { #fn_stakesof_33b69c4c } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function stakesOf( - address _owner -) external view returns ( - bytes20[] _nodeIds, - uint256[] _amounts); -``` - -Get the amounts and node ids being staked to by a vote power owner. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_nodeIds` | `bytes20[]` | Array of node ids. | -| `_amounts` | `uint256[]` | Array of staked amounts, for each node id. | -
-
- -
- -### `stakesOfAt` { #fn_stakesofat_4be91f32 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function stakesOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - bytes20[] _nodeIds, - uint256[] _amounts); -``` - -Get the amounts and node ids being staked to by a vote power owner, -at a given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_nodeIds` | `bytes20[]` | Array of node ids. | -| `_amounts` | `uint256[]` | Array of staked amounts, for each node id. | -
-
- -
- -### `totalSupply` { #fn_totalsupply_18160ddd } - -
-Defined in `IPChainStakeMirror` ([Docs](./IPChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol)). -
- -
- -```solidity -function totalSupply( -) external view returns ( - uint256); -``` - -Total amount of tokens at current block. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current total amount of tokens. | -
-
- -
- -### `totalSupplyAt` { #fn_totalsupplyat_981b24d0 } - -
-Defined in `IPChainStakeMirror` ([Docs](./IPChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainStakeMirror.sol)). -
- -
- -```solidity -function totalSupplyAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Total amount of tokens at a specific `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number when the totalSupply is queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total amount of tokens at `_blockNumber`. | -
-
- -
- -### `totalVotePower` { #fn_totalvotepower_f5f3d4f7 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function totalVotePower( -) external view returns ( - uint256); -``` - -Get the current total vote power. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current total vote power (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAt` { #fn_totalvotepowerat_3e5aa26a } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function totalVotePowerAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the block (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAtCached` { #fn_totalvotepoweratcached_caeb942b } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function totalVotePowerAtCached( - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` using cache. - It tries to read the cached value and if not found, reads the actual value and stores it in cache. - Can only be used if `_blockNumber` is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the block (sum of all accounts' vote powers). | -
-
- -
- -### `votePowerFromTo` { #fn_votepowerfromto_59c345f5 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function votePowerFromTo( - address _owner, - bytes20 _nodeId -) external view returns ( - uint256); -``` - -Get current staked vote power from `_owner` staked to `_nodeId`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Address of vote power owner. | -| `_nodeId` | `bytes20` | Node id. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The staked vote power. | -
-
- -
- -### `votePowerFromToAt` { #fn_votepowerfromtoat_1f7ff2c7 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function votePowerFromToAt( - address _owner, - bytes20 _nodeId, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get current staked vote power from `_owner` staked to `_nodeId` at `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Address of vote power owner. | -| `_nodeId` | `bytes20` | Node id. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The staked vote power. | -
-
- -
- -### `votePowerOf` { #fn_votepowerof_b4eb2a81 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function votePowerOf( - bytes20 _nodeId -) external view returns ( - uint256); -``` - -Get the current vote power of `_nodeId`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | The node id to get voting power. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Current vote power of `_nodeId`. | -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_46431374 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function votePowerOfAt( - bytes20 _nodeId, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_nodeId` at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | The node id to get voting power. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_nodeId` at `_blockNumber`. | -
-
- -
- -### `votePowerOfAtCached` { #fn_votepowerofatcached_bd61ffee } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function votePowerOfAtCached( - bytes20 _owner, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` using cache. - It tries to read the cached value and if not found, reads the actual value and stores it in cache. - Can only be used if _blockNumber is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `bytes20` | The node id to get voting power. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at `_blockNumber`. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IPChainVotePower.md b/docs/apis/smart-contracts/IPChainVotePower.md deleted file mode 100644 index 0932e56d0..000000000 --- a/docs/apis/smart-contracts/IPChainVotePower.md +++ /dev/null @@ -1,429 +0,0 @@ ---- -title: IPChainVotePower -search: - boost: 0.5 ---- - - - -# `IPChainVotePower` { #ct_ipchainvotepower } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol) -
- -
- -Interface for the vote power part of the [`PChainStakeMirror`](./PChainStakeMirror.md) contract. - -
- -
- -## Events - -
- -### `VotePowerCacheCreated` { #ev_votepowercachecreated } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -event VotePowerCacheCreated( - bytes20 nodeId, - uint256 blockNumber -) -``` - -Emitted when a vote power cache entry is created. -Allows history cleaners to track vote power cache cleanup opportunities off-chain. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `nodeId` | `bytes20` | The node id whose vote power has just been cached. | -| `blockNumber` | `uint256` | The block number at which the vote power has been cached. | - -
-
- -
- -### `VotePowerChanged` { #ev_votepowerchanged } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -event VotePowerChanged( - address owner, - bytes20 nodeId, - uint256 priorVotePower, - uint256 newVotePower -) -``` - -Event triggered when a stake is confirmed or at the time it ends. -Definition: [`votePowerFromTo`](#fn_votepowerfromto_59c345f5)(owner, nodeId)` is `changed` from `priorVotePower` to `newVotePower`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `owner` | `address` | The account that has changed the amount of vote power it is staking. | -| `nodeId` | `bytes20` | The node id whose received vote power has changed. | -| `priorVotePower` | `uint256` | The vote power originally on that node id. | -| `newVotePower` | `uint256` | The new vote power that triggered this event. | - -
-
- -
- -
- -## Functions - -
- -### `batchVotePowerOfAt` { #fn_batchvotepowerofat_a9e70199 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function batchVotePowerOfAt( - bytes20[] _nodeIds, - uint256 _blockNumber -) external view returns ( - uint256[]); -``` - -Return vote powers for several node ids in a batch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeIds` | `bytes20[]` | The list of node ids to fetch vote power of. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256[]` | A list of vote powers. | -
-
- -
- -### `stakesOf` { #fn_stakesof_33b69c4c } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function stakesOf( - address _owner -) external view returns ( - bytes20[] _nodeIds, - uint256[] _amounts); -``` - -Get the amounts and node ids being staked to by a vote power owner. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_nodeIds` | `bytes20[]` | Array of node ids. | -| `_amounts` | `uint256[]` | Array of staked amounts, for each node id. | -
-
- -
- -### `stakesOfAt` { #fn_stakesofat_4be91f32 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function stakesOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - bytes20[] _nodeIds, - uint256[] _amounts); -``` - -Get the amounts and node ids being staked to by a vote power owner, -at a given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_nodeIds` | `bytes20[]` | Array of node ids. | -| `_amounts` | `uint256[]` | Array of staked amounts, for each node id. | -
-
- -
- -### `totalVotePower` { #fn_totalvotepower_f5f3d4f7 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function totalVotePower( -) external view returns ( - uint256); -``` - -Get the current total vote power. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current total vote power (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAt` { #fn_totalvotepowerat_3e5aa26a } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function totalVotePowerAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the block (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAtCached` { #fn_totalvotepoweratcached_caeb942b } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function totalVotePowerAtCached( - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` using cache. - It tries to read the cached value and if not found, reads the actual value and stores it in cache. - Can only be used if `_blockNumber` is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the block (sum of all accounts' vote powers). | -
-
- -
- -### `votePowerFromTo` { #fn_votepowerfromto_59c345f5 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function votePowerFromTo( - address _owner, - bytes20 _nodeId -) external view returns ( - uint256); -``` - -Get current staked vote power from `_owner` staked to `_nodeId`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Address of vote power owner. | -| `_nodeId` | `bytes20` | Node id. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The staked vote power. | -
-
- -
- -### `votePowerFromToAt` { #fn_votepowerfromtoat_1f7ff2c7 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function votePowerFromToAt( - address _owner, - bytes20 _nodeId, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get current staked vote power from `_owner` staked to `_nodeId` at `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Address of vote power owner. | -| `_nodeId` | `bytes20` | Node id. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The staked vote power. | -
-
- -
- -### `votePowerOf` { #fn_votepowerof_b4eb2a81 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function votePowerOf( - bytes20 _nodeId -) external view returns ( - uint256); -``` - -Get the current vote power of `_nodeId`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | The node id to get voting power. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Current vote power of `_nodeId`. | -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_46431374 } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function votePowerOfAt( - bytes20 _nodeId, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_nodeId` at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | The node id to get voting power. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_nodeId` at `_blockNumber`. | -
-
- -
- -### `votePowerOfAtCached` { #fn_votepowerofatcached_bd61ffee } - -
-Defined in `IPChainVotePower` ([Docs](./IPChainVotePower.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPChainVotePower.sol)). -
- -
- -```solidity -function votePowerOfAtCached( - bytes20 _owner, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` using cache. - It tries to read the cached value and if not found, reads the actual value and stores it in cache. - Can only be used if _blockNumber is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `bytes20` | The node id to get voting power. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at `_blockNumber`. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IPaymentVerification.md b/docs/apis/smart-contracts/IPaymentVerification.md deleted file mode 100644 index e56dd6934..000000000 --- a/docs/apis/smart-contracts/IPaymentVerification.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: IPaymentVerification -search: - boost: 0.5 ---- - - - -# `IPaymentVerification` { #ct_ipaymentverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IPaymentVerification.sol) -
- -
- -Interface for verifying [`Payment`](../attestation-types/Payment.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This interface can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `verifyPayment` { #fn_verifypayment_8cc386ce } - -
-Defined in `IPaymentVerification` ([Docs](./IPaymentVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IPaymentVerification.sol)). -
- -
- -```solidity -function verifyPayment( - struct Payment.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`Payment`](../attestation-types/Payment.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct Payment.Proof` | The [`Payment`](../attestation-types/Payment.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IPriceSubmitter.md b/docs/apis/smart-contracts/IPriceSubmitter.md deleted file mode 100644 index a23c59a03..000000000 --- a/docs/apis/smart-contracts/IPriceSubmitter.md +++ /dev/null @@ -1,312 +0,0 @@ ---- -title: IPriceSubmitter -search: - boost: 0.5 ---- - - - -# `IPriceSubmitter` { #ct_ipricesubmitter } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol) -
- -
- -Interface for the [`PriceSubmitter`](./PriceSubmitter.md) contract. - -This is the contract used by all [FTSO data providers](https://docs.flare.network/tech/ftso) -to submit their data. - -
- -
- -## Events - -
- -### `HashSubmitted` { #ev_hashsubmitted } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -event HashSubmitted( - address submitter, - uint256 epochId, - bytes32 hash, - uint256 timestamp -) -``` - -Emitted when a hash is submitted through [`submitHash`](#fn_submithash_8fc6f667). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `submitter` | `address` | Address of the submitting data provider. | -| `epochId` | `uint256` | Current price epoch ID. | -| `hash` | `bytes32` | Submitted hash. | -| `timestamp` | `uint256` | Current block timestamp. | - -
-
- -
- -### `PricesRevealed` { #ev_pricesrevealed } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -event PricesRevealed( - address voter, - uint256 epochId, - contract IFtsoGenesis[] ftsos, - uint256[] prices, - uint256 random, - uint256 timestamp -) -``` - -Emitted when prices are revealed through `revealPrice`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `voter` | `address` | Address of the revealing data provider. | -| `epochId` | `uint256` | ID of the epoch in which the price hash is revealed. | -| `ftsos` | `contract IFtsoGenesis[]` | Array of FTSOs that correspond to the indexes in the call. | -| `prices` | `uint256[]` | List of revealed prices. | -| `random` | `uint256` | Revealed random number. | -| `timestamp` | `uint256` | Current block timestamp. | - -
-
- -
- -
- -## Functions - -
- -### `getCurrentRandom` { #fn_getcurrentrandom_d89601fd } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function getCurrentRandom( -) external view returns ( - uint256); -``` - -Returns the random number for the previous epoch, obtained from the random numbers -provided by all data providers along with their data submissions. -Note that the random number for the previous epoch keeps updating as new submissions are revealed. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Random number calculated from all data provider's submissions. | -
-
- -
- -### `getFtsoManager` { #fn_getftsomanager_b39c6858 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function getFtsoManager( -) external view returns ( - contract IFtsoManagerGenesis); -``` - -Returns the address of the [`FtsoManager`](./FtsoManager.md) contract. - -
-
- -
- -### `getFtsoRegistry` { #fn_getftsoregistry_8c9d28b6 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function getFtsoRegistry( -) external view returns ( - contract IFtsoRegistryGenesis); -``` - -Returns the address of the [`FtsoRegistry`](./FtsoRegistry.md) contract. - -
-
- -
- -### `getRandom` { #fn_getrandom_cd4b6914 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function getRandom( - uint256 _epochId -) external view returns ( - uint256); -``` - -Returns the random number used in a specific past epoch, obtained from the random numbers -provided by all data providers along with their data submissions. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the queried epoch. Current epoch cannot be queried, and the previous epoch is constantly updated as data providers reveal their prices and random numbers. Note that only the last 50 epochs can be queried and there is no bounds checking for this parameter. Out-of-bounds queries return undefined values. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The random number used in that epoch. | -
-
- -
- -### `getVoterWhitelister` { #fn_getvoterwhitelister_71e1fad9 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function getVoterWhitelister( -) external view returns ( - address); -``` - -Returns the address of the [`VoterWhitelister`](./VoterWhitelister.md) contract managing the data provider whitelist. - -
-
- -
- -### `revealPrices` { #fn_revealprices_e2db5a52 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function revealPrices( - uint256 _epochId, - uint256[] _ftsoIndices, - uint256[] _prices, - uint256 _random -) external; -``` - -Reveals submitted prices during the epoch reveal period. -The hash of FTSO indices, prices, random number, and voter address must be equal -to the hash previously submitted with [`submitHash`](#fn_submithash_8fc6f667). -Emits a [`PricesRevealed`](#ev_pricesrevealed) event. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch to which the price hashes are submitted. | -| `_ftsoIndices` | `uint256[]` | List of FTSO indices in ascending order. | -| `_prices` | `uint256[]` | List of submitted prices in USD. | -| `_random` | `uint256` | Submitted random number. | - -
-
- -
- -### `submitHash` { #fn_submithash_8fc6f667 } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function submitHash( - uint256 _epochId, - bytes32 _hash -) external; -``` - -Submits a hash for the current epoch. Can only be called by FTSO data providers -whitelisted through the `VoterWhitelisted` contract. -Emits the [`HashSubmitted`](#ev_hashsubmitted) event. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the target epoch to which the hash is submitted. | -| `_hash` | `bytes32` | A hash of the FTSO indices, prices, random number, and voter address. | - -
-
- -
- -### `voterWhitelistBitmap` { #fn_voterwhitelistbitmap_7ac420ad } - -
-Defined in `IPriceSubmitter` ([Docs](./IPriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IPriceSubmitter.sol)). -
- -
- -```solidity -function voterWhitelistBitmap( - address _voter -) external view returns ( - uint256); -``` - -Returns a bitmap of all FTSOs for which a data provider is allowed to submit prices or hashes. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the voter. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | If a data provider is allowed to vote for a given FTSO index, the corresponding bit in the result is 1. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IReferencedPaymentNonexistenceVerification.md b/docs/apis/smart-contracts/IReferencedPaymentNonexistenceVerification.md deleted file mode 100644 index e831570aa..000000000 --- a/docs/apis/smart-contracts/IReferencedPaymentNonexistenceVerification.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: IReferencedPaymentNonexistenceVerification -search: - boost: 0.5 ---- - - - -# `IReferencedPaymentNonexistenceVerification` { #ct_ireferencedpaymentnonexistenceverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IReferencedPaymentNonexistenceVerification.sol) -
- -
- -Interface for verifying [`ReferencedPaymentNonexistence`](../attestation-types/ReferencedPaymentNonexistence.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This interface can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `verifyReferencedPaymentNonexistence` { #fn_verifyreferencedpaymentnonexistence_be4b1ed8 } - -
-Defined in `IReferencedPaymentNonexistenceVerification` ([Docs](./IReferencedPaymentNonexistenceVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/interface/IReferencedPaymentNonexistenceVerification.sol)). -
- -
- -```solidity -function verifyReferencedPaymentNonexistence( - struct ReferencedPaymentNonexistence.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`ReferencedPaymentNonexistence`](../attestation-types/ReferencedPaymentNonexistence.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct ReferencedPaymentNonexistence.Proof` | The [`ReferencedPaymentNonexistence`](../attestation-types/ReferencedPaymentNonexistence.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- diff --git a/docs/apis/smart-contracts/IStateConnector.md b/docs/apis/smart-contracts/IStateConnector.md deleted file mode 100644 index 027490d7b..000000000 --- a/docs/apis/smart-contracts/IStateConnector.md +++ /dev/null @@ -1,191 +0,0 @@ ---- -title: IStateConnector -search: - boost: 0.5 ---- - - - -# `IStateConnector` { #ct_istateconnector } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/external/IStateConnector.sol) -
- -
- -Interface for interacting with the [State Connector](https://docs.flare.network/tech/state-connector/). - -The interface enables requests to be made to the State Connector and related data, such as round IDs and Merkle roots, to be managed. - -
- -
- -## Events - -
- -### `AttestationRequest` { #ev_attestationrequest } - -
-Defined in `IStateConnector` ([Docs](./IStateConnector.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/external/IStateConnector.sol)). -
- -
- -```solidity -event AttestationRequest( - address sender, - uint256 timestamp, - bytes data -) -``` - -Triggered after an attestation request is made. This event is used by attestation providers to start processing the requests. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `sender` | `address` | The address that initiated the attestation request. | -| `timestamp` | `uint256` | The UNIX epoch time in seconds when the request was made. | -| `data` | `bytes` | The hash of the data being attested to, including a message integrity code to ensure proper validation. | - -
-
- -
- -### `RoundFinalised` { #ev_roundfinalised } - -
-Defined in `IStateConnector` ([Docs](./IStateConnector.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/external/IStateConnector.sol)). -
- -
- -```solidity -event RoundFinalised( - uint256 roundId, - bytes32 merkleRoot -) -``` - -Triggered after a round of attestations is completed and the data for that round is validated and finalized. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `roundId` | `uint256` | The ID of the round that is finalized. | -| `merkleRoot` | `bytes32` | The corresponding Merkle root for the finalized round. | - -
-
- -
- -
- -## Functions - -
- -### `BUFFER_TIMESTAMP_OFFSET` { #fn_buffer_timestamp_offset_4b8a125f } - -
-Defined in `IStateConnector` ([Docs](./IStateConnector.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/external/IStateConnector.sol)). -
- -
- -```solidity -function BUFFER_TIMESTAMP_OFFSET( -) external view returns ( - uint256); -``` - -Retrieves the timestamp of round number 0, which serves as an offset to calculate the timestamps -of all subsequent attestation rounds. For more details, see [`BUFFER_WINDOW`](#fn_buffer_window_f5f59a4a). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The timestamp offset in seconds since the UNIX epoch. | -
-
- -
- -### `BUFFER_WINDOW` { #fn_buffer_window_f5f59a4a } - -
-Defined in `IStateConnector` ([Docs](./IStateConnector.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/external/IStateConnector.sol)). -
- -
- -```solidity -function BUFFER_WINDOW( -) external view returns ( - uint256); -``` - -Retrieves the duration of attestation rounds, which is used to calculate the round ID from a given timestamp. -The calculation formula is: roundId = (timestamp - [`BUFFER_TIMESTAMP_OFFSET`](#fn_buffer_timestamp_offset_4b8a125f)) / [`BUFFER_WINDOW`](#fn_buffer_window_f5f59a4a). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The duration in seconds of an attestation round. | -
-
- -
- -### `lastFinalizedRoundId` { #fn_lastfinalizedroundid_dd862157 } - -
-Defined in `IStateConnector` ([Docs](./IStateConnector.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/external/IStateConnector.sol)). -
- -
- -```solidity -function lastFinalizedRoundId( -) external view returns ( - uint256 _roundId); -``` - -Retrieves the ID of the most recently finalized round, which corresponds to the last round ID -that has a stored Merkle root available. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_roundId` | `uint256` | The ID of the last finalized round. | -
-
- -
- -### `requestAttestations` { #fn_requestattestations_f64b6fda } - -
-Defined in `IStateConnector` ([Docs](./IStateConnector.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/interface/external/IStateConnector.sol)). -
- -
- -```solidity -function requestAttestations( - bytes _data -) external; -``` - -Requests an attestation and emits the [`AttestationRequest`](#ev_attestationrequest) event. -To learn about the format of this data, see [Attestation types](https://gitlab.com/flarenetwork/state-connector-protocol/-/blob/main/specs/attestations/attestation-type-definition.md). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_data` | `bytes` | The data being submitted for attestation. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IVPContractEvents.md b/docs/apis/smart-contracts/IVPContractEvents.md deleted file mode 100644 index 9719064bd..000000000 --- a/docs/apis/smart-contracts/IVPContractEvents.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: IVPContractEvents -search: - boost: 0.5 ---- - - - -# `IVPContractEvents` { #ct_ivpcontractevents } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPContractEvents.sol) -
- -
- -Events interface for vote-power related operations. - -
- -
- -## Events - -
- -### `Delegate` { #ev_delegate } - -
-Defined in `IVPContractEvents` ([Docs](./IVPContractEvents.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPContractEvents.sol)). -
- -
- -```solidity -event Delegate( - address from, - address to, - uint256 priorVotePower, - uint256 newVotePower -) -``` - -Emitted when the amount of vote power delegated from one account to another changes. - -**Note**: This event is always emitted from [`VPToken`](./VPToken.md)'s `writeVotePowerContract`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `from` | `address` | The account that has changed the amount of vote power it is delegating. | -| `to` | `address` | The account whose received vote power has changed. | -| `priorVotePower` | `uint256` | The vote power originally delegated. | -| `newVotePower` | `uint256` | The new vote power that triggered this event. It can be 0 if the delegation is completely canceled. | - -
-
- -
- -### `Revoke` { #ev_revoke } - -
-Defined in `IVPContractEvents` ([Docs](./IVPContractEvents.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPContractEvents.sol)). -
- -
- -```solidity -event Revoke( - address delegator, - address delegatee, - uint256 votePower, - uint256 blockNumber -) -``` - -Emitted when an account revokes its vote power delegation to another account -for a single current or past block (typically the current vote block). - -**Note**: This event is always emitted from [`VPToken`](./VPToken.md)'s `writeVotePowerContract` or `readVotePowerContract`. - -See `revokeDelegationAt` in [`IVPToken`](./IVPToken.md). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `delegator` | `address` | The account that revoked the delegation. | -| `delegatee` | `address` | The account that has been revoked. | -| `votePower` | `uint256` | The revoked vote power. | -| `blockNumber` | `uint256` | The block number at which the delegation has been revoked. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IVPToken.md b/docs/apis/smart-contracts/IVPToken.md deleted file mode 100644 index 7bd743f74..000000000 --- a/docs/apis/smart-contracts/IVPToken.md +++ /dev/null @@ -1,952 +0,0 @@ ---- -title: IVPToken -search: - boost: 0.5 ---- - - - -# `IVPToken` { #ct_ivptoken } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol) | Inherits from IERC20 -
- -
- -Vote power token interface. - -
- -
- -## Functions - -
- -### `allowance` { #fn_allowance_dd62ed3e } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function allowance( - address owner, - address spender -) external view returns ( - uint256); -``` - -Returns the remaining number of tokens that `spender` will be -allowed to spend on behalf of `owner` through [`transferFrom`](#fn_transferfrom_23b872dd). This is -zero by default. - -This value changes when [`approve`](#fn_approve_095ea7b3) or [`transferFrom`](#fn_transferfrom_23b872dd) are called. - -
-
- -
- -### `approve` { #fn_approve_095ea7b3 } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function approve( - address spender, - uint256 amount -) external returns ( - bool); -``` - -Sets `amount` as the [`allowance`](#fn_allowance_dd62ed3e) of `spender` over the caller's tokens. - -Returns a boolean value indicating whether the operation succeeded. - -IMPORTANT: Beware that changing an [`allowance`](#fn_allowance_dd62ed3e) with this method brings the risk -that someone may use both the old and the new [`allowance`](#fn_allowance_dd62ed3e) by unfortunate -transaction ordering. One possible solution to mitigate this race -condition is to first reduce the spender's [`allowance`](#fn_allowance_dd62ed3e) to 0 and set the -desired value afterwards: -https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - -Emits an [`Approval`](#ev_approval) event. - -
-
- -
- -### `balanceOf` { #fn_balanceof_70a08231 } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function balanceOf( - address account -) external view returns ( - uint256); -``` - -Returns the amount of tokens owned by `account`. - -
-
- -
- -### `balanceOfAt` { #fn_balanceofat_4ee2cd7e } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function balanceOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Queries the token balance of `_owner` at a specific `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address from which the balance will be retrieved. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The balance at `_blockNumber`. | -
-
- -
- -### `batchDelegate` { #fn_batchdelegate_dc4fcda7 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function batchDelegate( - address[] _delegatees, - uint256[] _bips -) external; -``` - -Undelegate all percentage delegations from the sender and then [`delegate`](#fn_delegate_026e402b) corresponding - `_bips` percentage of voting power from the sender to each member of the `_delegatees` array. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegatees` | `address[]` | The addresses of the new recipients. | -| `_bips` | `uint256[]` | The percentages of voting power to be delegated expressed in basis points (1/100 of one percent). The sum of all `_bips` values must be at most 10000 (100%). | - -
-
- -
- -### `decimals` { #fn_decimals_313ce567 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function decimals( -) external view returns ( - uint8); -``` - -Returns the number of [`decimals`](#fn_decimals_313ce567) used to get its user representation. -For example, if [`decimals`](#fn_decimals_313ce567) equals 2, a balance of 505 tokens should -be displayed to a user as 5.05 (505 / 102). - -Tokens usually opt for a value of 18, imitating the relationship between -Ether and wei. This is the default value returned by this function, unless -it's overridden. - -NOTE: This information is only used for _display_ purposes: it in -no way affects any of the arithmetic of the contract, including -[`balanceOf`](#fn_balanceof_70a08231) and [`transfer`](#fn_transfer_a9059cbb). - -Should be compatible with ERC20 method. - -
-
- -
- -### `delegate` { #fn_delegate_026e402b } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function delegate( - address _to, - uint256 _bips -) external; -``` - -Delegate voting power to account `_to` from `msg.sender`, by percentage. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_bips` | `uint256` | The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: every call resets the delegation value (and a value of 0 revokes all previous delegations). | - -
-
- -
- -### `delegateExplicit` { #fn_delegateexplicit_d06dc3ad } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function delegateExplicit( - address _to, - uint256 _amount -) external; -``` - -Explicitly [`delegate`](#fn_delegate_026e402b) `_amount` voting power to account `_to` from `msg.sender`. -Compare with [`delegate`](#fn_delegate_026e402b) which delegates by percentage. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_amount` | `uint256` | An explicit vote power amount to be delegated. Not cumulative: every call resets the delegation value (and a value of 0 revokes all previous delegations). | - -
-
- -
- -### `delegatesOf` { #fn_delegatesof_7de5b8ed } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function delegatesOf( - address _who -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the list of addresses to which `_who` is delegating, and their percentages. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Positional array of addresses being delegated to. | -| `_bips` | `uint256[]` | Positional array of delegation percents specified in basis points (1/100 of 1 percent). Each one matches the address in the same position in the `_delegateAddresses` array. | -| `_count` | `uint256` | The number of delegates. | -| `_delegationMode` | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `delegatesOfAt` { #fn_delegatesofat_ed475a79 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function delegatesOfAt( - address _who, - uint256 _blockNumber -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the list of addresses to which `_who` is delegating, and their percentages, at the given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Positional array of addresses being delegated to. | -| `_bips` | `uint256[]` | Positional array of delegation percents specified in basis points (1/100 of 1 percent). Each one matches the address in the same position in the `_delegateAddresses` array. | -| `_count` | `uint256` | The number of delegates. | -| `_delegationMode` | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `delegationModeOf` { #fn_delegationmodeof_f6837767 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function delegationModeOf( - address _who -) external view returns ( - uint256); -``` - -Get the delegation mode for account '_who'. This mode determines whether vote power is -allocated by percentage or by explicit amount. Once the delegation mode is set, -it can never be changed, even if all delegations are removed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address to get delegation mode. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `governanceVotePower` { #fn_governancevotepower_8c2b8ae1 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function governanceVotePower( -) external view returns ( - contract IGovernanceVotePower); -``` - -When set, allows token owners to participate in governance voting -and delegating governance vote power. - -
-
- -
- -### `name` { #fn_name_06fdde03 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function name( -) external view returns ( - string); -``` - -Returns the [`name`](#fn_name_06fdde03) of the token. - -Should be compatible with ERC20 method. - -
-
- -
- -### `readVotePowerContract` { #fn_readvotepowercontract_9b3baa0e } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function readVotePowerContract( -) external view returns ( - contract IVPContractEvents); -``` - -Returns [`VPContract`](./VPContract.md) event interface used for read-only operations (view methods). -The only non-view method that might be called on it is [`revokeDelegationAt`](#fn_revokedelegationat_bbd6fbf8). - -[`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e) is almost always equal to [`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) -except during an upgrade from one [`VPContract`](./VPContract.md) to a new version (which should happen -rarely or never and will be announced beforehand). - -Do not call any methods on [`VPContract`](./VPContract.md) directly. -State changing methods are forbidden from direct calls. -All methods are exposed via [`VPToken`](./VPToken.md). -This is the reason that this method returns [`IVPContractEvents`](./IVPContractEvents.md). -Use it only for listening to events and revoking. - -
-
- -
- -### `revokeDelegationAt` { #fn_revokedelegationat_bbd6fbf8 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function revokeDelegationAt( - address _who, - uint256 _blockNumber -) external; -``` - -Revoke all delegation from sender to `_who` at given block. -Only affects the reads via `votePowerOfAtCached()` in the block `_blockNumber`. -Block `_blockNumber` must be in the past. -This method should be used only to prevent rogue [`delegate`](#fn_delegate_026e402b) voting in the current voting block. -To stop delegating use [`delegate`](#fn_delegate_026e402b) / [`delegateExplicit`](#fn_delegateexplicit_d06dc3ad) with value of 0 or [`undelegateAll`](#fn_undelegateall_b302f393) / [`undelegateAllExplicit`](#fn_undelegateallexplicit_5d6d11eb). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | Address of the delegatee. | -| `_blockNumber` | `uint256` | The block number at which to revoke delegation.. | - -
-
- -
- -### `symbol` { #fn_symbol_95d89b41 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function symbol( -) external view returns ( - string); -``` - -Returns the [`symbol`](#fn_symbol_95d89b41) of the token, usually a shorter version of the [`name`](#fn_name_06fdde03). - -Should be compatible with ERC20 method. - -
-
- -
- -### `totalSupply` { #fn_totalsupply_18160ddd } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function totalSupply( -) external view returns ( - uint256); -``` - -Returns the amount of tokens in existence. - -
-
- -
- -### `totalSupplyAt` { #fn_totalsupplyat_981b24d0 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function totalSupplyAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Total amount of tokens held by all accounts at a specific block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total amount of tokens at `_blockNumber`. | -
-
- -
- -### `totalVotePower` { #fn_totalvotepower_f5f3d4f7 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function totalVotePower( -) external view returns ( - uint256); -``` - -Get the current total vote power. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current total vote power (sum of all accounts' vote power). | -
-
- -
- -### `totalVotePowerAt` { #fn_totalvotepowerat_3e5aa26a } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function totalVotePowerAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the queried block (sum of all accounts' vote powers). | -
-
- -
- -### `transfer` { #fn_transfer_a9059cbb } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function transfer( - address recipient, - uint256 amount -) external returns ( - bool); -``` - -Moves `amount` tokens from the caller's account to `recipient`. - -Returns a boolean value indicating whether the operation succeeded. - -Emits a [`Transfer`](#ev_transfer) event. - -
-
- -
- -### `transferFrom` { #fn_transferfrom_23b872dd } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function transferFrom( - address sender, - address recipient, - uint256 amount -) external returns ( - bool); -``` - -Moves `amount` tokens from `sender` to `recipient` using the -[`allowance`](#fn_allowance_dd62ed3e) mechanism. `amount` is then deducted from the caller's -[`allowance`](#fn_allowance_dd62ed3e). - -Returns a boolean value indicating whether the operation succeeded. - -Emits a [`Transfer`](#ev_transfer) event. - -
-
- -
- -### `undelegateAll` { #fn_undelegateall_b302f393 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function undelegateAll( -) external; -``` - -Undelegate all voting power of `msg.sender`. This effectively revokes all previous delegations. -Can only be used with percentage delegation. -Does not reset delegation mode back to NOT SET. - -
-
- -
- -### `undelegateAllExplicit` { #fn_undelegateallexplicit_5d6d11eb } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function undelegateAllExplicit( - address[] _delegateAddresses -) external returns ( - uint256); -``` - -Undelegate all explicit vote power by amount of `msg.sender`. -Can only be used with explicit delegation. -Does not reset delegation mode back to NOT SET. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Explicit delegation does not store delegatees' addresses, so the caller must supply them. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The amount still delegated (in case the list of delegates was incomplete). | -
-
- -
- -### `undelegatedVotePowerOf` { #fn_undelegatedvotepowerof_d6aa0b77 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function undelegatedVotePowerOf( - address _owner -) external view returns ( - uint256); -``` - -Compute the current undelegated vote power of the `_owner` account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`. | -
-
- -
- -### `undelegatedVotePowerOfAt` { #fn_undelegatedvotepowerofat_83035a82 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function undelegatedVotePowerOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the undelegated vote power of the `_owner` account at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`. | -
-
- -
- -### `votePowerFromTo` { #fn_votepowerfromto_be0ca747 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function votePowerFromTo( - address _from, - address _to -) external view returns ( - uint256); -``` - -Get current delegated vote power from delegator `_from` to delegatee `_to`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of delegator. | -| `_to` | `address` | Address of delegatee. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | votePower The delegated vote power. | -
-
- -
- -### `votePowerFromToAt` { #fn_votepowerfromtoat_e64767aa } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function votePowerFromToAt( - address _from, - address _to, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get delegated vote power from delegator `_from` to delegatee `_to` at `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of delegator. | -| `_to` | `address` | Address of delegatee. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The delegated vote power. | -
-
- -
- -### `votePowerOf` { #fn_votepowerof_142d1018 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function votePowerOf( - address _owner -) external view returns ( - uint256); -``` - -Get the current vote power of `_owner`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Current vote power of `_owner`. | -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_92bfe6d8 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function votePowerOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at block number `_blockNumber`. | -
-
- -
- -### `votePowerOfAtIgnoringRevocation` { #fn_votepowerofatignoringrevocation_04bb4e43 } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function votePowerOfAtIgnoringRevocation( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber`, ignoring revocation information (and cache). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at block number `_blockNumber`. Result doesn't change if vote power is revoked. | -
-
- -
- -### `writeVotePowerContract` { #fn_writevotepowercontract_1fec092a } - -
-Defined in `IVPToken` ([Docs](./IVPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVPToken.sol)). -
- -
- -```solidity -function writeVotePowerContract( -) external view returns ( - contract IVPContractEvents); -``` - -Returns [`VPContract`](./VPContract.md) event interface used for state-changing operations (non-view methods). -The only non-view method that might be called on it is [`revokeDelegationAt`](#fn_revokedelegationat_bbd6fbf8). - -[`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) is almost always equal to [`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e), -except during upgrade from one [`VPContract`](./VPContract.md) to a new version (which should happen -rarely or never and will be announced beforehand). -In the case of an upgrade, [`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) is replaced first to establish delegations. -After some period (e.g., after a reward epoch ends), [`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e) is set equal to it. - -Do not call any methods on [`VPContract`](./VPContract.md) directly. -State changing methods are forbidden from direct calls. -All are exposed via [`VPToken`](./VPToken.md). -This is the reason that this method returns [`IVPContractEvents`](./IVPContractEvents.md) -Use it only for listening to events, delegating, and revoking. - -
-
- -
- diff --git a/docs/apis/smart-contracts/IVoterWhitelister.md b/docs/apis/smart-contracts/IVoterWhitelister.md deleted file mode 100644 index c131bdb55..000000000 --- a/docs/apis/smart-contracts/IVoterWhitelister.md +++ /dev/null @@ -1,318 +0,0 @@ ---- -title: IVoterWhitelister -search: - boost: 0.5 ---- - - - -# `IVoterWhitelister` { #ct_ivoterwhitelister } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol) -
- -
- -Interface for managers of the [FTSO whitelist](https://docs.flare.network/infra/data/whitelisting/). - -Only addresses registered in this contract can submit data to the FTSO system. - -
- -
- -## Events - -
- -### `VoterChilled` { #ev_voterchilled } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -event VoterChilled( - address voter, - uint256 untilRewardEpoch -) -``` - -Emitted when an account is chilled from the voter whitelist. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `voter` | `address` | Address of the chilled account. | -| `untilRewardEpoch` | `uint256` | Epoch ID when the chill will be lifted. | - -
-
- -
- -### `VoterRemovedFromWhitelist` { #ev_voterremovedfromwhitelist } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -event VoterRemovedFromWhitelist( - address voter, - uint256 ftsoIndex -) -``` - -Emitted when an account is removed from the voter whitelist. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `voter` | `address` | Address of the removed account. | -| `ftsoIndex` | `uint256` | Index of the FTSO in which it was registered. | - -
-
- -
- -### `VoterWhitelisted` { #ev_voterwhitelisted } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -event VoterWhitelisted( - address voter, - uint256 ftsoIndex -) -``` - -Emitted when an account is added to the voter whitelist. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `voter` | `address` | Address of the added account. | -| `ftsoIndex` | `uint256` | Index of the FTSO to which it has been registered. | - -
-
- -
- -
- -## Functions - -
- -### `chilledUntilRewardEpoch` { #fn_chilleduntilrewardepoch_46538074 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function chilledUntilRewardEpoch( - address _voter -) external view returns ( - uint256); -``` - -In case of providing bad prices (e.g. collusion), the voter can be chilled for a few reward epochs. -A voter can whitelist again from a returned reward epoch onwards. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 ID of the epoch where the data provider can start submitting prices again. | -
-
- -
- -### `defaultMaxVotersForFtso` { #fn_defaultmaxvotersforftso_47ed51b1 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function defaultMaxVotersForFtso( -) external view returns ( - uint256); -``` - -Maximum number of voters in the whitelist for a new FTSO. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Default maximum allowed voters. | -
-
- -
- -### `getFtsoWhitelistedPriceProviders` { #fn_getftsowhitelistedpriceproviders_09fcb400 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function getFtsoWhitelistedPriceProviders( - uint256 _ftsoIndex -) external view returns ( - address[]); -``` - -Gets whitelisted price providers for the FTSO at a given index. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Queried index. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Array of addresses of the whitelisted data providers. | -
-
- -
- -### `getFtsoWhitelistedPriceProvidersBySymbol` { #fn_getftsowhitelistedpriceprovidersbysymbol_aa89dfd4 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function getFtsoWhitelistedPriceProvidersBySymbol( - string _symbol -) external view returns ( - address[]); -``` - -Gets whitelisted price providers for the FTSO with a specified symbol. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Queried symbol. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Array of addresses of the whitelisted data providers. | -
-
- -
- -### `maxVotersForFtso` { #fn_maxvotersforftso_98dccfc2 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function maxVotersForFtso( - uint256 _ftsoIndex -) external view returns ( - uint256); -``` - -Maximum number of voters in the whitelist for a specific FTSO. -Adjustable separately for each index. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index of the FTSO. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Maximum allowed voters. | -
-
- -
- -### `requestFullVoterWhitelisting` { #fn_requestfullvoterwhitelisting_b06cbaf7 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function requestFullVoterWhitelisting( - address _voter -) external returns ( - uint256[] _supportedIndices, - bool[] _success); -``` - -Requests whitelisting an account to act as a data provider for all active FTSOs. -May be called by any address, including the voter itself. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the voter to be whitelisted. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of currently supported FTSO indices. | -| `_success` | `bool[]` | Array of success flags by FTSO index. | -
-
- -
- -### `requestWhitelistingVoter` { #fn_requestwhitelistingvoter_3de2cb1c } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function requestWhitelistingVoter( - address _voter, - uint256 _ftsoIndex -) external; -``` - -Requests whitelisting an account to act as a data provider for a specific FTSO. -Reverts if the vote power of the account is too low. -May be called by any address, including the voter itself. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the voter to be whitelisted. | -| `_ftsoIndex` | `uint256` | Index of the FTSO. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/IWNat.md b/docs/apis/smart-contracts/IWNat.md deleted file mode 100644 index b25488d2d..000000000 --- a/docs/apis/smart-contracts/IWNat.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -title: IWNat -search: - boost: 0.5 ---- - - - -# `IWNat` { #ct_iwnat } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IWNat.sol) -
- -
- -Wrapped native token interface. - -This contract converts native tokens into `WNAT` (wrapped native) tokens and vice versa. -`WNAT` tokens are a one-to-one [ERC20](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) -representation of native tokens, which are minted and burned as needed by this contract. - -The wrapped versions of the native `FLR` and `SGB` tokens are called `WFLR` and `WSGB` respectively. - -Code attribution: WETH9. - -
- -
- -## Functions - -
- -### `deposit` { #fn_deposit_d0e30db0 } - -
-Defined in `IWNat` ([Docs](./IWNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IWNat.sol)). -
- -
- -```solidity -function deposit( -) external payable; -``` - -Deposits native tokens and mints the same amount of `WNAT` tokens, -which are added to the `msg.sender`'s balance. -This operation is commonly known as "wrapping". - -
-
- -
- -### `depositTo` { #fn_depositto_b760faf9 } - -
-Defined in `IWNat` ([Docs](./IWNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IWNat.sol)). -
- -
- -```solidity -function depositTo( - address _recipient -) external payable; -``` - -Deposits native tokens and mints the same amount of `WNAT` tokens, -which are added to `_recipient`'s balance. -This operation is commonly known as "wrapping". - -This is equivalent to using [`deposit`](#fn_deposit_d0e30db0) followed by `transfer`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipient` | `address` | The address to receive the minted `WNAT`. | - -
-
- -
- -### `withdraw` { #fn_withdraw_2e1a7d4d } - -
-Defined in `IWNat` ([Docs](./IWNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IWNat.sol)). -
- -
- -```solidity -function withdraw( - uint256 _amount -) external; -``` - -Burns `_amount` of `WNAT` tokens from `msg.sender`'s `WNAT` balance and -transfers the same amount of native tokens to `msg.sender`. -This operation is commonly known as "unwrapping". - -Reverts if `_amount` is higher than `msg.sender`'s `WNAT` balance. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_amount` | `uint256` | The amount to withdraw. | - -
-
- -
- -### `withdrawFrom` { #fn_withdrawfrom_9470b0bd } - -
-Defined in `IWNat` ([Docs](./IWNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IWNat.sol)). -
- -
- -```solidity -function withdrawFrom( - address _owner, - uint256 _amount -) external; -``` - -Burns `_amount` of `WNAT` tokens from `_owner`'s `WNAT` balance and -transfers the same amount of native tokens to `msg.sender`. -This operation is commonly known as "unwrapping". - -`msg.sender` must have been authorized to [`withdraw`](#fn_withdraw_2e1a7d4d) from `_owner`'s account -through ERC-20's approve mechanism. - -Reverts if `_amount` is higher than `_owners`'s `WNAT` balance or than -`msg.sender`'s allowance over `_owner`'s tokens. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address containing the tokens to withdraw. | -| `_amount` | `uint256` | The amount to withdraw. | - -
-
- -
- diff --git a/docs/apis/smart-contracts/Inflation.md b/docs/apis/smart-contracts/Inflation.md deleted file mode 100644 index c4d835a4e..000000000 --- a/docs/apis/smart-contracts/Inflation.md +++ /dev/null @@ -1,1218 +0,0 @@ ---- -title: Inflation -search: - boost: 0.5 ---- - - - -# `Inflation` { #ct_inflation } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol) | Inherits from [IInflationGenesis](./IInflationGenesis.md), [GovernedAndFlareDaemonized](./GovernedAndFlareDaemonized.md), [IFlareDaemonize](./IFlareDaemonize.md), [AddressUpdatable](./AddressUpdatable.md) -
- -
- -Recognizes, authorizes, mints, and funds native tokens to Flare services that are rewardable through inflation. - -See the [technical specification]( -https://gitlab.com/flarenetwork/flare-smart-contracts/-/blob/master/docs/specs/Inflation.md). - -
- -
- -## Events - -
- -### `GovernanceCallTimelocked` { #ev_governancecalltimelocked } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceCallTimelocked( - bytes4 selector, - uint256 allowedAfterTimestamp, - bytes encodedCall -) -``` - -Emitted when a new [`governance`](#fn_governance_5aa6e675) call has been recorded and is now waiting for the time lock to expire. - -
-
- -
- -### `GovernanceInitialised` { #ev_governanceinitialised } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceInitialised( - address initialGovernance -) -``` - -Emitted when the [`governance`](#fn_governance_5aa6e675) address is initialized. -This address will be used until production mode is entered (see [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered)). -At that point the [`governance`](#fn_governance_5aa6e675) address is taken from [`GovernanceSettings`](./GovernanceSettings.md). - -
-
- -
- -### `GovernedProductionModeEntered` { #ev_governedproductionmodeentered } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernedProductionModeEntered( - address governanceSettings -) -``` - -Emitted when [`governance`](#fn_governance_5aa6e675) is enabled and the [`governance`](#fn_governance_5aa6e675) address cannot be changed anymore -(only through a network fork). - -
-
- -
- -### `InflationAllocationSet` { #ev_inflationallocationset } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -event InflationAllocationSet( - contract IIInflationAllocation inflationAllocation -) -``` - -
-
- -
- -### `InflationAuthorized` { #ev_inflationauthorized } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -event InflationAuthorized( - uint256 amountWei -) -``` - -
-
- -
- -### `InflationRewardServiceDailyAuthorizedInflationComputed` { #ev_inflationrewardservicedailyauthorizedinflationcomputed } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -event InflationRewardServiceDailyAuthorizedInflationComputed( - contract IIInflationReceiver inflationReceiver, - uint256 amountWei -) -``` - -
-
- -
- -### `InflationRewardServiceTopupComputed` { #ev_inflationrewardservicetopupcomputed } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -event InflationRewardServiceTopupComputed( - contract IIInflationReceiver inflationReceiver, - uint256 amountWei -) -``` - -
-
- -
- -### `InflationRewardServiceTopupRequestReceived` { #ev_inflationrewardservicetopuprequestreceived } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -event InflationRewardServiceTopupRequestReceived( - contract IIInflationReceiver inflationReceiver, - uint256 amountWei -) -``` - -
-
- -
- -### `MintingReceived` { #ev_mintingreceived } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -event MintingReceived( - uint256 amountWei, - uint256 selfDestructAmountWei -) -``` - -
-
- -
- -### `NewTimeSlotInitialized` { #ev_newtimeslotinitialized } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -event NewTimeSlotInitialized( - uint256 startTimeStamp, - uint256 endTimeStamp, - uint256 inflatableSupplyWei, - uint256 recognizedInflationWei -) -``` - -
-
- -
- -### `SupplySet` { #ev_supplyset } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -event SupplySet( - contract IISupply oldSupply, - contract IISupply newSupply -) -``` - -
-
- -
- -### `TimelockedGovernanceCallCanceled` { #ev_timelockedgovernancecallcanceled } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallCanceled( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is canceled before execution. - -
-
- -
- -### `TimelockedGovernanceCallExecuted` { #ev_timelockedgovernancecallexecuted } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallExecuted( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is executed. - -
-
- -
- -### `TopupConfigurationSet` { #ev_topupconfigurationset } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -event TopupConfigurationSet( - struct TopupConfiguration topupConfiguration -) -``` - -
-
- -
- -### `TopupRequested` { #ev_topuprequested } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -event TopupRequested( - uint256 requestAmountWei, - uint256 reRequestAmountWei -) -``` - -
-
- -
- -
- -## Functions - -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -constructor( - address _governance, - contract FlareDaemon _flareDaemon, - address _addressUpdater, - uint256 _rewardEpochStartTs -) public; -``` - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `GovernedAndFlareDaemonized` ([Docs](./GovernedAndFlareDaemonized.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol)). -
- -
- -```solidity -constructor( - address _governance, - contract FlareDaemon _flareDaemon -) public; -``` - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Governed` ([Docs](./Governed.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/Governed.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Governance contract. Must not be zero. | - -
-
- -
- -### `daemonize` { #fn_daemonize_6d0e8c34 } - -
-Defined in `IFlareDaemonize` ([Docs](./IFlareDaemonize.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/interface/IFlareDaemonize.sol)). -
- -
- -```solidity -function daemonize( -) external returns ( - bool); -``` - -Implement this function to receive a trigger from the [`FlareDaemon`](./FlareDaemon.md). -The trigger method is called by the validator right at the end of block state transition. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | bool Whether the contract is still active after the call. Currently unused. | -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `getContractName` { #fn_getcontractname_f5f5ba72 } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function getContractName( -) external pure returns ( - string); -``` - -Implement this function to allow updating daemonized contracts through the [`AddressUpdater`](./AddressUpdater.md). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `string` | string Contract name. | -
-
- -
- -### `getCurrentTimeSlot` { #fn_getcurrenttimeslot_5f61a576 } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function getCurrentTimeSlot( -) external view returns ( - struct InflationTimeSlots.InflationTimeSlot); -``` - -Return the current time slot. - -Expect library to revert if there is no current time slot. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct InflationTimeSlots.InflationTimeSlot` | The inflation time slot state of the current time slot. | -
-
- -
- -### `getCurrentTimeSlotId` { #fn_getcurrenttimeslotid_7292d727 } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function getCurrentTimeSlotId( -) external view returns ( - uint256); -``` - -Return current time slot id. - -Expect library to revert if there is no current time slot. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Id of the current time slot. | -
-
- -
- -### `getNextExpectedTopupTs` { #fn_getnextexpectedtopupts_f639c12c } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function getNextExpectedTopupTs( -) external view returns ( - uint256 _nextTopupTs); -``` - -Returns next expected inflation topup time stamp which is also inflation authorization time. -The returned time from this API is actually the time of the block in which the topup is requested. -The Actual topup will take place in the next block. -Expected diff is up to a few seconds (max is less then a minute). - -
-
- -
- -### `getRewardServices` { #fn_getrewardservices_aa5b5eca } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function getRewardServices( -) external view returns ( - struct InflationRewardServices.RewardService[]); -``` - -Return the structure of reward services. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct InflationRewardServices.RewardService[]` | Reward services structure. | -
-
- -
- -### `getTimeSlot` { #fn_gettimeslot_2b85dcc9 } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function getTimeSlot( - uint256 _index -) external view returns ( - struct InflationTimeSlots.InflationTimeSlot); -``` - -Given an index, return the time slot at that index. - -Expect library to revert if index not found. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_index` | `uint256` | The index of the time slot to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `struct InflationTimeSlots.InflationTimeSlot` | The inflation time slot state. | -
-
- -
- -### `getTopupConfiguration` { #fn_gettopupconfiguration_4b13e872 } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function getTopupConfiguration( - contract IIInflationReceiver _inflationReceiver -) external view returns ( - struct TopupConfiguration _topupConfiguration); -``` - -Given an inflation receiver, get the topup configuration. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_inflationReceiver` | `contract IIInflationReceiver` | The reward service. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_topupConfiguration` | `struct TopupConfiguration` | The configuration of how the topup requests are calculated for a given reward service. | -
-
- -
- -### `getTotals` { #fn_gettotals_84e10a90 } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function getTotals( -) external view returns ( - uint256 _totalAuthorizedInflationWei, - uint256 _totalInflationTopupRequestedWei, - uint256 _totalInflationTopupDistributedWei, - uint256 _totalRecognizedInflationWei); -``` - -Get a tuple of totals across inflation time slots. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_totalAuthorizedInflationWei` | `uint256` | Total inflation authorized to be mintable | -| `_totalInflationTopupRequestedWei` | `uint256` | Total inflation requested to be topped up for rewarding | -| `_totalInflationTopupDistributedWei` | `uint256` | Total inflation received for funding reward services | -| `_totalRecognizedInflationWei` | `uint256` | Total inflation recognized for rewarding | -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `receiveMinting` { #fn_receiveminting_c611c2c5 } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function receiveMinting( -) external payable; -``` - -Receive newly minted native tokens from the [`FlareDaemon`](./FlareDaemon.md). - -Assume that the received amount will be >= last topup requested across all services. -If there is not enough balance sent to cover the topup request, expect the library method to revert. -Also assume that any received balance greater than the calculated topup request -came from self-destructor sending a balance to this contract. - -
-
- -
- -### `setInitialData` { #fn_setinitialdata_b6f1f749 } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function setInitialData( - contract IIInflationV1 _oldInflation, - uint256 _noOfAnnums -) external; -``` - -Used to copy data from old inflation contract. - -Only [`governance`](#fn_governance_5aa6e675) can call. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_oldInflation` | `contract IIInflationV1` | Address of old inflation. | -| `_noOfAnnums` | `uint256` | Number of annums in old inflation. | - -
-
- -
- -### `setPreInflationCalculation` { #fn_setpreinflationcalculation_095bfd5a } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function setPreInflationCalculation( - contract IIPreInflationCalculation _preInflationCalculation -) external; -``` - -Set contract that should be triggered before new inflation is calculated (it can be address(0)) - -Only [`governance`](#fn_governance_5aa6e675) can call. - -
-
- -
- -### `setTopupConfiguration` { #fn_settopupconfiguration_6e61ab96 } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function setTopupConfiguration( - contract IIInflationReceiver _inflationReceiver, - enum TopupType _topupType, - uint256 _topupFactorX100 -) external; -``` - -Set the topup configuration for a reward service. - -Only [`governance`](#fn_governance_5aa6e675) can call. - -Topup factor, if _topupType == FACTOROFDAILYAUTHORIZED, must be greater than 100. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_inflationReceiver` | `contract IIInflationReceiver` | The reward service to receive the inflation funds for distribution. | -| `_topupType` | `enum TopupType` | The type to signal how the topup amounts are to be calculated. FACTOROFDAILYAUTHORIZED = Use a factor of last daily authorized to set a target balance for a reward service to maintain as a reserve for claiming. ALLAUTHORIZED = Mint enough native tokens to topup reward service contract to hold all authorized but unrequested rewards. | -| `_topupFactorX100` | `uint256` | If _topupType == FACTOROFDAILYAUTHORIZED, then this factor (times 100) is multiplied by last daily authorized inflation to obtain the maximum balance that a reward service can hold at any given time. If it holds less, then this max amount is used to compute the mint request topup required to bring the reward service contract native token balance up to that amount. | - -
-
- -
- -### `switchToFallbackMode` { #fn_switchtofallbackmode_e22fdece } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -function switchToFallbackMode( -) external view returns ( - bool); -``` - -This function will be called after an error is caught in [`daemonize`](#fn_daemonize_6d0e8c34). -It will switch the contract to a simpler fallback mode, which hopefully works when full mode doesn't. -Not every contract needs to support fallback mode ([`FtsoManager`](./FtsoManager.md) does), so this method may be empty. -Switching back to normal mode is left to the contract (typically a governed method call). -This function may be called due to low-gas error, so it shouldn't use more than ~30.000 gas. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | True if switched to fallback mode, false if already in fallback mode or if fallback mode is not supported. | -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -
- -## Modifiers - -
- -### `notZero` { #md_notzero } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity -modifier notZero( address _address) -``` - -
-
- -
- -### `onlyAddressUpdater` { #md_onlyaddressupdater } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -modifier onlyAddressUpdater() -``` - -Only the `AdressUpdater` contract can call this method. -Its address is set at construction time but it can also update itself. - -
-
- -
- -### `onlyFlareDaemon` { #md_onlyflaredaemon } - -
-Defined in `GovernedAndFlareDaemonized` ([Docs](./GovernedAndFlareDaemonized.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol)). -
- -
- -```solidity -modifier onlyFlareDaemon() -``` - -Only the [`flareDaemon`](#va_flaredaemon) can call this method. - -
-
- -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -
- -## Variables - -
- -### `flareDaemon` { #va_flaredaemon } - -
-Defined in `GovernedAndFlareDaemonized` ([Docs](./GovernedAndFlareDaemonized.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol)). -
- -
- -```solidity - contract FlareDaemon flareDaemon -``` - -The [`FlareDaemon`](./FlareDaemon.md) contract, set at construction time. - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `inflationAllocation` { #va_inflationallocation } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity - contract IIInflationAllocation inflationAllocation -``` - -
-
- -
- -### `lastAuthorizationTs` { #va_lastauthorizationts } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity - uint256 lastAuthorizationTs -``` - -The last time inflation was authorized. - -
-
- -
- -### `preInflationCalculation` { #va_preinflationcalculation } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity - contract IIPreInflationCalculation preInflationCalculation -``` - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `rewardEpochStartTs` { #va_rewardepochstartts } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity - uint256 rewardEpochStartTs -``` - -Do not start inflation time slots before this, in seconds after UNIX epoch. - -
-
- -
- -### `rewardEpochStartedTs` { #va_rewardepochstartedts } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity - uint256 rewardEpochStartedTs -``` - -When the first reward epoch was started, in seconds after UNIX epoch. - -
-
- -
- -### `supply` { #va_supply } - -
-Defined in `Inflation` ([Docs](./Inflation.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/inflation/implementation/Inflation.sol)). -
- -
- -```solidity - contract IISupply supply -``` - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- diff --git a/docs/apis/smart-contracts/PChainStake.md b/docs/apis/smart-contracts/PChainStake.md deleted file mode 100644 index dbe0411a2..000000000 --- a/docs/apis/smart-contracts/PChainStake.md +++ /dev/null @@ -1,576 +0,0 @@ ---- -title: PChainStake -search: - boost: 0.5 ---- - - - -# `PChainStake` { #ct_pchainstake } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol) | Inherits from [IPChainVotePower](./IPChainVotePower.md), [CheckPointable](./CheckPointable.md) -
- -
- -Helper contract handling all the vote power and balance functionality for the [`PChainStakeMirror`](./PChainStakeMirror.md). - -
- -
- -## Functions - -
- -### `balanceHistoryCleanup` { #fn_balancehistorycleanup_f0e292c9 } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function balanceHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete balance checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | balance owner account address | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `batchVotePowerOfAt` { #fn_batchvotepowerofat_a9e70199 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function batchVotePowerOfAt( - bytes20[] _owners, - uint256 _blockNumber -) external view returns ( - uint256[] _votePowers); -``` - -Return vote powers for several node ids in a batch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owners` | `bytes20[]` | | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_votePowers` | `uint256[]` | A list of vote powers. | -
-
- -
- -### `stakesHistoryCleanup` { #fn_stakeshistorycleanup_c13edf70 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function stakesHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete stakes checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Balance owner account address. | -| `_count` | `uint256` | Maximum number of checkpoints to delete. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of deleted checkpoints. | -
-
- -
- -### `stakesOf` { #fn_stakesof_33b69c4c } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function stakesOf( - address _owner -) external view returns ( - bytes20[] _nodeIds, - uint256[] _amounts); -``` - -Get the amounts and node ids being staked to by a vote power owner. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_nodeIds` | `bytes20[]` | Array of node ids. | -| `_amounts` | `uint256[]` | Array of staked amounts, for each node id. | -
-
- -
- -### `stakesOfAt` { #fn_stakesofat_4be91f32 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function stakesOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - bytes20[] _nodeIds, - uint256[] _amounts); -``` - -Get the amounts and node ids being staked to by a vote power owner, -at a given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_nodeIds` | `bytes20[]` | Array of node ids. | -| `_amounts` | `uint256[]` | Array of staked amounts, for each node id. | -
-
- -
- -### `totalSupplyCacheCleanup` { #fn_totalsupplycachecleanup_43ea370b } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function totalSupplyCacheCleanup( - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete total supply cache entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | the block number for which total supply value was cached | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of cache entries deleted (always 0 or 1) | -
-
- -
- -### `totalSupplyHistoryCleanup` { #fn_totalsupplyhistorycleanup_f62f8f3a } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function totalSupplyHistoryCleanup( - uint256 _count -) external returns ( - uint256); -``` - -Delete total supply checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `totalVotePower` { #fn_totalvotepower_f5f3d4f7 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function totalVotePower( -) external view returns ( - uint256); -``` - -Get the current total vote power. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current total vote power (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAt` { #fn_totalvotepowerat_3e5aa26a } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function totalVotePowerAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the block (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAtCached` { #fn_totalvotepoweratcached_caeb942b } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function totalVotePowerAtCached( - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` using cache. - It tries to read the cached value and if not found, reads the actual value and stores it in cache. - Can only be used if `_blockNumber` is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the block (sum of all accounts' vote powers). | -
-
- -
- -### `votePowerCacheCleanup` { #fn_votepowercachecleanup_a2e96264 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerCacheCleanup( - bytes20 _nodeId, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete vote power cache entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | vote power node id | -| `_blockNumber` | `uint256` | the block number for which total supply value was cached | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of cache entries deleted (always 0 or 1) | -
-
- -
- -### `votePowerFromTo` { #fn_votepowerfromto_59c345f5 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerFromTo( - address _owner, - bytes20 _nodeId -) external view returns ( - uint256 _votePower); -``` - -Get current staked vote power from `_owner` staked to `_nodeId`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Address of vote power owner. | -| `_nodeId` | `bytes20` | Node id. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_votePower` | `uint256` | The staked vote power. | -
-
- -
- -### `votePowerFromToAt` { #fn_votepowerfromtoat_1f7ff2c7 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerFromToAt( - address _owner, - bytes20 _nodeId, - uint256 _blockNumber -) external view returns ( - uint256 _votePower); -``` - -Get current staked vote power from `_owner` staked to `_nodeId` at `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Address of vote power owner. | -| `_nodeId` | `bytes20` | Node id. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_votePower` | `uint256` | The staked vote power. | -
-
- -
- -### `votePowerHistoryCleanup` { #fn_votepowerhistorycleanup_119b923a } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerHistoryCleanup( - bytes20 _nodeId, - uint256 _count -) external returns ( - uint256); -``` - -Delete vote power checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | vote power node id | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `votePowerOf` { #fn_votepowerof_b4eb2a81 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerOf( - bytes20 _nodeId -) external view returns ( - uint256); -``` - -Get the current vote power of `_nodeId`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | The node id to get voting power. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Current vote power of `_nodeId`. | -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_46431374 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerOfAt( - bytes20 _nodeId, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_nodeId` at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | The node id to get voting power. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_nodeId` at `_blockNumber`. | -
-
- -
- -### `votePowerOfAtCached` { #fn_votepowerofatcached_bd61ffee } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerOfAtCached( - bytes20 _nodeId, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` using cache. - It tries to read the cached value and if not found, reads the actual value and stores it in cache. - Can only be used if _blockNumber is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at `_blockNumber`. | -
-
- -
- -
- -## Variables - -
- -### `cleanerContract` { #va_cleanercontract } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity - address cleanerContract -``` - -Address of the contract that is allowed to call methods for history cleaning. - -
-
- -
- diff --git a/docs/apis/smart-contracts/PChainStakeMirror.md b/docs/apis/smart-contracts/PChainStakeMirror.md deleted file mode 100644 index 8f12271aa..000000000 --- a/docs/apis/smart-contracts/PChainStakeMirror.md +++ /dev/null @@ -1,1652 +0,0 @@ ---- -title: PChainStakeMirror -search: - boost: 0.5 ---- - - - -# `PChainStakeMirror` { #ct_pchainstakemirror } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol) | Inherits from [IPChainStakeMirror](./IPChainStakeMirror.md), [PChainStake](./PChainStake.md), [GovernedAndFlareDaemonized](./GovernedAndFlareDaemonized.md), [IFlareDaemonize](./IFlareDaemonize.md), [IICleanable](./IICleanable.md), [AddressUpdatable](./AddressUpdatable.md) -
- -
- -Contract used to mirror all stake amounts from P-chain. - -
- -
- -## Functions - -
- -### `activate` { #fn_activate_0f15f4c0 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function activate( -) external; -``` - -Activates [`PChainStakeMirror`](./PChainStakeMirror.md) contract - enable mirroring. - -Only [`governance`](#fn_governance_5aa6e675) can call this. - -
-
- -
- -### `balanceHistoryCleanup` { #fn_balancehistorycleanup_f0e292c9 } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function balanceHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete balance checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | balance owner account address | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `balanceOf` { #fn_balanceof_70a08231 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function balanceOf( - address _owner -) public view returns ( - uint256); -``` - -Queries the token balance of `_owner` at current block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address from which the balance will be retrieved. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current balance. | -
-
- -
- -### `balanceOfAt` { #fn_balanceofat_4ee2cd7e } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function balanceOfAt( - address _owner, - uint256 _blockNumber -) public view returns ( - uint256); -``` - -Queries the token balance of `_owner` at a specific `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address from which the balance will be retrieved. | -| `_blockNumber` | `uint256` | The block number when the balance is queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The balance at `_blockNumber`. | -
-
- -
- -### `batchVotePowerOfAt` { #fn_batchvotepowerofat_a9e70199 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function batchVotePowerOfAt( - bytes20[] _owners, - uint256 _blockNumber -) external view returns ( - uint256[] _votePowers); -``` - -Return vote powers for several node ids in a batch. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owners` | `bytes20[]` | | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_votePowers` | `uint256[]` | A list of vote powers. | -
-
- -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `cleanupBlockNumber` { #fn_cleanupblocknumber_deea13e7 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function cleanupBlockNumber( -) external view returns ( - uint256); -``` - -Get the current cleanup block number set with [`setCleanupBlockNumber`](#fn_setcleanupblocknumber_13de97f5). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The currently set cleanup block number. | -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -constructor( - address _governance, - contract FlareDaemon _flareDaemon, - address _addressUpdater, - uint256 _maxUpdatesPerBlock -) public; -``` - -Initializes the contract with default parameters - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Address identifying the governance address | -| `_flareDaemon` | `contract FlareDaemon` | Address identifying the flare daemon contract | -| `_addressUpdater` | `address` | Address identifying the address updater contract | -| `_maxUpdatesPerBlock` | `uint256` | Max number of updates (stake ends) per block | - -
-
- -
- -### `daemonize` { #fn_daemonize_6d0e8c34 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function daemonize( -) external returns ( - bool); -``` - -Implement this function to receive a trigger from the [`FlareDaemon`](./FlareDaemon.md). -The trigger method is called by the validator right at the end of block state transition. - -Only flare daemon can call this. -Reduce balances and vote powers for stakes that just ended. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | bool Whether the contract is still active after the call. Currently unused. | -
-
- -
- -### `deactivate` { #fn_deactivate_51b42b00 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function deactivate( -) external; -``` - -Deactivates [`PChainStakeMirror`](./PChainStakeMirror.md) contract - disable mirroring. - -Only [`governance`](#fn_governance_5aa6e675) can call this. - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `getContractName` { #fn_getcontractname_f5f5ba72 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function getContractName( -) external pure returns ( - string); -``` - -Implement this function to allow updating daemonized contracts through the [`AddressUpdater`](./AddressUpdater.md). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `string` | string Contract name. | -
-
- -
- -### `getTransactionHashList` { #fn_gettransactionhashlist_d9bb0a87 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function getTransactionHashList( - uint256 _endTime -) external view returns ( - bytes32[]); -``` - -Returns the list of transaction hashes of stakes that end at given `_endTime`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_endTime` | `uint256` | Time when stakes end, in seconds from UNIX epoch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bytes32[]` | List of transaction hashes - `keccak256(abi.encode(txId, inputAddress))`. | -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `isActiveStakeMirrored` { #fn_isactivestakemirrored_d9ab4dfe } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function isActiveStakeMirrored( - bytes32 _txId, - bytes20 _inputAddress -) external view returns ( - bool); -``` - -Method for checking if [`active`](#va_active) stake (stake start time <= block.timestamp < stake end time) was already mirrored. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_txId` | `bytes32` | P-chain stake transaction id. | -| `_inputAddress` | `bytes20` | P-chain address that opened stake. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | True if stake is active and mirrored. | -
-
- -
- -### `mirrorStake` { #fn_mirrorstake_2e335805 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function mirrorStake( - struct IPChainStakeMirrorVerifier.PChainStake _stakeData, - bytes32[] _merkleProof -) external; -``` - -Method for P-chain stake mirroring using [`PChainStake`](./PChainStake.md) data and Merkle proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_stakeData` | `struct IPChainStakeMirrorVerifier.PChainStake` | Information about P-chain stake. | -| `_merkleProof` | `bytes32[]` | Merkle proof that should be used to prove the P-chain stake. | - -
-
- -
- -### `revokeStake` { #fn_revokestake_a7d99caf } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function revokeStake( - bytes32 _txId, - bytes20 _inputAddress, - uint256 _endTime, - uint256 _endTimeTxHashIndex -) external; -``` - -Revokes stake in case of invalid stakes - voting should be reset first, -so that Merkle root is not valid and it cannot be used for mirroring again. - -Only [`governance`](#fn_governance_5aa6e675) can call this. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_txId` | `bytes32` | P-chain stake transaction id. | -| `_inputAddress` | `bytes20` | P-chain address that opened stake. | -| `_endTime` | `uint256` | Time when stake ends, in seconds from UNIX epoch. | -| `_endTimeTxHashIndex` | `uint256` | Index of `txHash = keccak256(abi.encode(_txId, _inputAddress))` in the `endTimeToTransactionHashList[_endTime]` list. | - -
-
- -
- -### `setCleanerContract` { #fn_setcleanercontract_f6a494af } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function setCleanerContract( - address _cleanerContract -) external; -``` - -Set the contract that is allowed to call history cleaning methods. - -Only [`governance`](#fn_governance_5aa6e675) can call this. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanerContract` | `address` | Address of the cleanup contract. Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). | - -
-
- -
- -### `setCleanupBlockNumber` { #fn_setcleanupblocknumber_13de97f5 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function setCleanupBlockNumber( - uint256 _blockNumber -) external; -``` - -Set the cleanup block number. -Historic data for the blocks before [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7) can be erased. -History before that block should never be used since it can be inconsistent. -In particular, cleanup block number must be lower than the current vote power block. - -The method can be called only by [`cleanupBlockNumberManager`](#va_cleanupblocknumbermanager). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The new cleanup block number. | - -
-
- -
- -### `setMaxUpdatesPerBlock` { #fn_setmaxupdatesperblock_4dd4ce49 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function setMaxUpdatesPerBlock( - uint256 _maxUpdatesPerBlock -) external; -``` - -Sets max number of updates (stake ends) per block (a [`daemonize`](#fn_daemonize_6d0e8c34) call). - -Only [`governance`](#fn_governance_5aa6e675) can call this. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_maxUpdatesPerBlock` | `uint256` | Max number of updates (stake ends) per block | - -
-
- -
- -### `stakesHistoryCleanup` { #fn_stakeshistorycleanup_c13edf70 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function stakesHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete stakes checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Balance owner account address. | -| `_count` | `uint256` | Maximum number of checkpoints to delete. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of deleted checkpoints. | -
-
- -
- -### `stakesOf` { #fn_stakesof_33b69c4c } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function stakesOf( - address _owner -) external view returns ( - bytes20[] _nodeIds, - uint256[] _amounts); -``` - -Get the amounts and node ids being staked to by a vote power owner. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_nodeIds` | `bytes20[]` | Array of node ids. | -| `_amounts` | `uint256[]` | Array of staked amounts, for each node id. | -
-
- -
- -### `stakesOfAt` { #fn_stakesofat_4be91f32 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function stakesOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - bytes20[] _nodeIds, - uint256[] _amounts); -``` - -Get the amounts and node ids being staked to by a vote power owner, -at a given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_nodeIds` | `bytes20[]` | Array of node ids. | -| `_amounts` | `uint256[]` | Array of staked amounts, for each node id. | -
-
- -
- -### `switchToFallbackMode` { #fn_switchtofallbackmode_e22fdece } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function switchToFallbackMode( -) external returns ( - bool); -``` - -This function will be called after an error is caught in [`daemonize`](#fn_daemonize_6d0e8c34). -It will switch the contract to a simpler fallback mode, which hopefully works when full mode doesn't. -Not every contract needs to support fallback mode ([`FtsoManager`](./FtsoManager.md) does), so this method may be empty. -Switching back to normal mode is left to the contract (typically a governed method call). -This function may be called due to low-gas error, so it shouldn't use more than ~30.000 gas. - -Only flare daemon can call this. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `bool` | True if switched to fallback mode, false if already in fallback mode or if fallback mode is not supported. | -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `totalSupply` { #fn_totalsupply_18160ddd } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function totalSupply( -) public view returns ( - uint256); -``` - -Total amount of tokens at current block. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current total amount of tokens. | -
-
- -
- -### `totalSupplyAt` { #fn_totalsupplyat_981b24d0 } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -function totalSupplyAt( - uint256 _blockNumber -) public view returns ( - uint256); -``` - -Total amount of tokens at a specific `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number when the totalSupply is queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total amount of tokens at `_blockNumber`. | -
-
- -
- -### `totalSupplyCacheCleanup` { #fn_totalsupplycachecleanup_43ea370b } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function totalSupplyCacheCleanup( - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete total supply cache entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | the block number for which total supply value was cached | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of cache entries deleted (always 0 or 1) | -
-
- -
- -### `totalSupplyHistoryCleanup` { #fn_totalsupplyhistorycleanup_f62f8f3a } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function totalSupplyHistoryCleanup( - uint256 _count -) external returns ( - uint256); -``` - -Delete total supply checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `totalVotePower` { #fn_totalvotepower_f5f3d4f7 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function totalVotePower( -) external view returns ( - uint256); -``` - -Get the current total vote power. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current total vote power (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAt` { #fn_totalvotepowerat_3e5aa26a } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function totalVotePowerAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the block (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAtCached` { #fn_totalvotepoweratcached_caeb942b } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function totalVotePowerAtCached( - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` using cache. - It tries to read the cached value and if not found, reads the actual value and stores it in cache. - Can only be used if `_blockNumber` is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the block (sum of all accounts' vote powers). | -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -### `votePowerCacheCleanup` { #fn_votepowercachecleanup_a2e96264 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerCacheCleanup( - bytes20 _nodeId, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete vote power cache entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | vote power node id | -| `_blockNumber` | `uint256` | the block number for which total supply value was cached | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of cache entries deleted (always 0 or 1) | -
-
- -
- -### `votePowerFromTo` { #fn_votepowerfromto_59c345f5 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerFromTo( - address _owner, - bytes20 _nodeId -) external view returns ( - uint256 _votePower); -``` - -Get current staked vote power from `_owner` staked to `_nodeId`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Address of vote power owner. | -| `_nodeId` | `bytes20` | Node id. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_votePower` | `uint256` | The staked vote power. | -
-
- -
- -### `votePowerFromToAt` { #fn_votepowerfromtoat_1f7ff2c7 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerFromToAt( - address _owner, - bytes20 _nodeId, - uint256 _blockNumber -) external view returns ( - uint256 _votePower); -``` - -Get current staked vote power from `_owner` staked to `_nodeId` at `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Address of vote power owner. | -| `_nodeId` | `bytes20` | Node id. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_votePower` | `uint256` | The staked vote power. | -
-
- -
- -### `votePowerHistoryCleanup` { #fn_votepowerhistorycleanup_119b923a } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerHistoryCleanup( - bytes20 _nodeId, - uint256 _count -) external returns ( - uint256); -``` - -Delete vote power checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | vote power node id | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `votePowerOf` { #fn_votepowerof_b4eb2a81 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerOf( - bytes20 _nodeId -) external view returns ( - uint256); -``` - -Get the current vote power of `_nodeId`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | The node id to get voting power. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Current vote power of `_nodeId`. | -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_46431374 } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerOfAt( - bytes20 _nodeId, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_nodeId` at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | The node id to get voting power. | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_nodeId` at `_blockNumber`. | -
-
- -
- -### `votePowerOfAtCached` { #fn_votepowerofatcached_bd61ffee } - -
-Defined in `PChainStake` ([Docs](./PChainStake.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStake.sol)). -
- -
- -```solidity -function votePowerOfAtCached( - bytes20 _nodeId, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` using cache. - It tries to read the cached value and if not found, reads the actual value and stores it in cache. - Can only be used if _blockNumber is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_nodeId` | `bytes20` | | -| `_blockNumber` | `uint256` | The block number at which to fetch. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at `_blockNumber`. | -
-
- -
- -
- -## Modifiers - -
- -### `notBeforeCleanupBlock` { #md_notbeforecleanupblock } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -modifier notBeforeCleanupBlock( uint256 _blockNumber) -``` - -This method cannot be called for `_blockNumber` lower than the current cleanup block number. - -
-
- -
- -### `onlyAddressUpdater` { #md_onlyaddressupdater } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -modifier onlyAddressUpdater() -``` - -Only the `AdressUpdater` contract can call this method. -Its address is set at construction time but it can also update itself. - -
-
- -
- -### `onlyCleaner` { #md_onlycleaner } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -modifier onlyCleaner() -``` - -Only the [`cleanerContract`](#va_cleanercontract) can call this method. - -
-
- -
- -### `onlyFlareDaemon` { #md_onlyflaredaemon } - -
-Defined in `GovernedAndFlareDaemonized` ([Docs](./GovernedAndFlareDaemonized.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol)). -
- -
- -```solidity -modifier onlyFlareDaemon() -``` - -Only the [`flareDaemon`](#va_flaredaemon) can call this method. - -
-
- -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -### `whenActive` { #md_whenactive } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity -modifier whenActive() -``` - -This method can only be called when the [`PChainStakeMirror`](./PChainStakeMirror.md) is [`active`](#va_active). - -
-
- -
- -
- -## Structures - -
- -### `PChainStakingData` { #st_pchainstakingdata } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -
-```solidity -struct PChainStakingData { - address owner; - bytes20 nodeId; - uint64 weightGwei; -} -``` - -
- -
- -### `TimelockedCall` { #st_timelockedcall } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -
-```solidity -struct TimelockedCall { - uint256 allowedAfterTimestamp; - bytes encodedCall; -} -``` - -
- -
- -
- -## Variables - -
- -### `active` { #va_active } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity - bool active -``` - -Indicates if stakes can be mirrored. - -
-
- -
- -### `addressBinder` { #va_addressbinder } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity - contract IAddressBinder addressBinder -``` - -The contract used for converting P-chain address to C-chain address - both derived from the same public key. - -
-
- -
- -### `cleanerContract` { #va_cleanercontract } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity - address cleanerContract -``` - -Address of the contract that is allowed to call methods for history cleaning. - -
-
- -
- -### `cleanupBlockNumberManager` { #va_cleanupblocknumbermanager } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity - address cleanupBlockNumberManager -``` - -The contract that is allowed to set [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7). -Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). - -
-
- -
- -### `endTimeToTransactionHashList` { #va_endtimetotransactionhashlist } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity - mapping(uint256 => bytes32[]) endTimeToTransactionHashList -``` - -Mapping from stake end time to the list of tx hashes - `keccak256(abi.encode(txId, inputAddress))` - -
-
- -
- -### `flareDaemon` { #va_flaredaemon } - -
-Defined in `GovernedAndFlareDaemonized` ([Docs](./GovernedAndFlareDaemonized.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/GovernedAndFlareDaemonized.sol)). -
- -
- -```solidity - contract FlareDaemon flareDaemon -``` - -The [`FlareDaemon`](./FlareDaemon.md) contract, set at construction time. - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `governanceVotePower` { #va_governancevotepower } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity - contract IIGovernanceVotePower governanceVotePower -``` - -The contract to use for [`governance`](#fn_governance_5aa6e675) vote power and delegation. -Here only to properly update [`governance`](#fn_governance_5aa6e675) VP at stake start/end, -all actual operations go directly to [`governance`](#fn_governance_5aa6e675) VP contract. - -
-
- -
- -### `maxUpdatesPerBlock` { #va_maxupdatesperblock } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity - uint256 maxUpdatesPerBlock -``` - -Max number of stake ends that Flare daemon updates per block. - -
-
- -
- -### `nextTimestampToTrigger` { #va_nexttimestamptotrigger } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity - uint256 nextTimestampToTrigger -``` - -Indicates timestamp of stake ends that Flare daemon will trigger next. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- -### `transactionHashToPChainStakingData` { #va_transactionhashtopchainstakingdata } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity - mapping(bytes32 => struct PChainStakeMirror.PChainStakingData) transactionHashToPChainStakingData -``` - -Return staking data for given tx hash - `keccak256(abi.encode(txId, inputAddress))` - -
-
- -
- -### `verifier` { #va_verifier } - -
-Defined in `PChainStakeMirror` ([Docs](./PChainStakeMirror.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/staking/implementation/PChainStakeMirror.sol)). -
- -
- -```solidity - contract IIPChainStakeMirrorVerifier verifier -``` - -The contract used for P-chain stake verifications. - -
-
- -
- diff --git a/docs/apis/smart-contracts/PaymentVerification.md b/docs/apis/smart-contracts/PaymentVerification.md deleted file mode 100644 index d1614cf7f..000000000 --- a/docs/apis/smart-contracts/PaymentVerification.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: PaymentVerification -search: - boost: 0.5 ---- - - - -# `PaymentVerification` { #ct_paymentverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/PaymentVerification.sol) | Inherits from [IPaymentVerification](./IPaymentVerification.md) -
- -
- -Contract for verifying [`Payment`](../attestation-types/Payment.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This contract can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `PaymentVerification` ([Docs](./PaymentVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/PaymentVerification.sol)). -
- -
- -```solidity -constructor( - contract IMerkleRootStorage _merkleRootStorage -) public; -``` - -
-
- -
- -### `verifyPayment` { #fn_verifypayment_8cc386ce } - -
-Defined in `PaymentVerification` ([Docs](./PaymentVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/PaymentVerification.sol)). -
- -
- -```solidity -function verifyPayment( - struct Payment.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`Payment`](../attestation-types/Payment.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct Payment.Proof` | The [`Payment`](../attestation-types/Payment.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- -
- -## Variables - -
- -### `merkleRootStorage` { #va_merklerootstorage } - -
-Defined in `PaymentVerification` ([Docs](./PaymentVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/PaymentVerification.sol)). -
- -
- -```solidity - contract IMerkleRootStorage merkleRootStorage -``` - -
-
- -
- diff --git a/docs/apis/smart-contracts/PriceSubmitter.md b/docs/apis/smart-contracts/PriceSubmitter.md deleted file mode 100644 index baae4a88a..000000000 --- a/docs/apis/smart-contracts/PriceSubmitter.md +++ /dev/null @@ -1,768 +0,0 @@ ---- -title: PriceSubmitter -search: - boost: 0.5 ---- - - - -# `PriceSubmitter` { #ct_pricesubmitter } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol) | Inherits from [IIPriceSubmitter](./IIPriceSubmitter.md), [GovernedAtGenesis](./GovernedAtGenesis.md), [AddressUpdatable](./AddressUpdatable.md) -
- -
- -Receives prices from [FTSO data providers](https://docs.flare.network/tech/ftso). - -It then forwards the submissions to the appropriate FTSO contract, -allowing data providers to perform all required operations in a single transaction -per price epoch. - -
- -
- -## Functions - -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -constructor( -) public; -``` - -This [`constructor`](#fn_constructor_undefined) should contain no code as this contract is pre-loaded into the genesis block. - The super constructors are called for testing convenience. - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `getCurrentRandom` { #fn_getcurrentrandom_d89601fd } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function getCurrentRandom( -) external view returns ( - uint256); -``` - -Returns the random number for the previous epoch, obtained from the random numbers -provided by all data providers along with their data submissions. -Note that the random number for the previous epoch keeps updating as new submissions are revealed. - -It never reverts. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Random number calculated from all data provider's submissions. | -
-
- -
- -### `getFtsoManager` { #fn_getftsomanager_b39c6858 } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function getFtsoManager( -) external view returns ( - contract IFtsoManagerGenesis); -``` - -Returns the address of the [`FtsoManager`](./FtsoManager.md) contract. - -
-
- -
- -### `getFtsoRegistry` { #fn_getftsoregistry_8c9d28b6 } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function getFtsoRegistry( -) external view returns ( - contract IFtsoRegistryGenesis); -``` - -Returns the address of the [`FtsoRegistry`](./FtsoRegistry.md) contract. - -
-
- -
- -### `getRandom` { #fn_getrandom_cd4b6914 } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function getRandom( - uint256 _epochId -) external view returns ( - uint256); -``` - -Returns the random number used in a specific past epoch, obtained from the random numbers -provided by all data providers along with their data submissions. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the queried epoch. Current epoch cannot be queried, and the previous epoch is constantly updated as data providers reveal their prices and random numbers. Note that only the last 50 epochs can be queried and there is no bounds checking for this parameter. Out-of-bounds queries return undefined values. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The random number used in that epoch. | -
-
- -
- -### `getTrustedAddresses` { #fn_gettrustedaddresses_ffacb84e } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function getTrustedAddresses( -) external view returns ( - address[]); -``` - -Returns the list of trusted addresses that are always allowed to submit and reveal. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | address[] Array of trusted voter addresses. | -
-
- -
- -### `getVoterWhitelister` { #fn_getvoterwhitelister_71e1fad9 } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function getVoterWhitelister( -) external view returns ( - address); -``` - -Returns the address of the [`VoterWhitelister`](./VoterWhitelister.md) contract managing the data provider whitelist. - -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `initialise` { #fn_initialise_9d6a890f } - -
-Defined in `GovernedAtGenesis` ([Docs](./GovernedAtGenesis.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedAtGenesis.sol)). -
- -
- -```solidity -function initialise( - address _governance -) public pure; -``` - -Disallow [`initialise`](#fn_initialise_9d6a890f) to be called. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | The governance address for initial claiming. | - -
-
- -
- -### `revealPrices` { #fn_revealprices_e2db5a52 } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function revealPrices( - uint256 _epochId, - uint256[] _ftsoIndices, - uint256[] _prices, - uint256 _random -) external; -``` - -Reveals submitted prices during the epoch reveal period. -The hash of FTSO indices, prices, random number, and voter address must be equal -to the hash previously submitted with [`submitHash`](#fn_submithash_8fc6f667). -Emits a [`PricesRevealed`](#ev_pricesrevealed) event. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the epoch to which the price hashes are submitted. | -| `_ftsoIndices` | `uint256[]` | List of FTSO indices in ascending order. | -| `_prices` | `uint256[]` | List of submitted prices in USD. | -| `_random` | `uint256` | Submitted random number. | - -
-
- -
- -### `setAddressUpdater` { #fn_setaddressupdater_aea36b53 } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function setAddressUpdater( - address _addressUpdater -) external; -``` - -Sets the address updater contract. -Only [`governance`](#fn_governance_5aa6e675) cal call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_addressUpdater` | `address` | Address of the [`AddressUpdater`](./AddressUpdater.md) contract. | - -
-
- -
- -### `setTrustedAddresses` { #fn_settrustedaddresses_9ec2b581 } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function setTrustedAddresses( - address[] _trustedAddresses -) external; -``` - -Set the trusted addresses that are always allowed to submit and reveal. -Trusted addresses are used, for example, in fallback mode. -Only FTSO Manager can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_trustedAddresses` | `address[]` | Array of FTSO data provider addresses (voters). The previous list of trusted addresses is discarded. | - -
-
- -
- -### `submitHash` { #fn_submithash_8fc6f667 } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function submitHash( - uint256 _epochId, - bytes32 _hash -) external; -``` - -Submits a hash for the current epoch. Can only be called by FTSO data providers -whitelisted through the `VoterWhitelisted` contract. -Emits the [`HashSubmitted`](#ev_hashsubmitted) event. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_epochId` | `uint256` | ID of the target epoch to which the hash is submitted. | -| `_hash` | `bytes32` | A hash of the FTSO indices, prices, random number, and voter address. | - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -### `voterWhitelistBitmap` { #fn_voterwhitelistbitmap_7ac420ad } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function voterWhitelistBitmap( - address _voter -) external view returns ( - uint256); -``` - -Returns a bitmap of all FTSOs for which a data provider is allowed to submit prices or hashes. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the voter. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | If a data provider is allowed to vote for a given FTSO index, the corresponding bit in the result is 1. | -
-
- -
- -### `voterWhitelisted` { #fn_voterwhitelisted_9d986f91 } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function voterWhitelisted( - address _voter, - uint256 _ftsoIndex -) external; -``` - -Called from the [`VoterWhitelister`](./VoterWhitelister.md) contract when a new voter has been whitelisted. - -Only the [`VoterWhitelister`](./VoterWhitelister.md) contract can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Voter address that has been added to the whitelist. | -| `_ftsoIndex` | `uint256` | Index of the FTSO to which the voter has registered. Each FTSO has its own whitelist. | - -
-
- -
- -### `votersRemovedFromWhitelist` { #fn_votersremovedfromwhitelist_76794efb } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -function votersRemovedFromWhitelist( - address[] _removedVoters, - uint256 _ftsoIndex -) external; -``` - -Called from the [`VoterWhitelister`](./VoterWhitelister.md) contract when one or more voters have been removed. - -Only the [`VoterWhitelister`](./VoterWhitelister.md) contract can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_removedVoters` | `address[]` | | -| `_ftsoIndex` | `uint256` | Index of the FTSO to which the voters were registered. Each FTSO has its own whitelist. | - -
-
- -
- -
- -## Modifiers - -
- -### `onlyAddressUpdater` { #md_onlyaddressupdater } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -modifier onlyAddressUpdater() -``` - -Only the `AdressUpdater` contract can call this method. -Its address is set at construction time but it can also update itself. - -
-
- -
- -### `onlyFtsoManager` { #md_onlyftsomanager } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -modifier onlyFtsoManager() -``` - -Only the `ftsoManager` can call this method. - -
-
- -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -### `onlyWhitelister` { #md_onlywhitelister } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity -modifier onlyWhitelister() -``` - -Only the `voterWhitelister` can call this method. - -
-
- -
- -
- -## Variables - -
- -### `MINIMAL_RANDOM` { #va_minimal_random } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity - uint256 MINIMAL_RANDOM -``` - -Minimal random value accepted along price submissions. -Submitted random values below this threshold will revert. - -
-
- -
- -### `RANDOM_EPOCH_CYCLIC_BUFFER_SIZE` { #va_random_epoch_cyclic_buffer_size } - -
-Defined in `PriceSubmitter` ([Docs](./PriceSubmitter.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/genesis/implementation/PriceSubmitter.sol)). -
- -
- -```solidity - uint256 RANDOM_EPOCH_CYCLIC_BUFFER_SIZE -``` - -Number of past random numbers remembered. - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- diff --git a/docs/apis/smart-contracts/ReferencedPaymentNonexistenceVerification.md b/docs/apis/smart-contracts/ReferencedPaymentNonexistenceVerification.md deleted file mode 100644 index ed5fe73e4..000000000 --- a/docs/apis/smart-contracts/ReferencedPaymentNonexistenceVerification.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: ReferencedPaymentNonexistenceVerification -search: - boost: 0.5 ---- - - - -# `ReferencedPaymentNonexistenceVerification` { #ct_referencedpaymentnonexistenceverification } - -
-[Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/ReferencedPaymentNonexistenceVerification.sol) | Inherits from [IReferencedPaymentNonexistenceVerification](./IReferencedPaymentNonexistenceVerification.md) -
- -
- -Contract for verifying [`ReferencedPaymentNonexistence`](../attestation-types/ReferencedPaymentNonexistence.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). -This contract can be utilized at the end of the attestation request process to verify that the data -returned by an attestation provider matches the on-chain Merkle proof. - -
- -
- -## Functions - -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `ReferencedPaymentNonexistenceVerification` ([Docs](./ReferencedPaymentNonexistenceVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/ReferencedPaymentNonexistenceVerification.sol)). -
- -
- -```solidity -constructor( - contract IMerkleRootStorage _merkleRootStorage -) public; -``` - -
-
- -
- -### `verifyReferencedPaymentNonexistence` { #fn_verifyreferencedpaymentnonexistence_be4b1ed8 } - -
-Defined in `ReferencedPaymentNonexistenceVerification` ([Docs](./ReferencedPaymentNonexistenceVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/ReferencedPaymentNonexistenceVerification.sol)). -
- -
- -```solidity -function verifyReferencedPaymentNonexistence( - struct ReferencedPaymentNonexistence.Proof _proof -) external view returns ( - bool _proved); -``` - -Verifies the [`ReferencedPaymentNonexistence`](../attestation-types/ReferencedPaymentNonexistence.md) attestation using a Merkle proof. -It checks whether the provided proof corresponds to the on-chain Merkle root for the voting round specified inside the proof. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_proof` | `struct ReferencedPaymentNonexistence.Proof` | The [`ReferencedPaymentNonexistence`](../attestation-types/ReferencedPaymentNonexistence.md) attestation proof, which includes the Merkle proof and the attestation data. This proof is obtained directly from attestation providers. To learn about the format of this data, see [Attestation types](https://github.com/flare-foundation/songbird-state-connector-protocol/blob/main/specs/attestations/attestation-type-definition.md). | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_proved` | `bool` | Whether the attestation is successfully verified. | -
-
- -
- -
- -## Variables - -
- -### `merkleRootStorage` { #va_merklerootstorage } - -
-Defined in `ReferencedPaymentNonexistenceVerification` ([Docs](./ReferencedPaymentNonexistenceVerification.md), [Source](https://github.com/flare-foundation/songbird-state-connector-protocol/tree/main/contracts/generated/verification/ReferencedPaymentNonexistenceVerification.sol)). -
- -
- -```solidity - contract IMerkleRootStorage merkleRootStorage -``` - -
-
- -
- diff --git a/docs/apis/smart-contracts/RevertErrorTracking.md b/docs/apis/smart-contracts/RevertErrorTracking.md deleted file mode 100644 index 1b8ed781a..000000000 --- a/docs/apis/smart-contracts/RevertErrorTracking.md +++ /dev/null @@ -1,208 +0,0 @@ ---- -title: RevertErrorTracking -search: - boost: 0.5 ---- - - - -# `RevertErrorTracking` { #ct_reverterrortracking } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/RevertErrorTracking.sol) -
- -
- -Revert error tracking contract. - -A contract to track and store revert errors. - -
- -
- -## Events - -
- -### `ContractRevertError` { #ev_contractreverterror } - -
-Defined in `RevertErrorTracking` ([Docs](./RevertErrorTracking.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/RevertErrorTracking.sol)). -
- -
- -```solidity -event ContractRevertError( - address theContract, - uint256 atBlock, - string theMessage -) -``` - -Emitted when a contract reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `theContract` | `address` | The culprit's address. | -| `atBlock` | `uint256` | Block number where the error happened. | -| `theMessage` | `string` | Reason for the revert, as reported by the contract. | - -
-
- -
- -
- -## Functions - -
- -### `showLastRevertedError` { #fn_showlastrevertederror_2b3c41a4 } - -
-Defined in `RevertErrorTracking` ([Docs](./RevertErrorTracking.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/RevertErrorTracking.sol)). -
- -
- -```solidity -function showLastRevertedError( -) external view returns ( - uint256[] _lastErrorBlock, - uint256[] _numErrors, - string[] _errorString, - address[] _erroringContract, - uint256 _totalRevertedErrors); -``` - -Returns latest error information. All arrays will contain only one entry. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_lastErrorBlock` | `uint256[]` | Array of block numbers where the errors occurred. | -| `_numErrors` | `uint256[]` | Array of number of times same error with same contract address has been reverted. | -| `_errorString` | `string[]` | Array of revert error messages. | -| `_erroringContract` | `address[]` | Array of addresses of the reverting contracts. | -| `_totalRevertedErrors` | `uint256` | Total number of revert errors across all contracts. | -
-
- -
- -### `showRevertedErrors` { #fn_showrevertederrors_6ea0aa31 } - -
-Defined in `RevertErrorTracking` ([Docs](./RevertErrorTracking.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/RevertErrorTracking.sol)). -
- -
- -```solidity -function showRevertedErrors( - uint256 startIndex, - uint256 numErrorTypesToShow -) public view returns ( - uint256[] _lastErrorBlock, - uint256[] _numErrors, - string[] _errorString, - address[] _erroringContract, - uint256 _totalRevertedErrors); -``` - -Returns latest errors. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `startIndex` | `uint256` | Starting index in the error list array. | -| `numErrorTypesToShow` | `uint256` | Number of errors to show. The total amount can be found in `errorData`. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_lastErrorBlock` | `uint256[]` | Array of block numbers where the errors occurred. | -| `_numErrors` | `uint256[]` | Array of number of times same error with same contract address has been reverted. | -| `_errorString` | `string[]` | Array of revert error messages. | -| `_erroringContract` | `address[]` | Array of addresses of the reverting contracts. | -| `_totalRevertedErrors` | `uint256` | Total number of revert errors across all contracts. | -
-
- -
- -
- -## Structures - -
- -### `LastErrorData` { #st_lasterrordata } - -
-Defined in `RevertErrorTracking` ([Docs](./RevertErrorTracking.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/RevertErrorTracking.sol)). -
- -
- -
-```solidity -struct LastErrorData { - uint192 totalRevertedErrors; - uint64 lastErrorTypeIndex; -} -``` - -
- -
- -### `RevertedError` { #st_revertederror } - -
-Defined in `RevertErrorTracking` ([Docs](./RevertErrorTracking.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/RevertErrorTracking.sol)). -
- -
- -
-```solidity -struct RevertedError { - uint192 lastErrorBlock; - uint64 numErrors; - address fromContract; - uint64 errorTypeIndex; - string errorMessage; -} -``` - -
- -
- -
- -## Variables - -
- -### `errorData` { #va_errordata } - -
-Defined in `RevertErrorTracking` ([Docs](./RevertErrorTracking.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/RevertErrorTracking.sol)). -
- -
- -```solidity - struct RevertErrorTracking.LastErrorData errorData -``` - -Most recent error information. - -
-
- -
- diff --git a/docs/apis/smart-contracts/VPContract.md b/docs/apis/smart-contracts/VPContract.md deleted file mode 100644 index 624a9ce29..000000000 --- a/docs/apis/smart-contracts/VPContract.md +++ /dev/null @@ -1,1100 +0,0 @@ ---- -title: VPContract -search: - boost: 0.5 ---- - - - -# `VPContract` { #ct_vpcontract } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol) | Inherits from [IIVPContract](./IIVPContract.md), [Delegatable](./Delegatable.md) -
- -
- -Helper contract handling all the vote power and delegation functionality for an associated [`VPToken`](./VPToken.md). - -
- -
- -## Functions - -
- -### `batchVotePowerOfAt` { #fn_batchvotepowerofat_49e3c7e5 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function batchVotePowerOfAt( - address[] _owners, - uint256 _blockNumber -) external view returns ( - uint256[] _votePowers); -``` - -Get the vote power of a set of addresses at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owners` | `address[]` | The list of addresses being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_votePowers` | `uint256[]` | Vote power of each address at `_blockNumber`, including any delegation received. | -
-
- -
- -### `cleanupBlockNumber` { #fn_cleanupblocknumber_deea13e7 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function cleanupBlockNumber( -) external view returns ( - uint256); -``` - -Get the current cleanup block number set with [`setCleanupBlockNumber`](#fn_setcleanupblocknumber_13de97f5). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The currently set cleanup block number. | -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -constructor( - contract IVPToken _ownerToken, - bool _isReplacement -) public; -``` - -Construct [`VPContract`](./VPContract.md) for given [`VPToken`](./VPToken.md). - -
-
- -
- -### `delegate` { #fn_delegate_6230001a } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function delegate( - address _from, - address _to, - uint256 _balance, - uint256 _bips -) external; -``` - -[`Delegate`](#ev_delegate) `_bips` percentage of voting power from a delegator address to a delegatee address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | The address of the delegator. | -| `_to` | `address` | The address of the delegatee. | -| `_balance` | `uint256` | The delegator's current balance | -| `_bips` | `uint256` | The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: every call resets the delegation value (and a value of 0 revokes delegation). | - -
-
- -
- -### `delegateExplicit` { #fn_delegateexplicit_404d9e82 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function delegateExplicit( - address _from, - address _to, - uint256 _balance, - uint256 _amount -) external; -``` - -Explicitly [`delegate`](#fn_delegate_6230001a) `_amount` tokens of voting power from a delegator address to a delegatee address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | The address of the delegator. | -| `_to` | `address` | The address of the delegatee. | -| `_balance` | `uint256` | The delegator's current balance. | -| `_amount` | `uint256` | An explicit vote power amount to be delegated. Not cumulative: every call resets the delegation value (and a value of 0 undelegates `_to`). | - -
-
- -
- -### `delegatesOf` { #fn_delegatesof_7de5b8ed } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function delegatesOf( - address _owner -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the percentages and addresses being delegated to by a vote power delegator. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address of the delegator being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Array of delegatee addresses. | -| `_bips` | `uint256[]` | Array of delegation percents specified in basis points (1/100 or 1 percent), for each delegatee. | -| `_count` | `uint256` | The number of returned delegatees. | -| `_delegationMode` | `uint256` | The mode of the delegation (NOTSET=0, PERCENTAGE=1, AMOUNT=2). See [`Delegatable`](./Delegatable.md).DelegationMode. | -
-
- -
- -### `delegatesOfAt` { #fn_delegatesofat_ed475a79 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function delegatesOfAt( - address _owner, - uint256 _blockNumber -) public view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the percentages and addresses being delegated to by a vote power delegator, -at a given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address of the delegator being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Array of delegatee addresses. | -| `_bips` | `uint256[]` | Array of delegation percents specified in basis points (1/100 or 1 percent), for each delegatee. | -| `_count` | `uint256` | The number of returned delegatees. | -| `_delegationMode` | `uint256` | The mode of the delegation (NOTSET=0, PERCENTAGE=1, AMOUNT=2). See [`Delegatable`](./Delegatable.md).DelegationMode. | -
-
- -
- -### `delegationModeOf` { #fn_delegationmodeof_f6837767 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function delegationModeOf( - address _who -) external view returns ( - uint256); -``` - -Get the delegation mode of an address. This mode determines whether vote power is -allocated by percentage or by explicit value and cannot be changed once set with -[`delegate`](#fn_delegate_6230001a) or [`delegateExplicit`](#fn_delegateexplicit_404d9e82). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Delegation mode (NOTSET=0, PERCENTAGE=1, AMOUNT=2). See [`Delegatable`](./Delegatable.md).DelegationMode. | -
-
- -
- -### `explicitDelegationHistoryCleanup` { #fn_explicitdelegationhistorycleanup_cabc4528 } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -function explicitDelegationHistoryCleanup( - address _from, - address _to, - uint256 _count -) external returns ( - uint256); -``` - -Delete explicit delegation checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Delegator address. | -| `_to` | `address` | Delegatee address. | -| `_count` | `uint256` | Maximum number of checkpoints to delete. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of checkpoints deleted. | -
-
- -
- -### `isReplacement` { #fn_isreplacement_aa94d3f2 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function isReplacement( -) external view returns ( - bool); -``` - -Return true if this [`IIVPContract`](./IIVPContract.md) is configured to be used as a replacement for other contract. -It means that vote powers are not necessarily correct at the initialization, therefore -every method that reads vote power must check whether it is initialized for that address and block. - -
-
- -
- -### `ownerToken` { #fn_ownertoken_65371883 } - -
-Defined in `IIVPContract` ([Docs](./IIVPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/interface/IIVPContract.sol)). -
- -
- -```solidity -function ownerToken( -) external view returns ( - contract IVPToken); -``` - -The [`VPToken`](./VPToken.md) (or some other contract) that owns this [`VPContract`](./VPContract.md). -All state changing methods may be called only from this address. -This is because original `msg.sender` is typically sent in a parameter -and we must make sure that it cannot be faked by directly calling -[`IIVPContract`](./IIVPContract.md) methods. -Owner token is also used in case of replacement to recover vote powers from balances. - -
-
- -
- -### `percentageDelegationHistoryCleanup` { #fn_percentagedelegationhistorycleanup_7f57d58f } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -function percentageDelegationHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete percentage delegation checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Balance owner account address. | -| `_count` | `uint256` | Maximum number of checkpoints to delete. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of deleted checkpoints. | -
-
- -
- -### `revocationCleanup` { #fn_revocationcleanup_8c0b6b40 } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -function revocationCleanup( - address _from, - address _to, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete revocation entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Delegator address. | -| `_to` | `address` | Delegatee address. | -| `_blockNumber` | `uint256` | Block number for which total supply value was cached. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of revocation entries deleted (always 0 or 1). | -
-
- -
- -### `revokeDelegationAt` { #fn_revokedelegationat_c7c62fab } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function revokeDelegationAt( - address _from, - address _to, - uint256 _balance, - uint256 _blockNumber -) external; -``` - -[`Revoke`](#ev_revoke) all vote power delegation from a delegator address to a delegatee address at a given block. -Only affects the reads via [`votePowerOfAtCached`](#fn_votepowerofatcached_e587497e) in the block `_blockNumber`. -This method should be used only to prevent rogue [`delegate`](#fn_delegate_6230001a) voting in the current voting block. -To stop delegating use [`delegate`](#fn_delegate_6230001a) or [`delegateExplicit`](#fn_delegateexplicit_404d9e82) with value of 0, -or [`undelegateAll`](#fn_undelegateall_05109ecf)/ [`undelegateAllExplicit`](#fn_undelegateallexplicit_0f8b8af7). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | The address of the delegator. | -| `_to` | `address` | Address of the delegatee. | -| `_balance` | `uint256` | The delegator's current balance. | -| `_blockNumber` | `uint256` | The block number at which to revoke delegation. Must be in the past. | - -
-
- -
- -### `setCleanerContract` { #fn_setcleanercontract_f6a494af } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function setCleanerContract( - address _cleanerContract -) external; -``` - -Set the contract that is allowed to call history cleaning methods. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanerContract` | `address` | Address of the cleanup contract. Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). | - -
-
- -
- -### `setCleanupBlockNumber` { #fn_setcleanupblocknumber_13de97f5 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function setCleanupBlockNumber( - uint256 _blockNumber -) external; -``` - -Set the cleanup block number. -Historic data for the blocks before [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7) can be erased. -History before that block should never be used since it can be inconsistent. -In particular, cleanup block number must be lower than the current vote power block. - -The method can be called only by the owner token. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The new cleanup block number. | - -
-
- -
- -### `undelegateAll` { #fn_undelegateall_05109ecf } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function undelegateAll( - address _from, - uint256 _balance -) external; -``` - -Undelegate all voting power for a delegator address. -Can only be used with percentage delegation. -Does not reset delegation mode back to `NOTSET`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | The address of the delegator. | -| `_balance` | `uint256` | The delegator's current balance. | - -
-
- -
- -### `undelegateAllExplicit` { #fn_undelegateallexplicit_0f8b8af7 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function undelegateAllExplicit( - address _from, - address[] _delegateAddresses -) external returns ( - uint256); -``` - -Undelegate all explicit vote power by amount for a delegator address. -Can only be used with explicit delegation. -Does not reset delegation mode back to `NOTSET`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | The address of the delegator. | -| `_delegateAddresses` | `address[]` | Explicit delegation does not store delegatees' addresses, so the caller must supply them. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The amount still delegated (in case the list of delegates was incomplete). | -
-
- -
- -### `undelegatedVotePowerOf` { #fn_undelegatedvotepowerof_4a03d556 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function undelegatedVotePowerOf( - address _owner, - uint256 _balance -) external view returns ( - uint256); -``` - -Compute the current undelegated vote power of an address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | -| `_balance` | `uint256` | Current balance of that address. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`, this is, the amount of vote power currently not being delegated to other addresses. | -
-
- -
- -### `undelegatedVotePowerOfAt` { #fn_undelegatedvotepowerofat_31503927 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function undelegatedVotePowerOfAt( - address _owner, - uint256 _balance, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Compute the undelegated vote power of an address at a given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address being queried. | -| `_balance` | `uint256` | | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`, this is, the amount of vote power that was not being delegated to other addresses at that block number. | -
-
- -
- -### `updateAtTokenTransfer` { #fn_updateattokentransfer_eadb4362 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function updateAtTokenTransfer( - address _from, - address _to, - uint256 _fromBalance, - uint256 _toBalance, - uint256 _amount -) external; -``` - -Update vote powers when tokens are transferred. -Also update delegated vote powers for percentage delegation -and check for enough funds for explicit delegations. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Source account of the transfer. | -| `_to` | `address` | Destination account of the transfer. | -| `_fromBalance` | `uint256` | Balance of the source account before the transfer. | -| `_toBalance` | `uint256` | Balance of the destination account before the transfer. | -| `_amount` | `uint256` | Amount that has been transferred. | - -
-
- -
- -### `votePowerCacheCleanup` { #fn_votepowercachecleanup_891339a8 } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -function votePowerCacheCleanup( - address _owner, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete vote power cache entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Vote power owner account address. | -| `_blockNumber` | `uint256` | Block number for which total supply value was cached. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of deleted cache entries (always 0 or 1). | -
-
- -
- -### `votePowerFromTo` { #fn_votepowerfromto_9dc6b9f2 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function votePowerFromTo( - address _from, - address _to, - uint256 _balance -) external view returns ( - uint256); -``` - -Get current delegated vote power from a delegator to a delegatee. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of the delegator. | -| `_to` | `address` | Address of the delegatee. | -| `_balance` | `uint256` | The delegator's current balance. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The delegated vote power. | -
-
- -
- -### `votePowerFromToAt` { #fn_votepowerfromtoat_833aca92 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function votePowerFromToAt( - address _from, - address _to, - uint256 _balance, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get delegated the vote power from a delegator to a delegatee at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of the delegator. | -| `_to` | `address` | Address of the delegatee. | -| `_balance` | `uint256` | The delegator's current balance. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The delegated vote power. | -
-
- -
- -### `votePowerHistoryCleanup` { #fn_votepowerhistorycleanup_1a05274c } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -function votePowerHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete vote power checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | Vote power owner account address. | -| `_count` | `uint256` | Maximum number of checkpoints to delete. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Number of deleted checkpoints. | -
-
- -
- -### `votePowerOf` { #fn_votepowerof_142d1018 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function votePowerOf( - address _who -) external view returns ( - uint256); -``` - -Get the current vote power of an address. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Current vote power of `_who`, including any delegation received. | -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_92bfe6d8 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function votePowerOfAt( - address _who, - uint256 _blockNumber -) public view returns ( - uint256); -``` - -Get the vote power of an address at a given block number - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_who` at `_blockNumber`, including any delegation received. | -
-
- -
- -### `votePowerOfAtCached` { #fn_votepowerofatcached_e587497e } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function votePowerOfAtCached( - address _who, - uint256 _blockNumber -) external returns ( - uint256); -``` - -Get the vote power of an address at a given block number. -Reads/updates cache and upholds revocations. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_who` at `_blockNumber`, including any delegation received. | -
-
- -
- -### `votePowerOfAtIgnoringRevocation` { #fn_votepowerofatignoringrevocation_04bb4e43 } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -function votePowerOfAtIgnoringRevocation( - address _who, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of an address at a given block number, ignoring revocation information and cache. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address being queried. | -| `_blockNumber` | `uint256` | The block number being queried. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_who` at `_blockNumber`, including any delegation received. Result doesn't change if vote power is revoked. | -
-
- -
- -
- -## Modifiers - -
- -### `notBeforeCleanupBlock` { #md_notbeforecleanupblock } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -modifier notBeforeCleanupBlock( uint256 _blockNumber) -``` - -Reading from history is not allowed before `cleanupBlockNumber`, since data before that -might have been deleted and is thus unreliable. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number being checked for validity. | - -
-
- -
- -### `onlyCleaner` { #md_onlycleaner } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity -modifier onlyCleaner() -``` - -History cleaning methods can be called only from [`cleanerContract`](#va_cleanercontract). - -
-
- -
- -### `onlyExplicit` { #md_onlyexplicit } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -modifier onlyExplicit( address sender) -``` - -If a [`delegate`](#fn_delegate_6230001a) cannot be added by explicit amount, revert. - -
-
- -
- -### `onlyOwnerToken` { #md_onlyownertoken } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -modifier onlyOwnerToken() -``` - -All external methods in [`VPContract`](./VPContract.md) can only be executed by the owner token. - -
-
- -
- -### `onlyPercent` { #md_onlypercent } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity -modifier onlyPercent( address sender) -``` - -If a [`delegate`](#fn_delegate_6230001a) cannot be added by percentage, revert. - -
-
- -
- -
- -## Variables - -
- -### `cleanerContract` { #va_cleanercontract } - -
-Defined in `Delegatable` ([Docs](./Delegatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/Delegatable.sol)). -
- -
- -```solidity - address cleanerContract -``` - -Address of the contract that is allowed to call methods for history cleaning. - -
-
- -
- -### `isReplacement` { #va_isreplacement } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity - bool isReplacement -``` - -Return true if this [`IIVPContract`](./IIVPContract.md) is configured to be used as a replacement for other contract. -It means that vote powers are not necessarily correct at the initialization, therefore -every method that reads vote power must check whether it is initialized for that address and block. - -
-
- -
- -### `ownerToken` { #va_ownertoken } - -
-Defined in `VPContract` ([Docs](./VPContract.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPContract.sol)). -
- -
- -```solidity - contract IVPToken ownerToken -``` - -The [`VPToken`](./VPToken.md) (or some other contract) that owns this [`VPContract`](./VPContract.md). -All state changing methods may be called only from this address. -This is because original `msg.sender` is typically sent in a parameter -and we must make sure that it cannot be faked by directly calling -[`IIVPContract`](./IIVPContract.md) methods. -Owner token is also used in case of replacement to recover vote powers from balances. - -
-
- -
- diff --git a/docs/apis/smart-contracts/VPToken.md b/docs/apis/smart-contracts/VPToken.md deleted file mode 100644 index 1d14b34f5..000000000 --- a/docs/apis/smart-contracts/VPToken.md +++ /dev/null @@ -1,1839 +0,0 @@ ---- -title: VPToken -search: - boost: 0.5 ---- - - - -# `VPToken` { #ct_vptoken } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol) | Inherits from [IIVPToken](./IIVPToken.md), ERC20, [CheckPointable](./CheckPointable.md), [Governed](./Governed.md) -
- -
- -Vote power token. - -An ERC20 token that enables the holder to [`delegate`](#fn_delegate_026e402b) a voting power -equal to their balance, with history tracking by block height. -Actual vote power and delegation functionality is implemented in an associated [`VPContract`](./VPContract.md). - -
- -
- -## Events - -
- -### `Approval` { #ev_approval } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -event Approval( - address owner, - address spender, - uint256 value -) -``` - -Emitted when the [`allowance`](#fn_allowance_dd62ed3e) of a `spender` for an `owner` is set by -a call to [`approve`](#fn_approve_095ea7b3). `value` is the new [`allowance`](#fn_allowance_dd62ed3e). - -
-
- -
- -### `CreatedTotalSupplyCache` { #ev_createdtotalsupplycache } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -event CreatedTotalSupplyCache( - uint256 _blockNumber -) -``` - -Emitted when a total supply cache entry is created. -Allows history cleaners to track total supply cache cleanup opportunities off-chain. - -
-
- -
- -### `GovernanceCallTimelocked` { #ev_governancecalltimelocked } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceCallTimelocked( - bytes4 selector, - uint256 allowedAfterTimestamp, - bytes encodedCall -) -``` - -Emitted when a new [`governance`](#fn_governance_5aa6e675) call has been recorded and is now waiting for the time lock to expire. - -
-
- -
- -### `GovernanceInitialised` { #ev_governanceinitialised } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceInitialised( - address initialGovernance -) -``` - -Emitted when the [`governance`](#fn_governance_5aa6e675) address is initialized. -This address will be used until production mode is entered (see [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered)). -At that point the [`governance`](#fn_governance_5aa6e675) address is taken from [`GovernanceSettings`](./GovernanceSettings.md). - -
-
- -
- -### `GovernedProductionModeEntered` { #ev_governedproductionmodeentered } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernedProductionModeEntered( - address governanceSettings -) -``` - -Emitted when [`governance`](#fn_governance_5aa6e675) is enabled and the [`governance`](#fn_governance_5aa6e675) address cannot be changed anymore -(only through a network fork). - -
-
- -
- -### `TimelockedGovernanceCallCanceled` { #ev_timelockedgovernancecallcanceled } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallCanceled( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is canceled before execution. - -
-
- -
- -### `TimelockedGovernanceCallExecuted` { #ev_timelockedgovernancecallexecuted } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallExecuted( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is executed. - -
-
- -
- -### `Transfer` { #ev_transfer } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -event Transfer( - address from, - address to, - uint256 value -) -``` - -Emitted when `value` tokens are moved from one account (`from`) to -another (`to`). - -Note that `value` may be zero. - -
-
- -
- -### `VotePowerContractChanged` { #ev_votepowercontractchanged } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -event VotePowerContractChanged( - uint256 _contractType, - address _oldContractAddress, - address _newContractAddress -) -``` - -Emitted when one of the vote power contracts is changed. - -It is used to track the history of [`VPToken`](./VPToken.md) -> [`VPContract`](./VPContract.md) / [`GovernanceVotePower`](./GovernanceVotePower.md) -associations (e.g. by external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_contractType` | `uint256` | 0 = Read [`VPContract`](./VPContract.md), 1 = Write [`VPContract`](./VPContract.md), 2 = Governance vote power. | -| `_oldContractAddress` | `address` | Contract address before change. | -| `_newContractAddress` | `address` | Contract address after change. | - -
-
- -
- -
- -## Functions - -
- -### `allowance` { #fn_allowance_dd62ed3e } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function allowance( - address owner, - address spender -) external view returns ( - uint256); -``` - -Returns the remaining number of tokens that `spender` will be -allowed to spend on behalf of `owner` through [`transferFrom`](#fn_transferfrom_23b872dd). This is -zero by default. - -This value changes when [`approve`](#fn_approve_095ea7b3) or [`transferFrom`](#fn_transferfrom_23b872dd) are called. - -
-
- -
- -### `approve` { #fn_approve_095ea7b3 } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function approve( - address spender, - uint256 amount -) external returns ( - bool); -``` - -Sets `amount` as the [`allowance`](#fn_allowance_dd62ed3e) of `spender` over the caller's tokens. - -Returns a boolean value indicating whether the operation succeeded. - -IMPORTANT: Beware that changing an [`allowance`](#fn_allowance_dd62ed3e) with this method brings the risk -that someone may use both the old and the new [`allowance`](#fn_allowance_dd62ed3e) by unfortunate -transaction ordering. One possible solution to mitigate this race -condition is to first reduce the spender's [`allowance`](#fn_allowance_dd62ed3e) to 0 and set the -desired value afterwards: -https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - -Emits an [`Approval`](#ev_approval) event. - -
-
- -
- -### `balanceHistoryCleanup` { #fn_balancehistorycleanup_f0e292c9 } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function balanceHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete balance checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | balance owner account address | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `balanceOf` { #fn_balanceof_70a08231 } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function balanceOf( - address account -) external view returns ( - uint256); -``` - -Returns the amount of tokens owned by `account`. - -
-
- -
- -### `balanceOfAt` { #fn_balanceofat_4ee2cd7e } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function balanceOfAt( - address _owner, - uint256 _blockNumber -) public view returns ( - uint256); -``` - -Queries the token balance of `_owner` at a specific `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address from which the balance will be retrieved. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | | -
-
- -
- -### `batchDelegate` { #fn_batchdelegate_dc4fcda7 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function batchDelegate( - address[] _delegatees, - uint256[] _bips -) external; -``` - -Undelegate all percentage delegations from the sender and then [`delegate`](#fn_delegate_026e402b) corresponding - `_bips` percentage of voting power from the sender to each member of the `_delegatees` array. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegatees` | `address[]` | The addresses of the new recipients. | -| `_bips` | `uint256[]` | The percentages of voting power to be delegated expressed in basis points (1/100 of one percent). The sum of all `_bips` values must be at most 10000 (100%). | - -
-
- -
- -### `batchVotePowerOfAt` { #fn_batchvotepowerofat_49e3c7e5 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function batchVotePowerOfAt( - address[] _owners, - uint256 _blockNumber -) external view returns ( - uint256[]); -``` - -Return the vote power for several addresses. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owners` | `address[]` | The list of addresses to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256[]` | Array of vote power for each queried address. | -
-
- -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `cleanupBlockNumber` { #fn_cleanupblocknumber_deea13e7 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function cleanupBlockNumber( -) external view returns ( - uint256); -``` - -Get the current cleanup block number set with [`setCleanupBlockNumber`](#fn_setcleanupblocknumber_13de97f5). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The currently set cleanup block number. | -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -constructor( - address _governance, - string _name, - string _symbol -) public; -``` - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Governed` ([Docs](./Governed.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/Governed.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Governance contract. Must not be zero. | - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `ERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/ERC20.sol)). -
- -
- -```solidity -constructor( - string name_, - string symbol_ -) public; -``` - -Sets the values for [`name`](#fn_name_06fdde03) and [`symbol`](#fn_symbol_95d89b41), initializes [`decimals`](#fn_decimals_313ce567) with -a default value of 18. - -To select a different value for [`decimals`](#fn_decimals_313ce567), use _setupDecimals. - -All three of these values are immutable: they can only be set once during -construction. - -
-
- -
- -### `decimals` { #fn_decimals_313ce567 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function decimals( -) public view returns ( - uint8); -``` - -Returns the number of [`decimals`](#fn_decimals_313ce567) used to get its user representation. -For example, if [`decimals`](#fn_decimals_313ce567) equals 2, a balance of 505 tokens should -be displayed to a user as 5.05 (505 / 102). - -Tokens usually opt for a value of 18, imitating the relationship between -Ether and wei. This is the default value returned by this function, unless -it's overridden. - -NOTE: This information is only used for _display_ purposes: it in -no way affects any of the arithmetic of the contract, including -[`balanceOf`](#fn_balanceof_70a08231) and [`transfer`](#fn_transfer_a9059cbb). - -Should be compatible with ERC20 method. - -
-
- -
- -### `delegate` { #fn_delegate_026e402b } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function delegate( - address _to, - uint256 _bips -) external; -``` - -Delegate voting power to account `_to` from `msg.sender`, by percentage. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_bips` | `uint256` | The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: every call resets the delegation value (and a value of 0 revokes all previous delegations). | - -
-
- -
- -### `delegateExplicit` { #fn_delegateexplicit_d06dc3ad } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function delegateExplicit( - address _to, - uint256 _amount -) external; -``` - -Explicitly [`delegate`](#fn_delegate_026e402b) `_amount` voting power to account `_to` from `msg.sender`. -Compare with [`delegate`](#fn_delegate_026e402b) which delegates by percentage. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_amount` | `uint256` | An explicit vote power amount to be delegated. Not cumulative: every call resets the delegation value (and a value of 0 revokes all previous delegations). | - -
-
- -
- -### `delegatesOf` { #fn_delegatesof_7de5b8ed } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function delegatesOf( - address _owner -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the list of addresses to which `_who` is delegating, and their percentages. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Positional array of addresses being delegated to. | -| `_bips` | `uint256[]` | Positional array of delegation percents specified in basis points (1/100 of 1 percent). Each one matches the address in the same position in the `_delegateAddresses` array. | -| `_count` | `uint256` | The number of delegates. | -| `_delegationMode` | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `delegatesOfAt` { #fn_delegatesofat_ed475a79 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function delegatesOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the list of addresses to which `_who` is delegating, and their percentages, at the given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Positional array of addresses being delegated to. | -| `_bips` | `uint256[]` | Positional array of delegation percents specified in basis points (1/100 of 1 percent). Each one matches the address in the same position in the `_delegateAddresses` array. | -| `_count` | `uint256` | The number of delegates. | -| `_delegationMode` | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `delegationModeOf` { #fn_delegationmodeof_f6837767 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function delegationModeOf( - address _who -) external view returns ( - uint256); -``` - -Get the delegation mode for account '_who'. This mode determines whether vote power is -allocated by percentage or by explicit amount. Once the delegation mode is set, -it can never be changed, even if all delegations are removed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address to get delegation mode. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `governanceVotePower` { #fn_governancevotepower_8c2b8ae1 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function governanceVotePower( -) external view returns ( - contract IGovernanceVotePower); -``` - -When set, allows token owners to participate in [`governance`](#fn_governance_5aa6e675) voting -and [`delegate`](#fn_delegate_026e402b) [`governance`](#fn_governance_5aa6e675) vote power. - -
-
- -
- -### `name` { #fn_name_06fdde03 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function name( -) public view returns ( - string); -``` - -Returns the [`name`](#fn_name_06fdde03) of the token. - -Should be compatible with ERC20 method. - -
-
- -
- -### `readVotePowerContract` { #fn_readvotepowercontract_9b3baa0e } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function readVotePowerContract( -) external view returns ( - contract IVPContractEvents); -``` - -Returns [`VPContract`](./VPContract.md) event interface used for read-only operations (view methods). -The only non-view method that might be called on it is [`revokeDelegationAt`](#fn_revokedelegationat_bbd6fbf8). - -[`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e) is almost always equal to [`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) -except during an upgrade from one [`VPContract`](./VPContract.md) to a new version (which should happen -rarely or never and will be announced beforehand). - -Do not call any methods on [`VPContract`](./VPContract.md) directly. -State changing methods are forbidden from direct calls. -All methods are exposed via [`VPToken`](./VPToken.md). -This is the reason that this method returns [`IVPContractEvents`](./IVPContractEvents.md). -Use it only for listening to events and revoking. - -
-
- -
- -### `revokeDelegationAt` { #fn_revokedelegationat_bbd6fbf8 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function revokeDelegationAt( - address _who, - uint256 _blockNumber -) public; -``` - -Revoke all delegation from sender to `_who` at given block. -Only affects the reads via [`votePowerOfAtCached`](#fn_votepowerofatcached_e587497e) in the block `_blockNumber`. -Block `_blockNumber` must be in the past. -This method should be used only to prevent rogue [`delegate`](#fn_delegate_026e402b) voting in the current voting block. -To stop delegating use [`delegate`](#fn_delegate_026e402b) / [`delegateExplicit`](#fn_delegateexplicit_d06dc3ad) with value of 0 or [`undelegateAll`](#fn_undelegateall_b302f393) / [`undelegateAllExplicit`](#fn_undelegateallexplicit_5d6d11eb). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | Address of the delegatee. | -| `_blockNumber` | `uint256` | The block number at which to revoke delegation.. | - -
-
- -
- -### `setCleanerContract` { #fn_setcleanercontract_f6a494af } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setCleanerContract( - address _cleanerContract -) external; -``` - -Set the contract that is allowed to call history cleaning methods. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanerContract` | `address` | Address of the cleanup contract. Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). | - -
-
- -
- -### `setCleanupBlockNumber` { #fn_setcleanupblocknumber_13de97f5 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setCleanupBlockNumber( - uint256 _blockNumber -) external; -``` - -Set the cleanup block number. -Historic data for the blocks before [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7) can be erased. -History before that block should never be used since it can be inconsistent. -In particular, cleanup block number must be lower than the current vote power block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The new cleanup block number. | - -
-
- -
- -### `setCleanupBlockNumberManager` { #fn_setcleanupblocknumbermanager_7f4fcaa9 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setCleanupBlockNumberManager( - address _cleanupBlockNumberManager -) external; -``` - -Set the contract that is allowed to set [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7). -Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). - -
-
- -
- -### `setGovernanceVotePower` { #fn_setgovernancevotepower_9ca2231a } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setGovernanceVotePower( - contract IIGovernanceVotePower _governanceVotePower -) external; -``` - -Sets new [`governance`](#fn_governance_5aa6e675) vote power contract that allows token owners to participate in [`governance`](#fn_governance_5aa6e675) voting -and [`delegate`](#fn_delegate_026e402b) [`governance`](#fn_governance_5aa6e675) vote power. - -
-
- -
- -### `setReadVpContract` { #fn_setreadvpcontract_31d12a16 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setReadVpContract( - contract IIVPContract _vpContract -) external; -``` - -Call from [`governance`](#fn_governance_5aa6e675) to set read VpContract on token, e.g. -vpToken.[`setReadVpContract`](#fn_setreadvpcontract_31d12a16)(new [`VPContract`](./VPContract.md)(vpToken)). - -Read [`VPContract`](./VPContract.md) must be set before any of the [`VPToken`](./VPToken.md) delegation or vote power reading methods are called, -otherwise they will revert. - -**NOTE**: If `readVpContract` differs from `writeVpContract` all reads will be "frozen" and will not reflect -changes (not even revokes; they may or may not reflect balance transfers). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_vpContract` | `contract IIVPContract` | Read vote power contract to be used by this token. | - -
-
- -
- -### `setWriteVpContract` { #fn_setwritevpcontract_755d10a4 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setWriteVpContract( - contract IIVPContract _vpContract -) external; -``` - -Call from [`governance`](#fn_governance_5aa6e675) to set write VpContract on token, e.g. -vpToken.[`setWriteVpContract`](#fn_setwritevpcontract_755d10a4)(new [`VPContract`](./VPContract.md)(vpToken)). - -Write [`VPContract`](./VPContract.md) must be set before any of the [`VPToken`](./VPToken.md) delegation modifying methods are called, -otherwise they will revert. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_vpContract` | `contract IIVPContract` | Write vote power contract to be used by this token. | - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `symbol` { #fn_symbol_95d89b41 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function symbol( -) public view returns ( - string); -``` - -Returns the [`symbol`](#fn_symbol_95d89b41) of the token, usually a shorter version of the [`name`](#fn_name_06fdde03). - -Should be compatible with ERC20 method. - -
-
- -
- -### `totalSupply` { #fn_totalsupply_18160ddd } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function totalSupply( -) external view returns ( - uint256); -``` - -Returns the amount of tokens in existence. - -
-
- -
- -### `totalSupplyAt` { #fn_totalsupplyat_981b24d0 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function totalSupplyAt( - uint256 _blockNumber -) public view returns ( - uint256); -``` - -Total amount of tokens at a specific `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number when the _totalSupply is queried | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | | -
-
- -
- -### `totalSupplyCacheCleanup` { #fn_totalsupplycachecleanup_43ea370b } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function totalSupplyCacheCleanup( - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete total supply cache entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | the block number for which total supply value was cached | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of cache entries deleted (always 0 or 1) | -
-
- -
- -### `totalSupplyHistoryCleanup` { #fn_totalsupplyhistorycleanup_f62f8f3a } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function totalSupplyHistoryCleanup( - uint256 _count -) external returns ( - uint256); -``` - -Delete total supply checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `totalVotePower` { #fn_totalvotepower_f5f3d4f7 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function totalVotePower( -) external view returns ( - uint256); -``` - -Get the current total vote power. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current total vote power (sum of all accounts' vote power). | -
-
- -
- -### `totalVotePowerAt` { #fn_totalvotepowerat_3e5aa26a } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function totalVotePowerAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the queried block (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAtCached` { #fn_totalvotepoweratcached_caeb942b } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function totalVotePowerAtCached( - uint256 _blockNumber -) public returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` using cache. - It tries to read the cached value and if it is not found, reads the actual value and stores it in the cache. - Can only be used if `_blockNumber` is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the queried block (sum of all accounts' vote powers). | -
-
- -
- -### `transfer` { #fn_transfer_a9059cbb } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function transfer( - address recipient, - uint256 amount -) external returns ( - bool); -``` - -Moves `amount` tokens from the caller's account to `recipient`. - -Returns a boolean value indicating whether the operation succeeded. - -Emits a [`Transfer`](#ev_transfer) event. - -
-
- -
- -### `transferFrom` { #fn_transferfrom_23b872dd } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function transferFrom( - address sender, - address recipient, - uint256 amount -) external returns ( - bool); -``` - -Moves `amount` tokens from `sender` to `recipient` using the -[`allowance`](#fn_allowance_dd62ed3e) mechanism. `amount` is then deducted from the caller's -[`allowance`](#fn_allowance_dd62ed3e). - -Returns a boolean value indicating whether the operation succeeded. - -Emits a [`Transfer`](#ev_transfer) event. - -
-
- -
- -### `undelegateAll` { #fn_undelegateall_b302f393 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function undelegateAll( -) external; -``` - -Undelegate all voting power of `msg.sender`. This effectively revokes all previous delegations. -Can only be used with percentage delegation. -Does not reset delegation mode back to NOT SET. - -
-
- -
- -### `undelegateAllExplicit` { #fn_undelegateallexplicit_5d6d11eb } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function undelegateAllExplicit( - address[] _delegateAddresses -) external returns ( - uint256 _remainingDelegation); -``` - -Undelegate all explicit vote power by amount of `msg.sender`. -Can only be used with explicit delegation. -Does not reset delegation mode back to NOT SET. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Explicit delegation does not store delegatees' addresses, so the caller must supply them. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_remainingDelegation` | `uint256` | The amount still delegated (in case the list of delegates was incomplete). | -
-
- -
- -### `undelegatedVotePowerOf` { #fn_undelegatedvotepowerof_d6aa0b77 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function undelegatedVotePowerOf( - address _owner -) external view returns ( - uint256); -``` - -Compute the current undelegated vote power of the `_owner` account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`. | -
-
- -
- -### `undelegatedVotePowerOfAt` { #fn_undelegatedvotepowerofat_83035a82 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function undelegatedVotePowerOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the undelegated vote power of the `_owner` account at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`. | -
-
- -
- -### `votePowerFromTo` { #fn_votepowerfromto_be0ca747 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerFromTo( - address _from, - address _to -) external view returns ( - uint256); -``` - -Get current delegated vote power from delegator `_from` to delegatee `_to`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of delegator. | -| `_to` | `address` | Address of delegatee. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | votePower The delegated vote power. | -
-
- -
- -### `votePowerFromToAt` { #fn_votepowerfromtoat_e64767aa } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerFromToAt( - address _from, - address _to, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get delegated vote power from delegator `_from` to delegatee `_to` at `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of delegator. | -| `_to` | `address` | Address of delegatee. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The delegated vote power. | -
-
- -
- -### `votePowerOf` { #fn_votepowerof_142d1018 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerOf( - address _owner -) external view returns ( - uint256); -``` - -Get the current vote power of `_owner`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Current vote power of `_owner`. | -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_92bfe6d8 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at block number `_blockNumber`. | -
-
- -
- -### `votePowerOfAtCached` { #fn_votepowerofatcached_e587497e } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerOfAtCached( - address _owner, - uint256 _blockNumber -) public returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` using cache. - It tries to read the cached value and if it is not found, reads the actual value and stores it in the cache. - Can only be used if `_blockNumber` is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at `_blockNumber`. | -
-
- -
- -### `votePowerOfAtIgnoringRevocation` { #fn_votepowerofatignoringrevocation_04bb4e43 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerOfAtIgnoringRevocation( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber`, ignoring revocation information (and cache). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at block number `_blockNumber`. Result doesn't change if vote power is revoked. | -
-
- -
- -### `writeVotePowerContract` { #fn_writevotepowercontract_1fec092a } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function writeVotePowerContract( -) external view returns ( - contract IVPContractEvents); -``` - -Returns [`VPContract`](./VPContract.md) event interface used for state-changing operations (non-view methods). -The only non-view method that might be called on it is [`revokeDelegationAt`](#fn_revokedelegationat_bbd6fbf8). - -[`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) is almost always equal to [`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e), -except during upgrade from one [`VPContract`](./VPContract.md) to a new version (which should happen -rarely or never and will be announced beforehand). -In the case of an upgrade, [`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) is replaced first to establish delegations. -After some period (e.g., after a reward epoch ends), [`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e) is set equal to it. - -Do not call any methods on [`VPContract`](./VPContract.md) directly. -State changing methods are forbidden from direct calls. -All are exposed via [`VPToken`](./VPToken.md). -This is the reason that this method returns [`IVPContractEvents`](./IVPContractEvents.md) -Use it only for listening to events, delegating, and revoking. - -
-
- -
- -
- -## Variables - -
- -### `cleanerContract` { #va_cleanercontract } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity - address cleanerContract -``` - -Address of the contract that is allowed to call methods for history cleaning. - -
-
- -
- -### `cleanupBlockNumberManager` { #va_cleanupblocknumbermanager } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity - address cleanupBlockNumberManager -``` - -The contract that is allowed to set [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7). -Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- -### `vpContractInitialized` { #va_vpcontractinitialized } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity - bool vpContractInitialized -``` - -When true, the argument to [`setWriteVpContract`](#fn_setwritevpcontract_755d10a4) must be a vpContract -with `isReplacement` set to `true`. To be used for creating the correct [`VPContract`](./VPContract.md). - -
-
- -
- diff --git a/docs/apis/smart-contracts/VoterWhitelister.md b/docs/apis/smart-contracts/VoterWhitelister.md deleted file mode 100644 index f37249acd..000000000 --- a/docs/apis/smart-contracts/VoterWhitelister.md +++ /dev/null @@ -1,977 +0,0 @@ ---- -title: VoterWhitelister -search: - boost: 0.5 ---- - - - -# `VoterWhitelister` { #ct_voterwhitelister } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol) | Inherits from [IIVoterWhitelister](./IIVoterWhitelister.md), [Governed](./Governed.md), [AddressUpdatable](./AddressUpdatable.md) -
- -
- -Manager of the [FTSO whitelist](https://docs.flare.network/infra/data/whitelisting/). - -Only addresses registered in this contract can submit data to the FTSO system. - -
- -
- -## Functions - -
- -### `addFtso` { #fn_addftso_345705a4 } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function addFtso( - uint256 _ftsoIndex -) external; -``` - -Create an empty whitelist with default size for a new FTSO. - -Only [`ftsoManager`](#va_ftsomanager) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index of the new FTSO. | - -
-
- -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `chillVoter` { #fn_chillvoter_2b4faebb } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function chillVoter( - address _voter, - uint256 _noOfRewardEpochs, - uint256[] _ftsoIndices -) external returns ( - bool[] _removed, - uint256 _untilRewardEpoch); -``` - -Used to chill a data provider, this is, remove it from the whitelist for a -specified number of reward epochs. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Data provider being chilled. | -| `_noOfRewardEpochs` | `uint256` | Number of epochs to chill the provider for. | -| `_ftsoIndices` | `uint256[]` | Array of indices of the FTSOs that will not allow this provider to submit data. | - -
-
- -
- -### `chilledUntilRewardEpoch` { #fn_chilleduntilrewardepoch_46538074 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function chilledUntilRewardEpoch( - address _voter -) external view returns ( - uint256); -``` - -In case of providing bad prices (e.g. collusion), the voter can be chilled for a few reward epochs. -A voter can whitelist again from a returned reward epoch onwards. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the queried data provider. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 ID of the epoch where the data provider can start submitting prices again. | -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -constructor( - address _governance, - address _addressUpdater, - contract IIPriceSubmitter _priceSubmitter, - uint256 _defaultMaxVotersForFtso, - contract IVoterWhitelister _oldVoterWhitelister -) public; -``` - -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `Governed` ([Docs](./Governed.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/Governed.sol)). -
- -
- -```solidity -constructor( - address _governance -) public; -``` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_governance` | `address` | Governance contract. Must not be zero. | - -
-
- -
- -### `copyWhitelist` { #fn_copywhitelist_8e15c883 } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function copyWhitelist( - uint256 _ftsoIndex -) external; -``` - -Copy whitelist data from [`oldVoterWhitelister`](#va_oldvoterwhitelister) for a specific FTSO. -Can only be called by [`governance`](#fn_governance_5aa6e675). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index of the FTSO whose whitelist is to be copied. | - -
-
- -
- -### `defaultMaxVotersForFtso` { #fn_defaultmaxvotersforftso_47ed51b1 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function defaultMaxVotersForFtso( -) external view returns ( - uint256); -``` - -Maximum number of voters in the whitelist for a new FTSO. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Default maximum allowed voters. | -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `getAddressUpdater` { #fn_getaddressupdater_5267a15d } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```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. | -
-
- -
- -### `getFtsoWhitelistedPriceProviders` { #fn_getftsowhitelistedpriceproviders_09fcb400 } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function getFtsoWhitelistedPriceProviders( - uint256 _ftsoIndex -) public view returns ( - address[]); -``` - -Gets whitelisted price providers for the FTSO at a given index. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Queried index. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Array of addresses of the whitelisted data providers. | -
-
- -
- -### `getFtsoWhitelistedPriceProvidersBySymbol` { #fn_getftsowhitelistedpriceprovidersbysymbol_aa89dfd4 } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function getFtsoWhitelistedPriceProvidersBySymbol( - string _symbol -) external view returns ( - address[]); -``` - -Gets whitelisted price providers for the FTSO with a specified symbol. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_symbol` | `string` | Queried symbol. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `address[]` | Array of addresses of the whitelisted data providers. | -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `maxVotersForFtso` { #fn_maxvotersforftso_98dccfc2 } - -
-Defined in `IVoterWhitelister` ([Docs](./IVoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/userInterfaces/IVoterWhitelister.sol)). -
- -
- -```solidity -function maxVotersForFtso( - uint256 _ftsoIndex -) external view returns ( - uint256); -``` - -Maximum number of voters in the whitelist for a specific FTSO. -Adjustable separately for each index. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index of the FTSO. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | uint256 Maximum allowed voters. | -
-
- -
- -### `removeFtso` { #fn_removeftso_d8736171 } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function removeFtso( - uint256 _ftsoIndex -) external; -``` - -Clear whitelist for a removed FTSO. - -Only [`ftsoManager`](#va_ftsomanager) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index of the removed FTSO. | - -
-
- -
- -### `removeTrustedAddressFromWhitelist` { #fn_removetrustedaddressfromwhitelist_9dc950ab } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function removeTrustedAddressFromWhitelist( - address _trustedAddress, - uint256 _ftsoIndex -) external; -``` - -Remove a trusted address from whitelist. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_trustedAddress` | `address` | Address to remove. | -| `_ftsoIndex` | `uint256` | Index of the FTSO being modified. | - -
-
- -
- -### `requestFullVoterWhitelisting` { #fn_requestfullvoterwhitelisting_b06cbaf7 } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function requestFullVoterWhitelisting( - address _voter -) external returns ( - uint256[] _supportedIndices, - bool[] _success); -``` - -Requests whitelisting an account to act as a data provider for all active FTSOs. -May be called by any address, including the voter itself. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the voter to be whitelisted. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_supportedIndices` | `uint256[]` | Array of currently supported FTSO indices. | -| `_success` | `bool[]` | Array of success flags by FTSO index. | -
-
- -
- -### `requestWhitelistingVoter` { #fn_requestwhitelistingvoter_3de2cb1c } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function requestWhitelistingVoter( - address _voter, - uint256 _ftsoIndex -) external; -``` - -Requests whitelisting an account to act as a data provider for a specific FTSO. -Reverts if the vote power of the account is too low. -May be called by any address, including the voter itself. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the voter to be whitelisted. | -| `_ftsoIndex` | `uint256` | Index of the FTSO. | - -
-
- -
- -### `setDefaultMaxVotersForFtso` { #fn_setdefaultmaxvotersforftso_2ee96140 } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function setDefaultMaxVotersForFtso( - uint256 _defaultMaxVotersForFtso -) external; -``` - -Set the maximum number of voters in the whitelist for a new FTSOs. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_defaultMaxVotersForFtso` | `uint256` | New maximum default value. | - -
-
- -
- -### `setMaxVotersForFtso` { #fn_setmaxvotersforftso_7ecfcfa3 } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function setMaxVotersForFtso( - uint256 _ftsoIndex, - uint256 _newMaxVoters -) external; -``` - -Set the maximum number of voters in the whitelist for a specific FTSO. -Can remove voters with the least votepower from the whitelist. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_ftsoIndex` | `uint256` | Index of the FTSO to modify. | -| `_newMaxVoters` | `uint256` | New size of the whitelist. | - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `turnOffCopyMode` { #fn_turnoffcopymode_3a65d7b6 } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -function turnOffCopyMode( -) external; -``` - -Turn off copy mode. -Can only be called by [`governance`](#fn_governance_5aa6e675). - -
-
- -
- -### `updateContractAddresses` { #fn_updatecontractaddresses_b00c0b76 } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -function updateContractAddresses( - bytes32[] _contractNameHashes, - address[] _contractAddresses -) external; -``` - -External method called from [`AddressUpdater`](./AddressUpdater.md) only. - -
-
- -
- -
- -## Modifiers - -
- -### `notInCopyMode` { #md_notincopymode } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -modifier notInCopyMode() -``` - -Only callable when not in copy mode. - -
-
- -
- -### `onlyAddressUpdater` { #md_onlyaddressupdater } - -
-Defined in `AddressUpdatable` ([Docs](./AddressUpdatable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/addressUpdater/implementation/AddressUpdatable.sol)). -
- -
- -```solidity -modifier onlyAddressUpdater() -``` - -Only the `AdressUpdater` contract can call this method. -Its address is set at construction time but it can also update itself. - -
-
- -
- -### `onlyFtsoManager` { #md_onlyftsomanager } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -modifier onlyFtsoManager() -``` - -Only the [`ftsoManager`](#va_ftsomanager) can call this method. - -
-
- -
- -### `onlyGovernance` { #md_onlygovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyGovernance() -``` - -
-
- -
- -### `onlyImmediateGovernance` { #md_onlyimmediategovernance } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -modifier onlyImmediateGovernance() -``` - -
-
- -
- -### `voterNotChilled` { #md_voternotchilled } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity -modifier voterNotChilled( address _voter) -``` - -Only data providers that have not been chilled can perform this action. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_voter` | `address` | Address of the data provider performing the action. | - -
-
- -
- -
- -## Variables - -
- -### `chilledUntilRewardEpoch` { #va_chilleduntilrewardepoch } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity - mapping(address => uint256) chilledUntilRewardEpoch -``` - -In case of providing bad prices (e.g. collusion), the voter can be chilled for a few reward epochs. -A voter can whitelist again from a returned reward epoch onwards. - -
-
- -
- -### `copyMode` { #va_copymode } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity - bool copyMode -``` - -
-
- -
- -### `defaultMaxVotersForFtso` { #va_defaultmaxvotersforftso } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity - uint256 defaultMaxVotersForFtso -``` - -Maximum number of voters in the whitelist for a new FTSO. - -
-
- -
- -### `ftsoManager` { #va_ftsomanager } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity - contract IFtsoManager ftsoManager -``` - -Address of the [`FtsoManager`](./FtsoManager.md) contract. - -
-
- -
- -### `ftsoRegistry` { #va_ftsoregistry } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity - contract IFtsoRegistry ftsoRegistry -``` - -Address of the [`FtsoRegistry`](./FtsoRegistry.md) contract. - -
-
- -
- -### `governanceSettings` { #va_governancesettings } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - contract IGovernanceSettings governanceSettings -``` - -Governance Settings. - -
-
- -
- -### `maxVotersForFtso` { #va_maxvotersforftso } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity - mapping(uint256 => uint256) maxVotersForFtso -``` - -Maximum number of voters in the whitelist for a specific FTSO. -Adjustable separately for each index. - -
-
- -
- -### `oldVoterWhitelister` { #va_oldvoterwhitelister } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity - contract IVoterWhitelister oldVoterWhitelister -``` - -Previous [`VoterWhitelister`](./VoterWhitelister.md) contract, set at construction time. -Necessary to allow copying the previous whitelist onto a new contract. - -
-
- -
- -### `priceSubmitter` { #va_pricesubmitter } - -
-Defined in `VoterWhitelister` ([Docs](./VoterWhitelister.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/utils/implementation/VoterWhitelister.sol)). -
- -
- -```solidity - contract IIPriceSubmitter priceSubmitter -``` - -Address of the [`PriceSubmitter`](./PriceSubmitter.md) contract set at construction time. - -
-
- -
- -### `productionMode` { #va_productionmode } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - bool productionMode -``` - -When true, [`governance`](#fn_governance_5aa6e675) is enabled and cannot be disabled. See [`switchToProductionMode`](#fn_switchtoproductionmode_f5a98383). - -
-
- -
- -### `timelockedCalls` { #va_timelockedcalls } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity - mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls -``` - -List of pending timelocked [`governance`](#fn_governance_5aa6e675) calls. - -
-
- -
- diff --git a/docs/apis/smart-contracts/WNat.md b/docs/apis/smart-contracts/WNat.md deleted file mode 100644 index 25dca87fd..000000000 --- a/docs/apis/smart-contracts/WNat.md +++ /dev/null @@ -1,1873 +0,0 @@ ---- -title: WNat -search: - boost: 0.5 ---- - - - -# `WNat` { #ct_wnat } - -
-[Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/WNat.sol) | Inherits from [VPToken](./VPToken.md), [IWNat](./IWNat.md) -
- -
- -Wrapped native token. - -This contract converts native tokens into `WNAT` (wrapped native) tokens and vice versa. -`WNAT` tokens are a one-to-one [ERC20](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) -representation of native tokens, which are minted and burned as needed by this contract. - -The wrapped versions of the native `FLR` and `SGB` tokens are called `WFLR` and `WSGB` respectively. - -Besides the standard ERC20 operations, this contract supports -[FTSO delegation](https://docs.flare.network/tech/ftso/#delegation) and -[governance vote delegation](https://docs.flare.network/tech/governance/#vote-transfer). - -Code attribution: WETH9. - -
- -
- -## Events - -
- -### `Approval` { #ev_approval } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -event Approval( - address owner, - address spender, - uint256 value -) -``` - -Emitted when the [`allowance`](#fn_allowance_dd62ed3e) of a `spender` for an `owner` is set by -a call to [`approve`](#fn_approve_095ea7b3). `value` is the new [`allowance`](#fn_allowance_dd62ed3e). - -
-
- -
- -### `CreatedTotalSupplyCache` { #ev_createdtotalsupplycache } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -event CreatedTotalSupplyCache( - uint256 _blockNumber -) -``` - -Emitted when a total supply cache entry is created. -Allows history cleaners to track total supply cache cleanup opportunities off-chain. - -
-
- -
- -### `Deposit` { #ev_deposit } - -
-Defined in `WNat` ([Docs](./WNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/WNat.sol)). -
- -
- -```solidity -event Deposit( - address dst, - uint256 amount -) -``` - -Emitted when tokens have been wrapped. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `dst` | `address` | The account that received the wrapped tokens. | -| `amount` | `uint256` | The amount that was wrapped. | - -
-
- -
- -### `GovernanceCallTimelocked` { #ev_governancecalltimelocked } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceCallTimelocked( - bytes4 selector, - uint256 allowedAfterTimestamp, - bytes encodedCall -) -``` - -Emitted when a new [`governance`](#fn_governance_5aa6e675) call has been recorded and is now waiting for the time lock to expire. - -
-
- -
- -### `GovernanceInitialised` { #ev_governanceinitialised } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernanceInitialised( - address initialGovernance -) -``` - -Emitted when the [`governance`](#fn_governance_5aa6e675) address is initialized. -This address will be used until production mode is entered (see [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered)). -At that point the [`governance`](#fn_governance_5aa6e675) address is taken from [`GovernanceSettings`](./GovernanceSettings.md). - -
-
- -
- -### `GovernedProductionModeEntered` { #ev_governedproductionmodeentered } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event GovernedProductionModeEntered( - address governanceSettings -) -``` - -Emitted when [`governance`](#fn_governance_5aa6e675) is enabled and the [`governance`](#fn_governance_5aa6e675) address cannot be changed anymore -(only through a network fork). - -
-
- -
- -### `TimelockedGovernanceCallCanceled` { #ev_timelockedgovernancecallcanceled } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallCanceled( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is canceled before execution. - -
-
- -
- -### `TimelockedGovernanceCallExecuted` { #ev_timelockedgovernancecallexecuted } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -event TimelockedGovernanceCallExecuted( - bytes4 selector, - uint256 timestamp -) -``` - -Emitted when a timelocked [`governance`](#fn_governance_5aa6e675) call is executed. - -
-
- -
- -### `Transfer` { #ev_transfer } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -event Transfer( - address from, - address to, - uint256 value -) -``` - -Emitted when `value` tokens are moved from one account (`from`) to -another (`to`). - -Note that `value` may be zero. - -
-
- -
- -### `VotePowerContractChanged` { #ev_votepowercontractchanged } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -event VotePowerContractChanged( - uint256 _contractType, - address _oldContractAddress, - address _newContractAddress -) -``` - -Emitted when one of the vote power contracts is changed. - -It is used to track the history of [`VPToken`](./VPToken.md) -> [`VPContract`](./VPContract.md) / [`GovernanceVotePower`](./GovernanceVotePower.md) -associations (e.g. by external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_contractType` | `uint256` | 0 = Read [`VPContract`](./VPContract.md), 1 = Write [`VPContract`](./VPContract.md), 2 = Governance vote power. | -| `_oldContractAddress` | `address` | Contract address before change. | -| `_newContractAddress` | `address` | Contract address after change. | - -
-
- -
- -### `Withdrawal` { #ev_withdrawal } - -
-Defined in `WNat` ([Docs](./WNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/WNat.sol)). -
- -
- -```solidity -event Withdrawal( - address src, - uint256 amount -) -``` - -Emitted when tokens have been unwrapped. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `src` | `address` | The account that received the unwrapped tokens. | -| `amount` | `uint256` | The amount that was unwrapped. | - -
-
- -
- -
- -## Functions - -
- -### `allowance` { #fn_allowance_dd62ed3e } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function allowance( - address owner, - address spender -) external view returns ( - uint256); -``` - -Returns the remaining number of tokens that `spender` will be -allowed to spend on behalf of `owner` through [`transferFrom`](#fn_transferfrom_23b872dd). This is -zero by default. - -This value changes when [`approve`](#fn_approve_095ea7b3) or [`transferFrom`](#fn_transferfrom_23b872dd) are called. - -
-
- -
- -### `approve` { #fn_approve_095ea7b3 } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function approve( - address spender, - uint256 amount -) external returns ( - bool); -``` - -Sets `amount` as the [`allowance`](#fn_allowance_dd62ed3e) of `spender` over the caller's tokens. - -Returns a boolean value indicating whether the operation succeeded. - -IMPORTANT: Beware that changing an [`allowance`](#fn_allowance_dd62ed3e) with this method brings the risk -that someone may use both the old and the new [`allowance`](#fn_allowance_dd62ed3e) by unfortunate -transaction ordering. One possible solution to mitigate this race -condition is to first reduce the spender's [`allowance`](#fn_allowance_dd62ed3e) to 0 and set the -desired value afterwards: -https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - -Emits an [`Approval`](#ev_approval) event. - -
-
- -
- -### `balanceHistoryCleanup` { #fn_balancehistorycleanup_f0e292c9 } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function balanceHistoryCleanup( - address _owner, - uint256 _count -) external returns ( - uint256); -``` - -Delete balance checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | balance owner account address | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `balanceOf` { #fn_balanceof_70a08231 } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function balanceOf( - address account -) external view returns ( - uint256); -``` - -Returns the amount of tokens owned by `account`. - -
-
- -
- -### `balanceOfAt` { #fn_balanceofat_4ee2cd7e } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function balanceOfAt( - address _owner, - uint256 _blockNumber -) public view returns ( - uint256); -``` - -Queries the token balance of `_owner` at a specific `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address from which the balance will be retrieved. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | | -
-
- -
- -### `batchDelegate` { #fn_batchdelegate_dc4fcda7 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function batchDelegate( - address[] _delegatees, - uint256[] _bips -) external; -``` - -Undelegate all percentage delegations from the sender and then [`delegate`](#fn_delegate_026e402b) corresponding - `_bips` percentage of voting power from the sender to each member of the `_delegatees` array. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegatees` | `address[]` | The addresses of the new recipients. | -| `_bips` | `uint256[]` | The percentages of voting power to be delegated expressed in basis points (1/100 of one percent). The sum of all `_bips` values must be at most 10000 (100%). | - -
-
- -
- -### `batchVotePowerOfAt` { #fn_batchvotepowerofat_49e3c7e5 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function batchVotePowerOfAt( - address[] _owners, - uint256 _blockNumber -) external view returns ( - uint256[]); -``` - -Return the vote power for several addresses. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owners` | `address[]` | The list of addresses to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256[]` | Array of vote power for each queried address. | -
-
- -
- -### `cancelGovernanceCall` { #fn_cancelgovernancecall_67fc4029 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function cancelGovernanceCall( - bytes4 _selector -) external; -``` - -Cancel a timelocked [`governance`](#fn_governance_5aa6e675) call before it has been executed. - -Only [`governance`](#fn_governance_5aa6e675) can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector. | - -
-
- -
- -### `cleanupBlockNumber` { #fn_cleanupblocknumber_deea13e7 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function cleanupBlockNumber( -) external view returns ( - uint256); -``` - -Get the current cleanup block number set with [`setCleanupBlockNumber`](#fn_setcleanupblocknumber_13de97f5). - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The currently set cleanup block number. | -
-
- -
- -### `constructor` { #fn_constructor_undefined } - -
-Defined in `WNat` ([Docs](./WNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/WNat.sol)). -
- -
- -```solidity -constructor( - address _governance, - string _name, - string _symbol -) public; -``` - -Construct an ERC20 token. - -
-
- -
- -### `decimals` { #fn_decimals_313ce567 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function decimals( -) public view returns ( - uint8); -``` - -Returns the number of [`decimals`](#fn_decimals_313ce567) used to get its user representation. -For example, if [`decimals`](#fn_decimals_313ce567) equals 2, a balance of 505 tokens should -be displayed to a user as 5.05 (505 / 102). - -Tokens usually opt for a value of 18, imitating the relationship between -Ether and wei. This is the default value returned by this function, unless -it's overridden. - -NOTE: This information is only used for _display_ purposes: it in -no way affects any of the arithmetic of the contract, including -[`balanceOf`](#fn_balanceof_70a08231) and [`transfer`](#fn_transfer_a9059cbb). - -Should be compatible with ERC20 method. - -
-
- -
- -### `delegate` { #fn_delegate_026e402b } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function delegate( - address _to, - uint256 _bips -) external; -``` - -Delegate voting power to account `_to` from `msg.sender`, by percentage. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_bips` | `uint256` | The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: every call resets the delegation value (and a value of 0 revokes all previous delegations). | - -
-
- -
- -### `delegateExplicit` { #fn_delegateexplicit_d06dc3ad } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function delegateExplicit( - address _to, - uint256 _amount -) external; -``` - -Explicitly [`delegate`](#fn_delegate_026e402b) `_amount` voting power to account `_to` from `msg.sender`. -Compare with [`delegate`](#fn_delegate_026e402b) which delegates by percentage. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_to` | `address` | The address of the recipient. | -| `_amount` | `uint256` | An explicit vote power amount to be delegated. Not cumulative: every call resets the delegation value (and a value of 0 revokes all previous delegations). | - -
-
- -
- -### `delegatesOf` { #fn_delegatesof_7de5b8ed } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function delegatesOf( - address _owner -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the list of addresses to which `_who` is delegating, and their percentages. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Positional array of addresses being delegated to. | -| `_bips` | `uint256[]` | Positional array of delegation percents specified in basis points (1/100 of 1 percent). Each one matches the address in the same position in the `_delegateAddresses` array. | -| `_count` | `uint256` | The number of delegates. | -| `_delegationMode` | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `delegatesOfAt` { #fn_delegatesofat_ed475a79 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function delegatesOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - address[] _delegateAddresses, - uint256[] _bips, - uint256 _count, - uint256 _delegationMode); -``` - -Get the list of addresses to which `_who` is delegating, and their percentages, at the given block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Positional array of addresses being delegated to. | -| `_bips` | `uint256[]` | Positional array of delegation percents specified in basis points (1/100 of 1 percent). Each one matches the address in the same position in the `_delegateAddresses` array. | -| `_count` | `uint256` | The number of delegates. | -| `_delegationMode` | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `delegationModeOf` { #fn_delegationmodeof_f6837767 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function delegationModeOf( - address _who -) external view returns ( - uint256); -``` - -Get the delegation mode for account '_who'. This mode determines whether vote power is -allocated by percentage or by explicit amount. Once the delegation mode is set, -it can never be changed, even if all delegations are removed. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | The address to get delegation mode. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Delegation mode: 0 = NOT SET, 1 = PERCENTAGE, 2 = AMOUNT (i.e. explicit). | -
-
- -
- -### `deposit` { #fn_deposit_d0e30db0 } - -
-Defined in `WNat` ([Docs](./WNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/WNat.sol)). -
- -
- -```solidity -function deposit( -) public payable; -``` - -Deposits native tokens and mints the same amount of `WNAT` tokens, -which are added to the `msg.sender`'s balance. -This operation is commonly known as "wrapping". - -Emits a [`Deposit`](#ev_deposit) event. - -
-
- -
- -### `depositTo` { #fn_depositto_b760faf9 } - -
-Defined in `WNat` ([Docs](./WNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/WNat.sol)). -
- -
- -```solidity -function depositTo( - address _recipient -) external payable; -``` - -Deposits native tokens and mints the same amount of `WNAT` tokens, -which are added to `_recipient`'s balance. -This operation is commonly known as "wrapping". - -This is equivalent to using [`deposit`](#fn_deposit_d0e30db0) followed by [`transfer`](#fn_transfer_a9059cbb). - -Emits a [`Deposit`](#ev_deposit) event. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_recipient` | `address` | The address to receive the minted `WNAT`. | - -
-
- -
- -### `executeGovernanceCall` { #fn_executegovernancecall_5ff27079 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function executeGovernanceCall( - bytes4 _selector -) external; -``` - -Execute the timelocked [`governance`](#fn_governance_5aa6e675) calls once the timelock period expires. - -Only executor can call this method. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_selector` | `bytes4` | The method selector (only one timelocked call per method is stored). | - -
-
- -
- -### `governance` { #fn_governance_5aa6e675 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function governance( -) public view returns ( - address); -``` - -Returns the current effective [`governance`](#fn_governance_5aa6e675) address. - -
-
- -
- -### `governanceVotePower` { #fn_governancevotepower_8c2b8ae1 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function governanceVotePower( -) external view returns ( - contract IGovernanceVotePower); -``` - -When set, allows token owners to participate in [`governance`](#fn_governance_5aa6e675) voting -and [`delegate`](#fn_delegate_026e402b) [`governance`](#fn_governance_5aa6e675) vote power. - -
-
- -
- -### `name` { #fn_name_06fdde03 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function name( -) public view returns ( - string); -``` - -Returns the [`name`](#fn_name_06fdde03) of the token. - -Should be compatible with ERC20 method. - -
-
- -
- -### `readVotePowerContract` { #fn_readvotepowercontract_9b3baa0e } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function readVotePowerContract( -) external view returns ( - contract IVPContractEvents); -``` - -Returns [`VPContract`](./VPContract.md) event interface used for read-only operations (view methods). -The only non-view method that might be called on it is [`revokeDelegationAt`](#fn_revokedelegationat_bbd6fbf8). - -[`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e) is almost always equal to [`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) -except during an upgrade from one [`VPContract`](./VPContract.md) to a new version (which should happen -rarely or never and will be announced beforehand). - -Do not call any methods on [`VPContract`](./VPContract.md) directly. -State changing methods are forbidden from direct calls. -All methods are exposed via [`VPToken`](./VPToken.md). -This is the reason that this method returns [`IVPContractEvents`](./IVPContractEvents.md). -Use it only for listening to events and revoking. - -
-
- -
- -### `receive` { #fn_receive_undefined } - -
-Defined in `WNat` ([Docs](./WNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/WNat.sol)). -
- -
- -```solidity -receive( -) external payable; -``` - -A proxy for the [`deposit`](#fn_deposit_d0e30db0) method. - -
-
- -
- -### `revokeDelegationAt` { #fn_revokedelegationat_bbd6fbf8 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function revokeDelegationAt( - address _who, - uint256 _blockNumber -) public; -``` - -Revoke all delegation from sender to `_who` at given block. -Only affects the reads via [`votePowerOfAtCached`](#fn_votepowerofatcached_e587497e) in the block `_blockNumber`. -Block `_blockNumber` must be in the past. -This method should be used only to prevent rogue [`delegate`](#fn_delegate_026e402b) voting in the current voting block. -To stop delegating use [`delegate`](#fn_delegate_026e402b) / [`delegateExplicit`](#fn_delegateexplicit_d06dc3ad) with value of 0 or [`undelegateAll`](#fn_undelegateall_b302f393) / [`undelegateAllExplicit`](#fn_undelegateallexplicit_5d6d11eb). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_who` | `address` | Address of the delegatee. | -| `_blockNumber` | `uint256` | The block number at which to revoke delegation.. | - -
-
- -
- -### `setCleanerContract` { #fn_setcleanercontract_f6a494af } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setCleanerContract( - address _cleanerContract -) external; -``` - -Set the contract that is allowed to call history cleaning methods. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_cleanerContract` | `address` | Address of the cleanup contract. Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). | - -
-
- -
- -### `setCleanupBlockNumber` { #fn_setcleanupblocknumber_13de97f5 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setCleanupBlockNumber( - uint256 _blockNumber -) external; -``` - -Set the cleanup block number. -Historic data for the blocks before [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7) can be erased. -History before that block should never be used since it can be inconsistent. -In particular, cleanup block number must be lower than the current vote power block. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The new cleanup block number. | - -
-
- -
- -### `setCleanupBlockNumberManager` { #fn_setcleanupblocknumbermanager_7f4fcaa9 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setCleanupBlockNumberManager( - address _cleanupBlockNumberManager -) external; -``` - -Set the contract that is allowed to set [`cleanupBlockNumber`](#fn_cleanupblocknumber_deea13e7). -Usually this will be an instance of [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md). - -
-
- -
- -### `setGovernanceVotePower` { #fn_setgovernancevotepower_9ca2231a } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setGovernanceVotePower( - contract IIGovernanceVotePower _governanceVotePower -) external; -``` - -Sets new [`governance`](#fn_governance_5aa6e675) vote power contract that allows token owners to participate in [`governance`](#fn_governance_5aa6e675) voting -and [`delegate`](#fn_delegate_026e402b) [`governance`](#fn_governance_5aa6e675) vote power. - -
-
- -
- -### `setReadVpContract` { #fn_setreadvpcontract_31d12a16 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setReadVpContract( - contract IIVPContract _vpContract -) external; -``` - -Call from [`governance`](#fn_governance_5aa6e675) to set read VpContract on token, e.g. -vpToken.[`setReadVpContract`](#fn_setreadvpcontract_31d12a16)(new [`VPContract`](./VPContract.md)(vpToken)). - -Read [`VPContract`](./VPContract.md) must be set before any of the [`VPToken`](./VPToken.md) delegation or vote power reading methods are called, -otherwise they will revert. - -**NOTE**: If `readVpContract` differs from `writeVpContract` all reads will be "frozen" and will not reflect -changes (not even revokes; they may or may not reflect balance transfers). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_vpContract` | `contract IIVPContract` | Read vote power contract to be used by this token. | - -
-
- -
- -### `setWriteVpContract` { #fn_setwritevpcontract_755d10a4 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function setWriteVpContract( - contract IIVPContract _vpContract -) external; -``` - -Call from [`governance`](#fn_governance_5aa6e675) to set write VpContract on token, e.g. -vpToken.[`setWriteVpContract`](#fn_setwritevpcontract_755d10a4)(new [`VPContract`](./VPContract.md)(vpToken)). - -Write [`VPContract`](./VPContract.md) must be set before any of the [`VPToken`](./VPToken.md) delegation modifying methods are called, -otherwise they will revert. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_vpContract` | `contract IIVPContract` | Write vote power contract to be used by this token. | - -
-
- -
- -### `switchToProductionMode` { #fn_switchtoproductionmode_f5a98383 } - -
-Defined in `GovernedBase` ([Docs](./GovernedBase.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/governance/implementation/GovernedBase.sol)). -
- -
- -```solidity -function switchToProductionMode( -) external; -``` - -Enter the production mode after all the initial [`governance`](#fn_governance_5aa6e675) settings have been set. -This enables timelocks and the [`governance`](#fn_governance_5aa6e675) can be obtained afterward by calling -[`governanceSettings`](#va_governancesettings).getGovernanceAddress(). -Emits [`GovernedProductionModeEntered`](#ev_governedproductionmodeentered). - -
-
- -
- -### `symbol` { #fn_symbol_95d89b41 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function symbol( -) public view returns ( - string); -``` - -Returns the [`symbol`](#fn_symbol_95d89b41) of the token, usually a shorter version of the [`name`](#fn_name_06fdde03). - -Should be compatible with ERC20 method. - -
-
- -
- -### `totalSupply` { #fn_totalsupply_18160ddd } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function totalSupply( -) external view returns ( - uint256); -``` - -Returns the amount of tokens in existence. - -
-
- -
- -### `totalSupplyAt` { #fn_totalsupplyat_981b24d0 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function totalSupplyAt( - uint256 _blockNumber -) public view returns ( - uint256); -``` - -Total amount of tokens at a specific `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number when the _totalSupply is queried | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | | -
-
- -
- -### `totalSupplyCacheCleanup` { #fn_totalsupplycachecleanup_43ea370b } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function totalSupplyCacheCleanup( - uint256 _blockNumber -) external returns ( - uint256); -``` - -Delete total supply cache entry that expired (i.e. is before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | the block number for which total supply value was cached | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of cache entries deleted (always 0 or 1) | -
-
- -
- -### `totalSupplyHistoryCleanup` { #fn_totalsupplyhistorycleanup_f62f8f3a } - -
-Defined in `CheckPointable` ([Docs](./CheckPointable.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/CheckPointable.sol)). -
- -
- -```solidity -function totalSupplyHistoryCleanup( - uint256 _count -) external returns ( - uint256); -``` - -Delete total supply checkpoints that expired (i.e. are before `cleanupBlockNumber`). -Method can only be called from the [`cleanerContract`](#va_cleanercontract) (which may be a proxy to external cleaners). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_count` | `uint256` | maximum number of checkpoints to delete | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | the number of checkpoints deleted | -
-
- -
- -### `totalVotePower` { #fn_totalvotepower_f5f3d4f7 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function totalVotePower( -) external view returns ( - uint256); -``` - -Get the current total vote power. - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The current total vote power (sum of all accounts' vote power). | -
-
- -
- -### `totalVotePowerAt` { #fn_totalvotepowerat_3e5aa26a } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function totalVotePowerAt( - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the queried block (sum of all accounts' vote powers). | -
-
- -
- -### `totalVotePowerAtCached` { #fn_totalvotepoweratcached_caeb942b } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function totalVotePowerAtCached( - uint256 _blockNumber -) public returns ( - uint256); -``` - -Get the total vote power at block `_blockNumber` using cache. - It tries to read the cached value and if it is not found, reads the actual value and stores it in the cache. - Can only be used if `_blockNumber` is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The total vote power at the queried block (sum of all accounts' vote powers). | -
-
- -
- -### `transfer` { #fn_transfer_a9059cbb } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function transfer( - address recipient, - uint256 amount -) external returns ( - bool); -``` - -Moves `amount` tokens from the caller's account to `recipient`. - -Returns a boolean value indicating whether the operation succeeded. - -Emits a [`Transfer`](#ev_transfer) event. - -
-
- -
- -### `transferFrom` { #fn_transferfrom_23b872dd } - -
-Defined in `IERC20` ([Source](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/release-v3.4/contracts/token/ERC20/IERC20.sol)). -
- -
- -```solidity -function transferFrom( - address sender, - address recipient, - uint256 amount -) external returns ( - bool); -``` - -Moves `amount` tokens from `sender` to `recipient` using the -[`allowance`](#fn_allowance_dd62ed3e) mechanism. `amount` is then deducted from the caller's -[`allowance`](#fn_allowance_dd62ed3e). - -Returns a boolean value indicating whether the operation succeeded. - -Emits a [`Transfer`](#ev_transfer) event. - -
-
- -
- -### `undelegateAll` { #fn_undelegateall_b302f393 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function undelegateAll( -) external; -``` - -Undelegate all voting power of `msg.sender`. This effectively revokes all previous delegations. -Can only be used with percentage delegation. -Does not reset delegation mode back to NOT SET. - -
-
- -
- -### `undelegateAllExplicit` { #fn_undelegateallexplicit_5d6d11eb } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function undelegateAllExplicit( - address[] _delegateAddresses -) external returns ( - uint256 _remainingDelegation); -``` - -Undelegate all explicit vote power by amount of `msg.sender`. -Can only be used with explicit delegation. -Does not reset delegation mode back to NOT SET. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_delegateAddresses` | `address[]` | Explicit delegation does not store delegatees' addresses, so the caller must supply them. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| `_remainingDelegation` | `uint256` | The amount still delegated (in case the list of delegates was incomplete). | -
-
- -
- -### `undelegatedVotePowerOf` { #fn_undelegatedvotepowerof_d6aa0b77 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function undelegatedVotePowerOf( - address _owner -) external view returns ( - uint256); -``` - -Compute the current undelegated vote power of the `_owner` account. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`. | -
-
- -
- -### `undelegatedVotePowerOfAt` { #fn_undelegatedvotepowerofat_83035a82 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function undelegatedVotePowerOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the undelegated vote power of the `_owner` account at a given block number. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The unallocated vote power of `_owner`. | -
-
- -
- -### `votePowerFromTo` { #fn_votepowerfromto_be0ca747 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerFromTo( - address _from, - address _to -) external view returns ( - uint256); -``` - -Get current delegated vote power from delegator `_from` to delegatee `_to`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of delegator. | -| `_to` | `address` | Address of delegatee. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | votePower The delegated vote power. | -
-
- -
- -### `votePowerFromToAt` { #fn_votepowerfromtoat_e64767aa } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerFromToAt( - address _from, - address _to, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get delegated vote power from delegator `_from` to delegatee `_to` at `_blockNumber`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_from` | `address` | Address of delegator. | -| `_to` | `address` | Address of delegatee. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | The delegated vote power. | -
-
- -
- -### `votePowerOf` { #fn_votepowerof_142d1018 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerOf( - address _owner -) external view returns ( - uint256); -``` - -Get the current vote power of `_owner`. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Current vote power of `_owner`. | -
-
- -
- -### `votePowerOfAt` { #fn_votepowerofat_92bfe6d8 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerOfAt( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at block number `_blockNumber`. | -
-
- -
- -### `votePowerOfAtCached` { #fn_votepowerofatcached_e587497e } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerOfAtCached( - address _owner, - uint256 _blockNumber -) public returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber` using cache. - It tries to read the cached value and if it is not found, reads the actual value and stores it in the cache. - Can only be used if `_blockNumber` is in the past, otherwise reverts. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at `_blockNumber`. | -
-
- -
- -### `votePowerOfAtIgnoringRevocation` { #fn_votepowerofatignoringrevocation_04bb4e43 } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function votePowerOfAtIgnoringRevocation( - address _owner, - uint256 _blockNumber -) external view returns ( - uint256); -``` - -Get the vote power of `_owner` at block `_blockNumber`, ignoring revocation information (and cache). - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address to query. | -| `_blockNumber` | `uint256` | The block number to query. | - -| Returns | Type | Description | -| ------- | ---- | ----------- | -| [0] | `uint256` | Vote power of `_owner` at block number `_blockNumber`. Result doesn't change if vote power is revoked. | -
-
- -
- -### `withdraw` { #fn_withdraw_2e1a7d4d } - -
-Defined in `WNat` ([Docs](./WNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/WNat.sol)). -
- -
- -```solidity -function withdraw( - uint256 _amount -) external; -``` - -Burns `_amount` of `WNAT` tokens from `msg.sender`'s `WNAT` balance and -transfers the same amount of native tokens to `msg.sender`. -This operation is commonly known as "unwrapping". - -Reverts if `_amount` is higher than `msg.sender`'s `WNAT` balance. - -Emits a [`Withdrawal`](#ev_withdrawal) event. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_amount` | `uint256` | The amount to withdraw. | - -
-
- -
- -### `withdrawFrom` { #fn_withdrawfrom_9470b0bd } - -
-Defined in `WNat` ([Docs](./WNat.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/WNat.sol)). -
- -
- -```solidity -function withdrawFrom( - address _owner, - uint256 _amount -) external; -``` - -Burns `_amount` of `WNAT` tokens from `_owner`'s `WNAT` balance and -transfers the same amount of native tokens to `msg.sender`. -This operation is commonly known as "unwrapping". - -`msg.sender` must have been authorized to [`withdraw`](#fn_withdraw_2e1a7d4d) from `_owner`'s account -through ERC-20's [`approve`](#fn_approve_095ea7b3) mechanism. - -Reverts if `_amount` is higher than `_owners`'s `WNAT` balance or than -`msg.sender`'s [`allowance`](#fn_allowance_dd62ed3e) over `_owner`'s tokens. - -Emits a [`Withdrawal`](#ev_withdrawal) event. - -| Parameters | Type | Description | -| ---------- | ---- | ----------- | -| `_owner` | `address` | The address containing the tokens to withdraw. | -| `_amount` | `uint256` | The amount to withdraw. | - -
-
- -
- -### `writeVotePowerContract` { #fn_writevotepowercontract_1fec092a } - -
-Defined in `VPToken` ([Docs](./VPToken.md), [Source](https://gitlab.com/flarenetwork/flare-smart-contracts/-/tree/master/contracts/token/implementation/VPToken.sol)). -
- -
- -```solidity -function writeVotePowerContract( -) external view returns ( - contract IVPContractEvents); -``` - -Returns [`VPContract`](./VPContract.md) event interface used for state-changing operations (non-view methods). -The only non-view method that might be called on it is [`revokeDelegationAt`](#fn_revokedelegationat_bbd6fbf8). - -[`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) is almost always equal to [`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e), -except during upgrade from one [`VPContract`](./VPContract.md) to a new version (which should happen -rarely or never and will be announced beforehand). -In the case of an upgrade, [`writeVotePowerContract`](#fn_writevotepowercontract_1fec092a) is replaced first to establish delegations. -After some period (e.g., after a reward epoch ends), [`readVotePowerContract`](#fn_readvotepowercontract_9b3baa0e) is set equal to it. - -Do not call any methods on [`VPContract`](./VPContract.md) directly. -State changing methods are forbidden from direct calls. -All are exposed via [`VPToken`](./VPToken.md). -This is the reason that this method returns [`IVPContractEvents`](./IVPContractEvents.md) -Use it only for listening to events, delegating, and revoking. - -
-
- -
- diff --git a/docs/apis/smart-contracts/index.md b/docs/apis/smart-contracts/index.md deleted file mode 100644 index 4e28363f9..000000000 --- a/docs/apis/smart-contracts/index.md +++ /dev/null @@ -1,101 +0,0 @@ -# Smart Contracts API - - - -List of Flare smart contracts. - -## Contracts - -| Name | Description | -| ---- | ----------- | -| [`AddressUpdatable`](./AddressUpdatable.md) | Abstract base class for contracts that depend on other contracts whose addresses can change. | -| [`AddressUpdater`](./AddressUpdater.md) | Keeps track of the current address for all unique and special platform contracts. | -| [`AddressValidityVerification`](./AddressValidityVerification.md) | Contract for verifying [`AddressValidity`](../attestation-types/AddressValidity.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`BalanceDecreasingTransactionVerification`](./BalanceDecreasingTransactionVerification.md) | Contract for verifying [`BalanceDecreasingTransaction`](../attestation-types/BalanceDecreasingTransaction.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`CheckPointable`](./CheckPointable.md) | Check-Pointable ERC20 Behavior. | -| [`ClaimSetupManager`](./ClaimSetupManager.md) | Manages automation of operations related to reward claiming. | -| [`CleanupBlockNumberManager`](./CleanupBlockNumberManager.md) | Token history cleanup manager. | -| [`CloneFactory`](./CloneFactory.md) | Simple clone contract factory. | -| [`ConfirmedBlockHeightExistsVerification`](./ConfirmedBlockHeightExistsVerification.md) | Contract for verifying [`ConfirmedBlockHeightExists`](../attestation-types/ConfirmedBlockHeightExists.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`Delegatable`](./Delegatable.md) | [`Delegatable`](./Delegatable.md) ERC20 behavior. | -| [`EVMTransactionVerification`](./EVMTransactionVerification.md) | Contract for verifying [`EVMTransaction`](../attestation-types/EVMTransaction.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`FlareContractRegistry`](./FlareContractRegistry.md) | The Flare contract registry. | -| [`FlareDaemon`](./FlareDaemon.md) | Flare Daemon contract. | -| [`Ftso`](./Ftso.md) | [Flare Time Series Oracle](https://docs.flare.network/tech/ftso) contract. | -| [`FtsoManager`](./FtsoManager.md) | FTSO Manager contract. | -| [`FtsoRegistry`](./FtsoRegistry.md) | Handles registration of assets to the [FTSO system](https://docs.flare.network/tech/ftso). | -| [`FtsoRewardManager`](./FtsoRewardManager.md) | Handles reward distribution and claiming related to the FTSO system. | -| [`GovernanceSettings`](./GovernanceSettings.md) | A special contract that holds the Flare governance address and its timelock. | -| [`GovernanceVotePower`](./GovernanceVotePower.md) | Contract managing governance vote power and its delegation. | -| [`Governed`](./Governed.md) | Defines behaviors for governed contracts that must have a governor set at construction-time. | -| [`GovernedAndFlareDaemonized`](./GovernedAndFlareDaemonized.md) | Base class for contracts that are governed and triggered from the [`FlareDaemon`](./FlareDaemon.md). | -| [`GovernedAtGenesis`](./GovernedAtGenesis.md) | Defines behaviors for governed contracts that have their governor set at genesis. | -| [`GovernedBase`](./GovernedBase.md) | Abstract base class that defines behaviors for governed contracts. | -| [`Inflation`](./Inflation.md) | Recognizes, authorizes, mints, and funds native tokens to Flare services that are rewardable through inflation. | -| [`PaymentVerification`](./PaymentVerification.md) | Contract for verifying [`Payment`](../attestation-types/Payment.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`PChainStake`](./PChainStake.md) | Helper contract handling all the vote power and balance functionality for the [`PChainStakeMirror`](./PChainStakeMirror.md). | -| [`PChainStakeMirror`](./PChainStakeMirror.md) | Contract used to mirror all stake amounts from P-chain. | -| [`PriceSubmitter`](./PriceSubmitter.md) | Receives prices from [FTSO data providers](https://docs.flare.network/tech/ftso). | -| [`ReferencedPaymentNonexistenceVerification`](./ReferencedPaymentNonexistenceVerification.md) | Contract for verifying [`ReferencedPaymentNonexistence`](../attestation-types/ReferencedPaymentNonexistence.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`RevertErrorTracking`](./RevertErrorTracking.md) | Revert error tracking contract. | -| [`VoterWhitelister`](./VoterWhitelister.md) | Manager of the [FTSO whitelist](https://docs.flare.network/infra/data/whitelisting/). | -| [`VPContract`](./VPContract.md) | Helper contract handling all the vote power and delegation functionality for an associated [`VPToken`](./VPToken.md). | -| [`VPToken`](./VPToken.md) | Vote power token. | -| [`WNat`](./WNat.md) | Wrapped native token. | - -## Interfaces - -| Name | Description | -| ---- | ----------- | -| [`IAddressValidityVerification`](./IAddressValidityVerification.md) | Interface for verifying [`AddressValidity`](../attestation-types/AddressValidity.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`IBalanceDecreasingTransactionVerification`](./IBalanceDecreasingTransactionVerification.md) | Interface for verifying [`BalanceDecreasingTransaction`](../attestation-types/BalanceDecreasingTransaction.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`IClaimSetupManager`](./IClaimSetupManager.md) | Public interface for the [`ClaimSetupManager`](./ClaimSetupManager.md) contract. | -| [`IConfirmedBlockHeightExistsVerification`](./IConfirmedBlockHeightExistsVerification.md) | Interface for verifying [`ConfirmedBlockHeightExists`](../attestation-types/ConfirmedBlockHeightExists.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`IEVMTransactionVerification`](./IEVMTransactionVerification.md) | Interface for verifying [`EVMTransaction`](../attestation-types/EVMTransaction.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`IFlareContractRegistry`](./IFlareContractRegistry.md) | Interface for the [`FlareContractRegistry`](./FlareContractRegistry.md). | -| [`IFlareDaemonize`](./IFlareDaemonize.md) | Interface for contracts that receive triggers from the [`FlareDaemon`](./FlareDaemon.md) contract. | -| [`IFtso`](./IFtso.md) | Interface for each of the FTSO contracts that handles an asset. | -| [`IFtsoGenesis`](./IFtsoGenesis.md) | Portion of the [`IFtso`](./IFtso.md) interface that is available to contracts deployed at genesis. | -| [`IFtsoManager`](./IFtsoManager.md) | Interface for the [`FtsoManager`](./FtsoManager.md) contract. | -| [`IFtsoManagerGenesis`](./IFtsoManagerGenesis.md) | Portion of the [`IFtsoManager`](./IFtsoManager.md) interface that is available to contracts deployed at genesis. | -| [`IFtsoRegistry`](./IFtsoRegistry.md) | Interface for the [`FtsoRegistry`](./FtsoRegistry.md) contract. | -| [`IFtsoRegistryGenesis`](./IFtsoRegistryGenesis.md) | Portion of the [`IFtsoRegistry`](./IFtsoRegistry.md) interface that is available to contracts deployed at genesis. | -| [`IFtsoRewardManager`](./IFtsoRewardManager.md) | Interface for the [`FtsoRewardManager`](./FtsoRewardManager.md) contract. | -| [`IGovernanceSettings`](./IGovernanceSettings.md) | Interface for the [`GovernanceSettings`](./GovernanceSettings.md) that hold the Flare governance address and its timelock. | -| [`IGovernanceVotePower`](./IGovernanceVotePower.md) | Interface for contracts delegating their governance vote power. | -| [`IInflationGenesis`](./IInflationGenesis.md) | Portion of the [`Inflation`](./Inflation.md) contract that is available to contracts deployed at genesis. | -| [`IMerkleRootStorage`](./IMerkleRootStorage.md) | Interface for accessing [State Connector](https://docs.flare.network/tech/state-connector) Merkle roots. | -| [`IPaymentVerification`](./IPaymentVerification.md) | Interface for verifying [`Payment`](../attestation-types/Payment.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`IPChainStakeMirror`](./IPChainStakeMirror.md) | Interface for the [`PChainStakeMirror`](./PChainStakeMirror.md) contract. | -| [`IPChainVotePower`](./IPChainVotePower.md) | Interface for the vote power part of the [`PChainStakeMirror`](./PChainStakeMirror.md) contract. | -| [`IPriceSubmitter`](./IPriceSubmitter.md) | Interface for the [`PriceSubmitter`](./PriceSubmitter.md) contract. | -| [`IReferencedPaymentNonexistenceVerification`](./IReferencedPaymentNonexistenceVerification.md) | Interface for verifying [`ReferencedPaymentNonexistence`](../attestation-types/ReferencedPaymentNonexistence.md) attestations within the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`IStateConnector`](./IStateConnector.md) | Interface for interacting with the [State Connector](https://docs.flare.network/tech/state-connector/). | -| [`IVoterWhitelister`](./IVoterWhitelister.md) | Interface for managers of the [FTSO whitelist](https://docs.flare.network/infra/data/whitelisting/). | -| [`IVPContractEvents`](./IVPContractEvents.md) | Events interface for vote-power related operations. | -| [`IVPToken`](./IVPToken.md) | Vote power token interface. | -| [`IWNat`](./IWNat.md) | Wrapped native token interface. | - -## Internal Interfaces - -For platform development, not application. - -| Name | Description | -| ---- | ----------- | -| [`IIAddressUpdatable`](./IIAddressUpdatable.md) | Internal interface for contracts that depend on other contracts whose addresses can change. | -| [`IIAddressUpdater`](./IIAddressUpdater.md) | Internal interface for [`AddressUpdater`](./AddressUpdater.md). | -| [`IIClaimSetupManager`](./IIClaimSetupManager.md) | Internal interface for the [`ClaimSetupManager`](./ClaimSetupManager.md) contract. | -| [`IICleanable`](./IICleanable.md) | Internal interface for entities that can have their block history cleaned. | -| [`IIFtso`](./IIFtso.md) | Internal interface for each of the FTSO contracts that handles an asset. | -| [`IIFtsoManager`](./IIFtsoManager.md) | Internal interface for the [`FtsoManager`](./FtsoManager.md) contract. | -| [`IIFtsoRegistry`](./IIFtsoRegistry.md) | Internal interface for the [`FtsoRegistry`](./FtsoRegistry.md) contract. | -| [`IIFtsoRewardManager`](./IIFtsoRewardManager.md) | Internal interface for the [`FtsoRewardManager`](./FtsoRewardManager.md). | -| [`IIGovernanceVotePower`](./IIGovernanceVotePower.md) | Internal interface for contracts delegating their governance vote power. | -| [`IIInflationReceiver`](./IIInflationReceiver.md) | Internal interface for contracts that can receive inflation. | -| [`IIPriceSubmitter`](./IIPriceSubmitter.md) | Internal interface for the [`PriceSubmitter`](./PriceSubmitter.md) contract. | -| [`IITokenPool`](./IITokenPool.md) | Internal interface for token pools. | -| [`IIVoterWhitelister`](./IIVoterWhitelister.md) | Internal interface for managers of the [FTSO whitelist](https://docs.flare.network/infra/data/whitelisting/). | -| [`IIVPContract`](./IIVPContract.md) | Internal interface for helper contracts handling functionality for an associated [`VPToken`](./VPToken.md). | -| [`IIVPToken`](./IIVPToken.md) | Vote power token internal interface. | - - diff --git a/docs/assets/reports/Coinspect - Flare - Security Review - Voter Registry Fix - v240603.pdf b/docs/assets/reports/Coinspect - Flare - Security Review - Voter Registry Fix - v240603.pdf deleted file mode 100644 index 6005099bf..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Security Review - Voter Registry Fix - v240603.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Smart Contract Audit - HexWrappedTokens - v231211.pdf b/docs/assets/reports/Coinspect - Flare - Smart Contract Audit - HexWrappedTokens - v231211.pdf deleted file mode 100644 index eaa0382d1..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Smart Contract Audit - HexWrappedTokens - v231211.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Smart Contract Review - FAsset Liquidator - v231207.pdf b/docs/assets/reports/Coinspect - Flare - Smart Contract Review - FAsset Liquidator - v231207.pdf deleted file mode 100644 index 86ed00643..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Smart Contract Review - FAsset Liquidator - v231207.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Smart Contract Review - FAsset V2 - v240220.pdf b/docs/assets/reports/Coinspect - Flare - Smart Contract Review - FAsset V2 - v240220.pdf deleted file mode 100644 index c14655f19..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Smart Contract Review - FAsset V2 - v240220.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Smart Contract Review - StakingP2 - v240220.pdf b/docs/assets/reports/Coinspect - Flare - Smart Contract Review - StakingP2 - v240220.pdf deleted file mode 100644 index 055b58c9a..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Smart Contract Review - StakingP2 - v240220.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Source Code Review - Attestation Client - v240220.pdf b/docs/assets/reports/Coinspect - Flare - Source Code Review - Attestation Client - v240220.pdf deleted file mode 100644 index f2ed70ed8..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Source Code Review - Attestation Client - v240220.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Source Code Review - FAsset Bots - v240220.pdf b/docs/assets/reports/Coinspect - Flare - Source Code Review - FAsset Bots - v240220.pdf deleted file mode 100644 index 6c3e9b45e..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Source Code Review - FAsset Bots - v240220.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Source Code Review - Multichain Client Library - v240220.pdf b/docs/assets/reports/Coinspect - Flare - Source Code Review - Multichain Client Library - v240220.pdf deleted file mode 100644 index 3c44cc7a9..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Source Code Review - Multichain Client Library - v240220.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Source Code Review - Staking P2 Offchain Services - v240220.pdf b/docs/assets/reports/Coinspect - Flare - Source Code Review - Staking P2 Offchain Services - v240220.pdf deleted file mode 100644 index 9d7f2aa56..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Source Code Review - Staking P2 Offchain Services - v240220.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - CChain Indexer - v240409.pdf b/docs/assets/reports/Coinspect - Flare - Source Code Security Review - CChain Indexer - v240409.pdf deleted file mode 100644 index 77f511e36..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - CChain Indexer - v240409.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - FTSO Scaling - v240515.pdf b/docs/assets/reports/Coinspect - Flare - Source Code Security Review - FTSO Scaling - v240515.pdf deleted file mode 100644 index 05c8dea61..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - FTSO Scaling - v240515.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - FastUpdates - v240612.pdf b/docs/assets/reports/Coinspect - Flare - Source Code Security Review - FastUpdates - v240612.pdf deleted file mode 100644 index 72475261b..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - FastUpdates - v240612.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - Smart Contracts V2 - v240515.pdf b/docs/assets/reports/Coinspect - Flare - Source Code Security Review - Smart Contracts V2 - v240515.pdf deleted file mode 100644 index ceaa5c290..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - Smart Contracts V2 - v240515.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - Top Level Client - v240515.pdf b/docs/assets/reports/Coinspect - Flare - Source Code Security Review - Top Level Client - v240515.pdf deleted file mode 100644 index 472fc1e13..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - Top Level Client - v240515.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - Transaction Verifier - v240516.pdf b/docs/assets/reports/Coinspect - Flare - Source Code Security Review - Transaction Verifier - v240516.pdf deleted file mode 100644 index aa6b82fd8..000000000 Binary files a/docs/assets/reports/Coinspect - Flare - Source Code Security Review - Transaction Verifier - v240516.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Flare Contracts Audit v210809.pdf b/docs/assets/reports/Coinspect - Flare Contracts Audit v210809.pdf deleted file mode 100644 index eab061dcd..000000000 Binary files a/docs/assets/reports/Coinspect - Flare Contracts Audit v210809.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Smart Contract Audit - Flare Airdrop Update - v221109.pdf b/docs/assets/reports/Coinspect - Smart Contract Audit - Flare Airdrop Update - v221109.pdf deleted file mode 100644 index d19f47feb..000000000 Binary files a/docs/assets/reports/Coinspect - Smart Contract Audit - Flare Airdrop Update - v221109.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Smart Contract Audit - Flare Hybrid Band Reward v230220.pdf b/docs/assets/reports/Coinspect - Smart Contract Audit - Flare Hybrid Band Reward v230220.pdf deleted file mode 100644 index b4e6e6f4b..000000000 Binary files a/docs/assets/reports/Coinspect - Smart Contract Audit - Flare Hybrid Band Reward v230220.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Smart Contract Audit - Flare March 2022.pdf b/docs/assets/reports/Coinspect - Smart Contract Audit - Flare March 2022.pdf deleted file mode 100644 index a56fd3911..000000000 Binary files a/docs/assets/reports/Coinspect - Smart Contract Audit - Flare March 2022.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Smart Contract Audit - Flare Network Launch.pdf b/docs/assets/reports/Coinspect - Smart Contract Audit - Flare Network Launch.pdf deleted file mode 100644 index 0c0345cf9..000000000 Binary files a/docs/assets/reports/Coinspect - Smart Contract Audit - Flare Network Launch.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Smart Contract Audit - Flare TDE Updates - v221220.pdf b/docs/assets/reports/Coinspect - Smart Contract Audit - Flare TDE Updates - v221220.pdf deleted file mode 100644 index 3ca833b98..000000000 Binary files a/docs/assets/reports/Coinspect - Smart Contract Audit - Flare TDE Updates - v221220.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect - Smart Contract Review - Flare Attestation Suite - v240220.pdf b/docs/assets/reports/Coinspect - Smart Contract Review - Flare Attestation Suite - v240220.pdf deleted file mode 100644 index d925c8ec3..000000000 Binary files a/docs/assets/reports/Coinspect - Smart Contract Review - Flare Attestation Suite - v240220.pdf and /dev/null differ diff --git a/docs/assets/reports/Coinspect_Smart_Contract_Audit_fAsset_v220829.pdf b/docs/assets/reports/Coinspect_Smart_Contract_Audit_fAsset_v220829.pdf deleted file mode 100644 index 3caf1240e..000000000 Binary files a/docs/assets/reports/Coinspect_Smart_Contract_Audit_fAsset_v220829.pdf and /dev/null differ diff --git a/docs/assets/reports/Flare Networks Ltd. - Dec 2022 - Secure Code Review of Solidity Smart Contracts on the Flare Network v1.0_Public.pdf b/docs/assets/reports/Flare Networks Ltd. - Dec 2022 - Secure Code Review of Solidity Smart Contracts on the Flare Network v1.0_Public.pdf deleted file mode 100644 index b3f451d73..000000000 Binary files a/docs/assets/reports/Flare Networks Ltd. - Dec 2022 - Secure Code Review of Solidity Smart Contracts on the Flare Network v1.0_Public.pdf and /dev/null differ diff --git a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Golang Validator on the Flare Network v1.0_February_Public.pdf b/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Golang Validator on the Flare Network v1.0_February_Public.pdf deleted file mode 100644 index 2fdec840c..000000000 Binary files a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Golang Validator on the Flare Network v1.0_February_Public.pdf and /dev/null differ diff --git a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Golang Validator on the Flare Network v1.0_Public.pdf b/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Golang Validator on the Flare Network v1.0_Public.pdf deleted file mode 100644 index 11173b4ff..000000000 Binary files a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Golang Validator on the Flare Network v1.0_Public.pdf and /dev/null differ diff --git a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Solidity Contracts on the Flare Network v1.0_public.pdf b/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Solidity Contracts on the Flare Network v1.0_public.pdf deleted file mode 100644 index 14b552e26..000000000 Binary files a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Solidity Contracts on the Flare Network v1.0_public.pdf and /dev/null differ diff --git a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Solidity Smart Contracts on the Flare Network v1.0_Public.pdf b/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Solidity Smart Contracts on the Flare Network v1.0_Public.pdf deleted file mode 100644 index f86bbaef8..000000000 Binary files a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of Solidity Smart Contracts on the Flare Network v1.0_Public.pdf and /dev/null differ diff --git a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of the Flare Network's Validator Codebase v1.0_Public.pdf b/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of the Flare Network's Validator Codebase v1.0_Public.pdf deleted file mode 100644 index 53b54639f..000000000 Binary files a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of the Flare Network's Validator Codebase v1.0_Public.pdf and /dev/null differ diff --git a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of the Flare Validator V2 - Report v1.0_Public.pdf b/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of the Flare Validator V2 - Report v1.0_Public.pdf deleted file mode 100644 index 8006f5420..000000000 Binary files a/docs/assets/reports/Flare Networks Ltd. - Secure Code Review of the Flare Validator V2 - Report v1.0_Public.pdf and /dev/null differ diff --git a/docs/dev/external-resources.md b/docs/dev/external-resources.md deleted file mode 100644 index efdbeb7d1..000000000 --- a/docs/dev/external-resources.md +++ /dev/null @@ -1,19 +0,0 @@ -# External Learning Resources - -Curated list of resources you can use to extend your knowledge of the Flare network. - -## Tutorials - -* [Filip Koprivec's Flare Tutorials on Medium](https://j0-0sko.medium.com/flare-blogposts-toc-8dc9d862f743) -* [Uttam Singh's Using the Flare Time Series Oracle with Foundry](https://medium.com/flarenetwork/using-the-flare-time-series-oracle-with-foundry-a726afc993c1) -* [Etherspot Prime on Flare](https://etherspot.fyi/prime-sdk/other-chains/getting-started-on-flare) - -## Videos - -* [Tim Rowley's Explainer Videos on YouTube](https://www.youtube.com/@timothyrowley/videos) -* [FTSO (Flare Time Series Oracle) | Learn how to Query Prices on Flare](https://youtu.be/tSODrEVA3BI) -* [Introduction to Etherspot's TransactionKit on Flare](https://www.youtube.com/watch?v=80Ycm-nYBwg) - -## Sample Source Code - -* [Flare's Examples Repository](https://github.com/flare-foundation/flare-demo-examples) diff --git a/docs/dev/getting-started/contract-addresses.md b/docs/dev/getting-started/contract-addresses.md deleted file mode 100644 index a390b4fd0..000000000 --- a/docs/dev/getting-started/contract-addresses.md +++ /dev/null @@ -1,113 +0,0 @@ -# Retrieving Contract Addresses - -!!! warning - - Developers should never rely on contract addresses gathered from off-chain sources like direct messages, social media, or even websites, as these addresses could easily lead to malicious contracts. - -For this reason, this documentation does not provide any contract address except for the single entry point described below. -The only secure way to retrieve contract addresses is [from the blockchain itself](#retrieval-from-blockchain). - -As a convenience, though, Flare's smart contract repository contains the latest [deployment address](#retrieval-from-source-code) for all Flare's smart contracts. -These addresses can be used to speed up development, but should not be used in production. - -To emphasize: Applications are strongly encouraged to retrieve any contract address they need directly from the blockchain and not have addresses hard-coded into the source code, except for the single entry point given in this page. - -## Retrieval from Blockchain - -All of Flare's smart contract addresses can be retrieved from the [`FlareContractRegistry`](FlareContractRegistry.md) contract. -This is the only contract address given in this documentation. - -
-| `FlareContractRegistry` | -| :--------------------------------------------------------------------------------------------: | -|
0xaD67FE66660Fb8dFE9d6b1b4240d8650e30F6019
| -
- -!!! tip "This contract is available at the same address in all Flare networks: Flare, Songbird, Coston and Coston2." - -Copy the above address into the [Block Explorer](../../user/block-explorers/index.md) to see the available contract's methods. - -You can retrieve the current address on the blockchain of any Flare smart contract from its name by using these methods, for example: - -```solidity -function getContractAddressByName( - string calldata _name -) external view returns ( - address); - - -function getContractAddressesByName( - string[] calldata _names -) external view returns ( - address[] memory); -``` - -The name search is **case-sensitive**, so you should use the proper capitalization. -For example: - -* [`WNat`](WNat.md) -* [`FtsoRewardManager`](FtsoRewardManager.md) -* [`PriceSubmitter`](PriceSubmitter.md) - -Applications can also retrieve all smart contract names and addresses at once using: - -```solidity -function getAllContracts( -) external view returns( - string[] memory _names, - address[] memory _addresses); -``` - - -
- -## Retrieval from Source Code - -The [Flare Smart Contracts repository](https://gitlab.com/flarenetwork/flare-smart-contracts) contains an autogenerated JSON file listing the latest deployed addresses of all Flare contracts on each network. - -You can find this file in the `deployment/deploys` folder, and parse it to retrieve the addresses of any Flare contract. - -!!! warning - - As stated at the beginning, applications should NOT have Flare contract addresses in their source code. - - Instead, applications are strongly encouraged to retrieve any contract address they need directly from the blockchain [as described above](#retrieval-from-blockchain). - -| | Branch | JSON file | -| -------- | -------------------------------- | ----------------------- | -| Flare | `flare_network_deployed_code` | [flare.json][f-json] | -| Songbird | `songbird_network_deployed_code` | [songbird.json][s-json] | -| Coston | `coston_network_deployed_code` | [coston.json][c-json] | -| Coston2 | `coston2_network_deployed_code` | [coston2.json][c2-json] | - -[f-json]: https://gitlab.com/flarenetwork/flare-smart-contracts/-/blob/flare_network_deployed_code/deployment/deploys/flare.json -[s-json]: https://gitlab.com/flarenetwork/flare-smart-contracts/-/blob/songbird_network_deployed_code/deployment/deploys/songbird.json -[c-json]: https://gitlab.com/flarenetwork/flare-smart-contracts/-/blob/coston_network_deployed_code/deployment/deploys/coston.json -[c2-json]: https://gitlab.com/flarenetwork/flare-smart-contracts/-/blob/coston2_network_deployed_code/deployment/deploys/coston2.json - - diff --git a/docs/dev/getting-started/index.md b/docs/dev/getting-started/index.md deleted file mode 100644 index 7abe420da..000000000 --- a/docs/dev/getting-started/index.md +++ /dev/null @@ -1,8 +0,0 @@ -# Getting Started - -The following guides provide information to quickly start developing on the Flare networks. - -## Guides - -* [Setting Up Your Environment](./setup/index.md) -* [Retrieving Contract Addresses](./contract-addresses.md) diff --git a/docs/dev/getting-started/setup/foundry.md b/docs/dev/getting-started/setup/foundry.md deleted file mode 100644 index c2f253442..000000000 --- a/docs/dev/getting-started/setup/foundry.md +++ /dev/null @@ -1,160 +0,0 @@ -# Setting Up Your Environment Using Foundry - -[Foundry](https://book.getfoundry.sh/) is a fast, portable and modular testing and deployment tool for developing EVM smart contracts. -Tests are written in Solidity to keep the workflow consistent with smart contract development and testing before deployments. -Foundry itself is written in Rust. - -This article, partially based on the [Foundry documentation](https://book.getfoundry.sh/), shows how to set up Foundry and use it to build and deploy smart contracts on Flare. - -## Guide - -### 1. Set up the Environment - -Follow the instructions for your operating system in the [Foundry's Installation guide](https://book.getfoundry.sh/getting-started/installation). - -### 2. Create a Foundry Project - -Foundry can quick-start your development by providing a sample project: - -```bash -forge init hello_foundry -cd hello_foundry -``` - -This creates a new directory `hello_foundry` from the default template which should look something like this: - -
- ![Foundry project structure](foundry1.png){ loading=lazy .allow-zoom } -
Foundry project structure.
-
- -Add the highlighted line to the `foundry.toml` file, to make sure the correct EVM version is used: - -```toml hl_lines="5" -[profile.default] -src = "src" -out = "out" -libs = ["lib"] -evm_version = "london" -``` - -### 3. Build the Contract - -To build the `Counter.sol` contract in the sample project run: - -```bash -forge build -``` - -When done, it should print `Compiler run successful`. - -You will notice that two new directories have been created, `out` and `cache`: - -
- ![Foundry project after build](foundry2.png){ loading=lazy .allow-zoom } -
Foundry project after build.
-
- -The `out` directory contains your contract artifact, such as the ABI, while the `cache` is used by forge to only recompile what is necessary. - -### 4. Test the Contract - -In the `test` folder you should find a ready-made test file that verifies the contract works as expected. - -To run tests with Foundry, you just need to run: - -```bash -forge test -``` - -When finished, it should print something similar to `Test result: ok. 2 passed; 0 failed; finished in 24.43ms`. - -!!! info - - Learn more about [Advanced Testing using Foundry](https://book.getfoundry.sh/forge/advanced-testing). - -### 5. Deploy the Contract - -Forge can deploy only one contract at a time to a given network. -To do so, you must provide the **URL of the RPC node** to access the network, and the **private key** of the account that will deploy the contract. - -The URL can be stored in an environment variable named `FOUNDRY_ETH_RPC_URL)` so you do not need to supply it every time. - -!!! warning - - Before proceeding with Deployment: - - * Make sure that you have added and selected the Coston2 test network to your Wallet. - The [Wallets section](../../../user/wallets/index.md) shows how to do it. - Use the values for Coston2 that you will find in the [Network Configurations](../../reference/network-config.md) page. - * Ensure that you have enough Coston2 native tokens `$C2FLR` to pay for gas. - Visit the [Coston2 Faucet](https://faucet.flare.network/coston2) to request some `$C2FLR`. - -The general Foundry command to deploy a contract is: - -```bash -forge create --rpc-url \ - --private-key \ - : -``` - -Since Solidity files may contain multiple contracts, the `:` parameter specifies which contract to deploy from the `` source file. -Learn more about [Deploying and Verifying Smart Contracts using Foundry](https://book.getfoundry.sh/forge/deploying). - -To deploy the sample `Counter` contract to Flare's Coston 2 Network, run: - -```bash -forge create --rpc-url https://coston2-api.flare.network/ext/bc/C/rpc \ - --private-key d8936f6eae35c73a14ea7c1aabb8d068e16889a7f516c8abc482ba4e1489f4cd \ - src/Counter.sol:Counter -``` - -Using the private key for your account. - -Execution should look similar to this: - -
- ![Foundry project deployment](foundry3.png){ loading=lazy .allow-zoom } -
Foundry project deployment.
-
- -You can check the status of the contract by copy and pasting the `Deployed to:` address into the [Coston 2 Block Explorer](https://coston2-explorer.flare.network/). - -!!! info - - Learn more about [Deploying and Verifying Smart Contracts using Foundry](https://book.getfoundry.sh/forge/deploying)! - -### 6. Verify the Contract - -Verifying smart contracts is essential for transparency and security in the blockchain ecosystem. - -Verification allows inspecting Solidity source code instead of bytecode and direct interaction with smart contracts through a block explorer. - -For the contract verification process, you need to get two values. -The first is the contract address you got in the [previous step](#5-deploy-the-contract) when you deployed the contract on the blockchain. -The second value is the chain identifier, which you can find on the [Flare Networks page](../../reference/network-config.md). - -Now replace `CONTRACT_ADDRESS` with the deployed contract address and `CHAIN_ID` with the network identifier and run this command: - -```bash -forge verify-contract CONTRACT_ADDRESS \ - --verifier-url 'https://api.routescan.io/v2/network/testnet/evm/CHAIN_ID/etherscan' \ - --etherscan-api-key "verifyContract" \ - src/Counter.sol:Counter -``` - -It will take a minute or two to verify the smart contract on the blockchain and you should get an output like this: - -```text -Start verifying contract `0x86d0D7957f0BF3Cee98A60338B19fBf91390A9bA` deployed on mainnet - -Submitting verification for [src/Counter.sol:Counter] 0x86d0D7957f0BF3Cee98A60338B19fBf91390A9bA. -Submitted contract for verification: - Response: `OK` - GUID: `d9c8ec3f-fc14-5e9b-af03-b264467314bd` - URL: https://etherscan.io/address/0x86d0D7957f0BF3Cee98A60338B19fBf91390A9bA -``` - -When you open the smart contract on the [block explorer](../../../user/block-explorers/index.md), you will see a green checkbox in the **Contract** tab. -You can see that the smart contract code is visible to anyone. -You can now see the Solidity code instead of bytecode and interact with the smart contract from the block explorer. diff --git a/docs/dev/getting-started/setup/hardhat.md b/docs/dev/getting-started/setup/hardhat.md deleted file mode 100644 index 8e779254d..000000000 --- a/docs/dev/getting-started/setup/hardhat.md +++ /dev/null @@ -1,334 +0,0 @@ -# Setting Up Your Environment Using Hardhat - -[Hardhat](https://hardhat.org/) is an environment developers use to test, compile, deploy and debug dapps based on any blockchain compatible Ethereum's [EVM](glossary.md#evm). -Hardhat is a flexible and extensible task runner that helps you manage and automate the recurring tasks inherent to developing smart contracts and dapps. - -This article, partially based on the [Hardhat documentation](https://hardhat.org/hardhat-runner/docs/getting-started) shows you how to set up Hardhat and use it to build, test and deploy smart contracts on Flare. - -## Guide - -### 1. Set up the Environment - -!!! warning - - If you are using Windows, Hardhat strongly [recommends](https://hardhat.org/tutorial/setting-up-the-environment#windows) to use [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/about). - -Install the following dependencies: - -* [NodeJSv16+ LTS and npm Package Installer](https://nodejs.org/en/). - -!!! tip - Check the [Official Guide by Hardhat](https://hardhat.org/tutorial/setting-up-the-environment) if you have issues installing this package. - -Once the above dependencies are installed, create an npm empty project by running the following commands in a terminal: - -```bash -mkdir flare-tutorial -cd flare-tutorial -npm init -``` - -Press **Enter** on each of the prompts. - -Finally, add Hardhat and a few dependencies to the project, since you will use them in this tutorial. - -```bash -npm install --save-dev \ - hardhat \ - dotenv -``` - -### 2. Create a Hardhat Project - -Hardhat can quick-start your development by providing a sample project. -Just run: - -```bash -npx hardhat init -``` - -You should see the following prompt: - -
- ![Hardhat project creation prompt](hardhat1.png){ loading=lazy .allow-zoom } -
Hardhat project creation prompt.
-
- -Choose the `Create a JavaScript project` with the **Up** and **Down** keys, and Press **Enter**. -Then press **Y** for rest of the prompts. - -When done, it should print `Project created`. - -!!! tip - If you use the Windows command prompt, Hardhat might warn you that you need to install some dependencies manually. Do it using the command that the Hardhat setup guide provides. - -If you take a look in the `contracts` folder, you should find a sample source file called `Lock.sol`. -It is a Solidity smart contract implementing a digital lock, where users can only withdraw funds after a given period of time: - -```solidity -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.9; - -// Uncomment this line to use console.log -// import "hardhat/console.sol"; - -contract Lock { - uint public unlockTime; - address payable public owner; - - event Withdrawal(uint amount, uint when); - - constructor(uint _unlockTime) payable { - require( - block.timestamp < _unlockTime, - "Unlock time should be in the future" - ); - - unlockTime = _unlockTime; - owner = payable(msg.sender); - } - - function withdraw() public { - // Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal - // console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp); - - require(block.timestamp >= unlockTime, "You can't withdraw yet"); - require(msg.sender == owner, "You aren't the owner"); - - emit Withdrawal(address(this).balance, block.timestamp); - - owner.transfer(address(this).balance); - } -} -``` - -### 3. Compile the Contracts - -To compile the sample project, run: - -```bash -npx hardhat compile -``` - -Upon successful compilation it will print `Compiled 1 Solidity file successfully`. - -### 4. Configure the Project - -In order to be deployed on any of the [Flare networks](../../reference/network-config.md), the project needs to be configured. -Edit the `hardhat.config.js` file and replace its contents with the following: - -```javascript -require('dotenv').config(); -require("@nomicfoundation/hardhat-toolbox"); - -module.exports = { - solidity: { - compilers: [ - { - version: "0.8.17", - settings: { - evmVersion: "london" - }, - } - ], - }, - networks: { - hardhat: { - }, - coston: { - url: "https://coston-api.flare.network/ext/bc/C/rpc", - accounts: [process.env.PRIVATE_KEY], - chainId: 16 - }, - songbird: { - url: "https://songbird-api.flare.network/ext/bc/C/rpc", - accounts: [process.env.PRIVATE_KEY], - chainId: 19 - }, - coston2: { - url: "https://coston2-api.flare.network/ext/bc/C/rpc", - accounts: [process.env.PRIVATE_KEY], - chainId: 114, - }, - flare: { - url: "https://flare-api.flare.network/ext/bc/C/rpc", - accounts: [process.env.PRIVATE_KEY], - chainId: 14, - } - }, -}; -``` - -Then, create a file called `.env` at the root of you project (where the `hardhat.config.js` file resides) to store the private key for the account to use for testing. -[`.env` files](https://www.npmjs.com/package/dotenv) are useful to store local information which should not be committed into the source repository. -In this tutorial, you need to store your test account's [private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key) in this format: - -```bash -PRIVATE_KEY="0000000000000000000000000000000000000000000000000000000000000000" -``` - -!!! warning - - Make sure you never upload your `.env` file to a remote repository. - - For this reason, the `.gitignore` file that Hardhat created for you already ignores `.env` files. - -### 5. Test the Contract - -In the `test` folder you should find a ready-made test file that verifies the contract works as expected. - -To run tests with Hardhat, you just need to run: - -```bash -npx hardhat test -``` - -You should get: - -
- ![Lock contract test results](hardhat2.png){ loading=lazy .allow-zoom } -
Lock contract test results.
-
- -### 6. Deploy the Contract - -Now, you will deploy the contract to Flare's test network, [Coston2](../../reference/network-config.md), using the Hardhat Ignition module and script inside the `ignition/modules`. - -!!! warning - - Before proceeding with Deployment: - - * Make sure that you have added and selected the Coston2 test network to your Wallet. - The [Wallets section](../../../user/wallets/index.md) shows how to do it. - Use the values for Coston2 that you will find in the [Network Configurations](../../reference/network-config.md) page. - * Ensure that you have enough Coston2 native tokens `$C2FLR` to pay for gas. - Visit the [Coston2 Faucet](https://faucet.flare.network/coston2) to request some `$C2FLR`. - -Run this command at the root of the project: - -```bash -npx hardhat ignition deploy ./ignition/modules/Lock.js --network coston2 -``` - -Confirm that you want to deploy the contract on the Coston2 network. - -You should get an output similar to: - -```text -✔ Confirm deploy to network coston2 (114)? … yes -Hardhat Ignition 🚀 - -Deploying [ LockModule ] - -Batch #1 - Executed LockModule#Lock - -[ LockModule ] successfully deployed 🚀 - -Deployed Addresses - -LockModule#Lock - 0xDCCa38aF18A3b87c4171AEBD6c9753932Ad0c80F -``` - -The last part is the address where the contract has been deployed. -You can check the status of the contract by copying and pasting this address in the [Block Explorer](../../../user/block-explorers/index.md) - -### 7. Verify the Contract - -Verifying smart contracts is essential for transparency and security in the blockchain ecosystem. - -Verification allows inspecting Solidity source code instead of bytecode, and direct interaction with smart contracts through a block explorer. - -To verify a smart contract with Hardhat, you need to install a dedicated plugin with this command: - -```bash -npm install --save-dev @nomicfoundation/hardhat-verify -``` - -Next, you should configure the Hardhat project. - -In the `hardhat.config.js` file, import the Hardhat verify plugin and add a new section `etherscan` that describes the networks to use when verifying the contracts. - -Now the configuration file looks like this: - -```javascript hl_lines="40-54" -require('dotenv').config(); -require("@nomicfoundation/hardhat-toolbox"); -require("@nomicfoundation/hardhat-verify"); - -module.exports = { - solidity: { - compilers: [ - { - version: "0.8.17", - settings: { - evmVersion: "london" - }, - } - ], - }, - networks: { - hardhat: { - }, - coston: { - url: "https://coston-api.flare.network/ext/bc/C/rpc", - accounts: [process.env.PRIVATE_KEY], - chainId: 16 - }, - songbird: { - url: "https://songbird-api.flare.network/ext/bc/C/rpc", - accounts: [process.env.PRIVATE_KEY], - chainId: 19 - }, - coston2: { - url: "https://coston2-api.flare.network/ext/bc/C/rpc", - accounts: [process.env.PRIVATE_KEY], - chainId: 114, - }, - flare: { - url: "https://flare-api.flare.network/ext/bc/C/rpc", - accounts: [process.env.PRIVATE_KEY], - chainId: 14, - }, - }, - etherscan: { - apiKey: { - coston2: "flare", // API key is not needed, but we need to provide a value - }, - customChains: [ - { - network: "coston2", - chainId: 114, - urls: { - apiURL: "https://api.routescan.io/v2/network/testnet/evm/114/etherscan", - browserURL: "https://coston2.testnet.flarescan.com" - } - } - ] - } -}; -``` - -Now you can verify the smart contract passing the contract address and value of the timestamp as one of the parameters you saw in the console message when you deployed the smart contract on the Coston2 network [at the end of step 6 above](#6-deploy-the-contract). -In this example, the parameter is the timestamp. In the case of multiple constructor parameters, values are separated by a blank space. - -```bash -npx hardhat verify ADDRESS PARAMETERS --network coston2 -``` - -Continuing with the example above, the command would be: - -```bash -npx hardhat verify 0xdC7781FA9fA7e2d0313cd0229a5080B4e30663a5 1705592309 --network coston2 -``` - -It will take a minute or two to verify the smart contract on the blockchain and you should get an output like this: - -```text -Successfully verified contract Country on the block explorer. -https://coston2.testnet.flarescan.com/address/0xdC7781FA9fA7e2d0313cd0229a5080B4e30663a5#code -``` - -When you follow the link to the block explorer, you will see a green checkbox in the **Contract** tab. -You can see that the smart contract code is visible to anyone. -You can now see the Solidity code instead of bytecode and interact with the smart contract from the block explorer. diff --git a/docs/dev/getting-started/setup/index.md b/docs/dev/getting-started/setup/index.md deleted file mode 100644 index 593138197..000000000 --- a/docs/dev/getting-started/setup/index.md +++ /dev/null @@ -1,9 +0,0 @@ -# Setting Up Your Environment - -The following guides provide information to quickly set up a smart contract development environment. - -## Guides - -* [Using Remix](./remix.md) -* [Using Hardhat](./hardhat.md) -* [Using Foundry](./foundry.md) diff --git a/docs/dev/getting-started/setup/remix.md b/docs/dev/getting-started/setup/remix.md deleted file mode 100644 index ec8fc1b46..000000000 --- a/docs/dev/getting-started/setup/remix.md +++ /dev/null @@ -1,112 +0,0 @@ -# Setting Up Your Environment Using Remix - -The [Remix IDE](https://remix.ethereum.org/) is a powerful, open-source tool that helps you write [Solidity](https://docs.soliditylang.org/) smart contracts straight from the browser, without requiring any download, account creation, or login. - -This article shows you how to deploy a Hello World contract to the Flare blockchain using the Remix IDE and the MetaMask wallet. - -## Guide - -### 1. Create a New File - -* Visit the [Remix IDE](https://remix.ethereum.org/) and click the **New File** button. -* Name it `HelloWorld.sol`. -* Drag and drop it to the **contracts** folder. - -
- ![New file in the Remix IDE](remix1.png){ loading=lazy .allow-zoom width=500px } -
New file in the Remix IDE.
-
- -### 2. Write Your Contract - -Copy and paste the smart contract code provided below into the newly created `HelloWorld.sol` file. - -```solidity -// SPDX-License-Identifier: MIT - -// Specifies the version of Solidity, using semantic versioning. -pragma solidity 0.8.17; - -// Defines a contract named `HelloWorld` -contract HelloWorld { - - // Declares a state variable `message` of type `string`. - string public message; - - // Constructors are used to initialize the contract's data. - constructor(string memory initMessage) { - // Accepts a string argument `initMessage`. - message = initMessage; - } - - // A public function that accepts a string argument. - function update(string memory newMessage) public { - message = newMessage; - } -} -``` - -### 3. Compile Your Contract - -* Go to the Solidity Compiler tab (on the left), and select compiler version `0.8.17`. -* Click on **Advanced Configurations**, and select `london` from the **EVM VERSION** drop down. -* Now, click the **Compile HelloWorld.sol** button. - -After successful compilation, it will show a **Green tick mark** on the **Compiler** tab button. - -
- ![Compilation successful](remix2.png){ loading=lazy .allow-zoom } -
Compilation successful.
-
- -### 4. Deploying on Flare Testnet - -You will now deploy the smart contract on the [Coston2 network](../../reference/network-config.md), Flare's test network. - -When a smart contract is deployed on Flare's main network, it not only costs money (such as gas fees), but it also becomes immutable and cannot be modified. -Therefore, deploying your smart contracts first on the test network is highly recommended. - -!!! warning - - Before proceeding with Deployment: - - * Make sure that you have added and selected the Coston2 test network to your Wallet. - The [Wallets section](../../../user/wallets/index.md) shows how to do it. - Use the values for Coston2 that you will find in the [Network Configurations](../../reference/network-config.md) page. - * Ensure that you have enough Coston2 native tokens `$C2FLR` to pay for gas. - Visit the [Coston2 Faucet](https://faucet.flare.network/coston2) to request some `$C2FLR`. - -* Go to the **Deploy & Run Transactions** tab (the last one) and select **Injected Provider - Metamask** from the **ENVIRONMENT** dropdown. - Accept the connection request received in MetaMask if necessary. - -
- ![Environment selection on Remix](remix3.png){ loading=lazy .allow-zoom } -
Environment selection on Remix.
-
- -* Click the **Deploy** button and confirm the **CONTRACT DEPLOYMENT** transaction in MetaMask. - -
- ![Contract deployment transaction](remix4.png){ loading=lazy .allow-zoom } -
Contract deployment transaction.
-
- -!!! note - The process to deploy your contract on the Flare main network is the same as above. - You only have to select Flare Network on MetaMask and use `$FLR` tokens. - -### 5. Interact with the Contract - -You can now interact with the contract to verify that it is working as intended. - -* In the **Deployed Contracts** section at the bottom of the left column, expand the `HELLOWORLD` contract to see its methods and data: - * `update` method. - * `message` public variable. -* Type a message in the box next to the **update** button and click the button. -* Confirm the deployment transaction in MetaMask. -* Check that the contract has been updated by clicking the **message** button and verifying you get back the message you typed before. - -
- ![Interact with the contract](remix5.png){ loading=lazy .allow-zoom } -
Interact with the contract
-
\ No newline at end of file diff --git a/docs/dev/index.md b/docs/dev/index.md index 402955845..b97f162b0 100644 --- a/docs/dev/index.md +++ b/docs/dev/index.md @@ -3,7 +3,6 @@ !!! info inline end "Quick links" * [Network Configuration](./reference/network-config.md) - * [Flare Contracts Addresses](./getting-started/contract-addresses.md) * [How to run a node](../infra/observation/index.md) All Flare networks are a fork of the Avalanche project, which runs the [Ethereum Virtual Machine](glossary.md#evm). @@ -11,12 +10,7 @@ Therefore, all Ethereum contracts and tools work on Flare, Songbird and Coston. All Flare networks are layer-1 networks, and run independently of both Avalanche and Ethereum. -You can interact with the Flare networks using [wallets](../user/wallets/index.md), [block explorers](../user/block-explorers/index.md) and the most common blockchain [development environments](./getting-started/setup/index.md). - -As an example, all Flare networks support [NFTs](glossary.md#nft) and many have already been created on Songbird. -The [block explorer](../user/block-explorers/index.md) also supports displaying NFTs. - -Once you have [set up your development environment](./getting-started/setup/index.md), you can start with the [Accessing the Network](./tutorials/network-access/index.md) tutorials. +You can interact with the Flare networks using [wallets](../user/wallets/index.md), block explorers, and the most common blockchain development environments. ## Open-Source Repositories @@ -24,15 +18,3 @@ These are Flare's main source repositories, both on [GitHub](https://github.com/ * [Validator node](https://github.com/flare-foundation/flare) * [Smart contracts](https://gitlab.com/flarenetwork/flare-smart-contracts) - -## Guides - -The following guides provide in-depth information about the Flare networks and the different smart contracts APIs. - -* [FTSO](./tutorials/ftso/index.md) -* [State Connector](./tutorials/sc/index.md) -* [Automatic Claiming](./reference/automatic-claiming.md) -* [Personal Delegation Accounts](./reference/personal-delegation-account.md) -* [Block Explorers and Indexers](./reference/explorers-and-indexers.md) -* [The FlareDrop](./reference/the-flaredrop.md) -* [Wallets](./reference/wallets.md) \ No newline at end of file diff --git a/docs/dev/reference/automatic-claiming.md b/docs/dev/reference/automatic-claiming.md deleted file mode 100644 index c77c71f3b..000000000 --- a/docs/dev/reference/automatic-claiming.md +++ /dev/null @@ -1,171 +0,0 @@ -# Integrate Automatic Claiming - -Users who do not want to claim rewards themselves can enlist [executors](../../tech/automatic-claiming.md) to claim on their behalf. -Executors can then initiate the claiming process, and rewards are sent directly to the user's account. - -## Introduction - -Building an executor requires two parts: - -* An _executor bot_ that periodically claims on behalf of the users. -* An app that allows users to select the executor, such as the [Flare Portal](https://portal.flare.network), which is free to use. - -This page contains the following information: - -* The [Required Contracts](#required-contracts) section briefly lists the smart contracts related to executor operation. -* The [User Operations](#user-operations) section shows how to perform the operations required in a user-facing application, such as setting an executor. -* The [Executor Operations](#executor-operations) section shows how to perform the operations required by an executor bot, such as registering as an executor. -* The [User and Executor Reports](#user-and-executor-reports) section shows how to access information useful for performing user and executor functions. - -## Required Contracts - -Setting up automatic claiming requires interacting with these contracts: - -* [`ClaimSetupManager`](ClaimSetupManager.md) (CSM). -* [`FTSORewardManager`](FtsoRewardManager.md) (FTSO). - -To find the addresses of these contracts, see the [Contract Addresses](../getting-started/contract-addresses.md) page. - -## User Operations - -This section shows how to perform operations required to enable autoclaiming. -The main step is to set the executor that will perform the claiming for the user who has accrued rewards. -Then other operations are explained, such as changing the executor and disabling automatic claiming. - -### Setting Claim Executors - -There are two ways to set up automatic claiming: [Manual and Registered](../../tech/automatic-claiming.md#how-automatic-claiming-works). - -#### Manual Claiming - -With **Manual Claiming**, rewards are claimed on-chain, but any agreement between users and executors happens off-chain. -Fees are not paid automatically. - -To set one or more executors to claim rewards for a user: - -1. Set a specific executor by calling [`CSM.setClaimExecutors()`](ClaimSetupManager.md#fn_setclaimexecutors_9119c494) and providing the executor's address. - - This method must be called from the user's account, since they are the only ones that can authorize claiming on their behalf. - - This function removes all previously set executors and replaces them with the new set. - -#### Registered Claiming - -With **Registered Claiming**, a purpose-built [`ClaimSetupManager`](ClaimSetupManager.md) contract handles the on-chain agreement between users and executors, greatly simplifying the process. - -To set one or more registered executors to claim rewards for a user: - -1. Get a list of executors and their fees by calling [`CSM.getRegisteredExecutors()`](ClaimSetupManager.md#fn_getregisteredexecutors_6e927e61). - - To find the fee of a specific executor, call [`CSM.getExecutorCurrentFeeValue()`](ClaimSetupManager.md#fn_getexecutorcurrentfeevalue_e25547f8). - This fee is deducted from the user’s reward after each claim and sent to the executor. - - You can show this information to the user and let them select which executor to use. - -2. Set the selected executors by calling [`CSM.setClaimExecutors()`](ClaimSetupManager.md#fn_setclaimexecutors_9119c494) as shown for [Manual Claiming](#manual-claiming). - - However, when setting registered executors, the call must include a value equal to the executor’s fee (in FLR), which is sent to the executor as an enrollment fee. - If more than one executor is set, the value must equal the sum of all the executor's fees. - -### Changing Registered Executors - -To change registered executors, call [`CSM.setClaimExecutors()`](ClaimSetupManager.md#fn_setclaimexecutors_9119c494) with the new list of executors. -This new list overwrites the current list. - -### Disabling Automatic Claiming - -To disable automatic claiming, remove all executors by sending an empty array of executors with [`CSM.setClaimExecutors()`](ClaimSetupManager.md#fn_setclaimexecutors_9119c494). - -## Executor Operations - -This section shows how to perform operations required in an executor-facing application, for example, becoming an executor. -While the main step for manual executors is only claiming rewards, the main steps for registered executors are registering, setting a fee, and claiming rewards. -Other operations like changing the fee, unregistering as an executor, and learning which addresses to claim for are also explained. - -### Becoming an Executor - -There are two ways to become an executor: [Manual and Registered](../../tech/automatic-claiming.md#how-automatic-claiming-works). - -#### Manual Executor - -Setting an executor manually means doing so off-chain. -Therefore, there is no operation required for executors, besides communicating to the users the address of the executor they need to use. - -#### Registered Executor - -The [`ClaimSetupManager`](ClaimSetupManager.md) contract contains a list of self-registered executors that users can use to discover executors and their service fees, avoiding the need for off-chain operations as in manual claiming. - -To automatically receive fees for claiming, an executor address must register, set the fee for claiming rewards, and pay the registration fee. - -Register an executor by calling [`CSM.registerExecutor(uint256 feeValue)`](ClaimSetupManager.md#fn_registerexecutor_ccce7e86), where `feeValue` is the fee in wei that the executor requires to perform this service. -The fee value must be at least [`CSM.minFeeValueWei`](ClaimSetupManager.md#va_minfeevaluewei), currently 0.1 FLR, and no greater than [`CSM.maxFeeValueWei`](ClaimSetupManager.md#va_maxfeevaluewei), currently 100 FLR. -This transaction must include a registration fee equal to [`CSM.registerExecutorFeeValueWei`](ClaimSetupManager.md#va_registerexecutorfeevaluewei), currently 1000 FLR, which is burned. - -### Claiming Rewards - -#### How to Claim - -Executors can now only claim [FTSO delegation rewards](../../tech/ftso.md#delegation) on behalf of users. -As other rewards become available, they will also be claimable by executors without any user intervention. - -Manual and registered executors use the same function, the only difference being that unregistered executors do not receive a fee automatically. - -To claim FTSO rewards for all of a user's unclaimed epochs, call [`FtsoRewardManager.autoClaim()`](FtsoRewardManager.md#fn_autoclaim_8dc305fa). - -* This method can be used to claim for multiple users, since `rewardOwners` is an array. -* The `rewardEpoch` is the most current one that the executor wants to claim for, typically the one before the current epoch. - - If a user has more unclaimed epochs from the past, the function claims for all of them. - -The claimed amount gets the executor fee subtracted and is automatically wrapped, so it is sent to the user as `$WFLR`. - -#### What to Expect in Fees - -The executor gets paid a fee for each user for which he claims the FTSO delegation reward. -However, he only gets paid one fee per user regardless of whether he claims for one or more epochs. -The fee is paid in native `$FLR` tokens. - -If the claimed reward for a user is lower than the executor fee, the transaction is reverted. -To see which users have enough rewards to complete and which would revert, call [`FtsoRewardManager.autoClaim()`](FtsoRewardManager.md#fn_autoclaim_8dc305fa) with a specific user address. - -### Changing the Fee - -Registered executors can change the fee they charge for the successful execution of claims. -To change the fee, call [`CSM.updateExecutorFeeValue()`](ClaimSetupManager.md#fn_updateexecutorfeevalue_831f16af). -The new fee value will be in effect after [`CSM.feeValueUpdateOffset`](ClaimSetupManager.md#va_feevalueupdateoffset) reward epochs have elapsed (currently 3 epochs), where the first epoch is the one that is currently active. -This function returns the reward epoch number when the setting will become effective. - -### Unregistering an Executor - -Registered executors can unregister by calling [`CSM.unregisterExecutor()`](ClaimSetupManager.md#fn_unregisterexecutor_868a660f) and they will be removed from the list of executors. -To help the users adjust to the change, executors will retain the current fee and continue claiming for the next 3 reward epochs (`feeValueUpdateOffset`). -An executor's best practice is to notify users when unregistering. - -### Updating the User List - -Executors should keep a list of users to claim for, there is no mechanism to retrieve this list from the chain. -There are two ways to keep this list updated: - -* Listen to the [`CSM.ClaimExecutorsChanged`](ClaimSetupManager.md#fn_claimexecutors_3f317fe1) event which is emitted every time a user sets its executors. - This method is suitable for registered executors which might be selected at any time. -* If the executor is only interested in a closed list of users, e.g., the ones that enlisted on an application, it can call [`CSM.isClaimExecutor(address user, address executor)`](ClaimSetupManager.md#fn_isclaimexecutor_87962abe) for each user to verify the executor's address is properly configured. - -## User and Executor Reports - -This section shows how to access information that can help you perform both user and executor functions. - -### Executor Fees - -Get the current fee for each executor on the Registered Executors list by calling [`CSM.getExecutorCurrentFeeValue(address executor)`](ClaimSetupManager.md#fn_getexecutorcurrentfeevalue_e25547f8). -For upcoming fee changes, call [`CSM.getExecutorScheduledFeeValueChanges(address executor)`](ClaimSetupManager.md#fn_getexecutorscheduledfeevaluechanges_950b028c). - -### Executors by User - -A user can set more than one executor. -To see a list of current executors for a user, call [`CSM.claimExecutors(address user)`](ClaimSetupManager.md#fn_claimexecutors_3f317fe1), which returns an array of executor addresses. -It is a best practice for users to check this report periodically (at least every 90 days) to make sure their selected executors have not unregistered without notice. - -### Executor Status - -To check if an executor is registered, call [`CSM.getExecutorInfo(address executor)`](ClaimSetupManager.md#fn_getexecutorinfo_8e28b923). -It returns whether an executor is registered and its fee. diff --git a/docs/dev/reference/explorers-and-indexers.md b/docs/dev/reference/explorers-and-indexers.md deleted file mode 100644 index 65247ffbf..000000000 --- a/docs/dev/reference/explorers-and-indexers.md +++ /dev/null @@ -1,17 +0,0 @@ -# Block Explorers and Indexers - -Flare provides a block explorer for each of the networks in its ecosystem. -All explorers are a fork of [Blockscout](https://github.com/blockscout/blockscout), adapted to the Flare networks ([Blockscout Docs](https://docs.blockscout.com)). - -API documentation for each network's explorer: - -* [Flare](https://flare-explorer.flare.network/api-docs) -* [Songbird](https://songbird-explorer.flare.network/api-docs) -* [Coston](https://coston-explorer.flare.network/api-docs) -* [Coston2](https://coston2-explorer.flare.network/api-docs) - -[API access](https://docs.blockscout.com/for-users/api) to the Coston Explorer is enabled for noncommercial use only. - -## Related User Guides - -* [Block Explorers](../../user/block-explorers/index.md) diff --git a/docs/dev/reference/ftso.md b/docs/dev/reference/ftso.md index f82a0b3aa..eeb06af56 100644 --- a/docs/dev/reference/ftso.md +++ b/docs/dev/reference/ftso.md @@ -17,7 +17,7 @@ Using prices as an example, the following diagram shows the flow of data, querie The following list describes the most relevant contracts and their purposes: -* **[FTSO](Ftso.md)**: Each data type is handled by its own FTSO contract, including calculation of the filtered [data feed](glossary.md#data_feed). +* **FTSO**: Each data type is handled by its own FTSO contract, including calculation of the filtered [data feed](glossary.md#data_feed). To retrieve information about a data type, access this contract. @@ -26,19 +26,15 @@ The following list describes the most relevant contracts and their purposes: If an FTSO contract is **redeployed** (for example, to fix a bug), **its address will change** and apps using it will need to be updated. The FTSO Registry contract below tracks this change for you. - You can retrieve the addresses of all FTSO contracts using the [`getAllFtsos`](FtsoRegistry.md#fn_getallftsos_2bcdd6ab) method in the FTSO Registry. + You can retrieve the addresses of all FTSO contracts using the `getAllFtsos` method in the FTSO Registry. -* **[FTSO Registry](FtsoRegistry.md)**: Aggregates the output of each individual FTSO contract and provides a convenient one-stop API to retrieve all data. +* **FTSO Registry**: Aggregates the output of each individual FTSO contract and provides a convenient one-stop API to retrieve all data. -* **[Price Submitter](PriceSubmitter.md)**: This contract is used by the FTSO data providers to submit their data. Although the contract is called [`PriceSubmitter`](PriceSubmitter.md), data is not limited to prices. +* **Price Submitter**: This contract is used by the FTSO data providers to submit their data. Although the contract is called `PriceSubmitter`, data is not limited to prices. -* **[Reward Manager](FtsoRewardManager.md)**: Use this contract to claim your [rewards](../../tech//ftso.md#rewards), whether you are a data provider or a [delegator](../../tech//ftso.md#delegation). +* **Reward Manager**: Use this contract to claim your [rewards](../../tech//ftso.md#rewards), whether you are a data provider or a [delegator](../../tech//ftso.md#delegation). -* **[Wrapped Native (WNat)](WNat.md)**: This contract is not exclusively related to the FTSO system, but it is required to wrap and unwrap native tokens into the `$WFLR` and `$WSGB` that delegation requires. - -!!! note - - The [Contract Addresses](../getting-started/contract-addresses.md) page explains how to securely retrieve each contract's address. +* **Wrapped Native (WNat)**: This contract is not exclusively related to the FTSO system, but it is required to wrap and unwrap native tokens into the `$WFLR` and `$WSGB` that delegation requires. ## Manual Delegation and Claiming @@ -68,7 +64,7 @@ The submission API is slightly different for the Flare and Songbird networks: === "Flare" - FTSO data providers submit data through the [PriceSubmitter contract](../getting-started/contract-addresses.md). + FTSO data providers submit data through the `PriceSubmitter` contract. - **Commit**: A single hash is needed for each submission. @@ -92,7 +88,7 @@ The submission API is slightly different for the Flare and Songbird networks: === "Songbird" - FTSO data providers submit data through the [PriceSubmitter contract](../getting-started/contract-addresses.md). + FTSO data providers submit data through the `PriceSubmitter` contract. - **Commit**: A separate hash is needed for each submission. @@ -119,8 +115,8 @@ The submission API is slightly different for the Flare and Songbird networks: Data produced by the FTSO is **publicly available** on the Flare and Songbird networks. -All data can be retrieved either through the [`FtsoRegistry`](FtsoRegistry.md) contract or directly through one of the [`Ftso`](Ftso.md) contracts. -In any case, using the [`getCurrentPriceWithDecimals`](FtsoRegistry.md#fn_getcurrentpricewithdecimals_257cbd3a) method is recommended. +All data can be retrieved either through the `FtsoRegistry` contract or directly through one of the `Ftso` contracts. +In any case, using the `getCurrentPriceWithDecimals` method is recommended. The following examples show how to use this method to retrieve price data. === "Retrieve by pair index" @@ -181,7 +177,3 @@ That is, the actual price is `_price` \* 10 ^-`_assetPriceUsdDecimals`^. For example, a return value of `2603` with `_assetPriceUsdDecimals` of `5` means a price of `0.02603 USD` (There are only **5** significant decimal places). A [standard Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) of the last price update is also returned. - -## Related Tutorials - -* [FTSO](../tutorials/ftso/index.md) diff --git a/docs/dev/reference/personal-delegation-account.md b/docs/dev/reference/personal-delegation-account.md deleted file mode 100644 index 92048feec..000000000 --- a/docs/dev/reference/personal-delegation-account.md +++ /dev/null @@ -1,106 +0,0 @@ -# Integrate Personal Delegation Accounts - -Personal Delegation Accounts (PDAs) temporarily store rewards, such as FTSO delegation rewards, that users do not want to claim to their main accounts as explained in [the Concept page](../../tech/personal-delegation-account.md). - -This page explains how to manage PDA functionality in applications. - -## Required contracts - -Working with the PDAs requires interacting with these contracts: - -* [`ClaimSetupManager`](ClaimSetupManager.md) (CSM). -* [`FTSORewardManager`](FtsoRewardManager.md) (FTSO). - -To find the addresses of these contracts read the [Contract Addresses](../getting-started/contract-addresses.md) page. - -## Enabling a PDA - -[`CSM.enableDelegationAccount()`](ClaimSetupManager.md#fn_enabledelegationaccount_f0977215) returns the address of the PDA associated with the caller's address, creating the PDA in the process if it didn't exist. -A single PDA can be associated with each address and it cannot be destroyed once created, only disabled (see below). - -There exist no private keys to the PDA account so it cannot sign any transactions. -All interaction with the PDA happens through the CSM contract, and is usually triggered by the user's main account. - -Note that this means that a PDA cannot have its own PDA, since no calls to the CSM can be made from the PDA account. - -Once a PDA is created, certain functions like [`FtsoRewardManager.autoClaim()`](FtsoRewardManager.md#fn_autoclaim_8dc305fa) automatically send claimed rewards to the PDA account instead of the main account. -See [Delegation and Rewards](#delegation-and-rewards) below. - -## Disabling a PDA - -To disable the use of a PDA, call [`CSM.disableDelegationAccount()`](ClaimSetupManager.md#fn_disabledelegationaccount_2394deb1). -Any `$WFLR` tokens that are on the PDA address are transferred back to the user's main account. - -When users disable their PDA, [`FtsoRewardManager.autoClaim()`](FtsoRewardManager.md#fn_autoclaim_8dc305fa) claims only the rewards for their main account and to their main account. - -[`CSM.disableDelegationAccount()`](ClaimSetupManager.md#fn_disabledelegationaccount_2394deb1) disables the PDA contract but does not destroy it: its address is still returned by [`CSM.getDelegationAccountData()`](ClaimSetupManager.md#fn_getdelegationaccountdata_17a1e3fc), but the `enabled` boolean will be `false`. - -## Checking PDA State - -To check if a user's PDA is enabled, call [`CSM.getDelegationAccountData()`](ClaimSetupManager.md#fn_getdelegationaccountdata_17a1e3fc). -It returns both the PDA address and its state: - -| Condition | Address | State | -| -------------------------- | ------------- | ------- | -| PDA is enabled | PDA address | `true` | -| PDA is disabled | PDA address | `false` | -| PDA has never been created | `0x000...000` | `false` | - -!!! warning "Never rely solely on the returned address being non-zero to check if an account has a PDA." - -## Delegation and Rewards - -A PDA is a regular account for which there are no private keys and which must be managed through the CSM contract instead. - -Conveniently, the method signatures to delegate on the CSM are the same as on the [`WNat`](WNat.md) contract where delegation is usually performed, for instance [`CSM.batchDelegate()`](ClaimSetupManager.md#fn_batchdelegate_dc4fcda7). -FTSO reward claiming, though, is still performed through the [`FTSORewardManager`](FtsoRewardManager.md), for example using `claimReward(address recipient, ...)` where `recipient` allows sending to any address, including a PDA. -For information on how to delegate and claim FTSO rewards, see [Delegation](../../tech/ftso.md#delegation) and [Rewards](../../tech/ftso.md#rewards). - -In addition to the methods used for regular accounts, [`FtsoRewardManager.autoClaim()`](FtsoRewardManager.md#fn_autoclaim_8dc305fa) automatically claims for both the main account and the PDA, to the PDA or the main account depending on whether the PDA is enabled or not. -If users disable their PDA, [`autoClaim()`](FtsoRewardManager.md#fn_autoclaim_8dc305fa) claims rewards for only their main account and to only their main account. - -!!! note - - The `autoClaim()` method is unrelated to [Automatic Claiming](../../tech/automatic-claiming.md) performed by executors. - -## Governance Voting - -Flare network users have a right to [vote on proposals](../../tech/governance.md) that can change the behavior of the network or add new features. -The number of votes an address has is equal to the amount of wrapped Flare tokens (`$WFLR`) that the address holds. - -PDA addresses cannot vote directly, but their owners can [transfer](../../tech/governance.md#vote-transfer) all their votes to another address (e.g., the owner's address) by calling `CSM.delegateGovernance(address recipient)`. -The recipient of the votes can then vote with its own votes as well as with the votes received from other addresses. - -## Transferring Funds - -Because a PDA is a regular account, anyone can send funds to it. -However, FLR tokens transferred to a PDA are automatically converted to `$WFLR`, making them convenient for delegation. - -Only the owner of the main account and its PDA can transfer funds from the PDA and only to its main account. -To transfer tokens, the owner calls [`CSM.withdraw()`](ClaimSetupManager.md#fn_withdraw_2e1a7d4d) and states the amount to withdraw. - -Since it has no private keys, any token other than `$FLR` or `$WFLR` transferred to the PDA cannot be moved out by conventional means. -Instead, [`CSM.transferExternalToken()`](ClaimSetupManager.md#fn_transferexternaltoken_489a8a47) must be used to transfer them to another account. -This is useful, for example, to recover airdropped tokens accidentally sent to the PDA. - -!!! note - - `CSM.transferExternalToken()` only works on ERC-20 tokens or token contracts that support the `transfer` function. - -## Wallet or Dapp Integration - -To support personal delegation accounts, a wallet or dapp at a minimum should show its status, including: - -* Checking the user's PDA address and whether it is enabled. -* Showing the amount of `$WFLR` on the user's PDA. - -Additional integration could support the following actions: - -* Enabling and disabling the PDA. -* Allowing the delegation of funds from a PDA to FTSO price providers. -* Delegating votes for governance voting. -* Claiming rewards to the PDA. -* Withdrawing funds from users' PDAs to their main accounts. -* Withdrawing custom ERC-20 tokens to the users' main accounts. - -See the [Flare Portal](https://portal.flare.network) for an example of such integration. diff --git a/docs/dev/reference/the-flaredrop.md b/docs/dev/reference/the-flaredrop.md deleted file mode 100644 index b6d23e869..000000000 --- a/docs/dev/reference/the-flaredrop.md +++ /dev/null @@ -1,87 +0,0 @@ -# The FlareDrop - -[The FlareDrop](../../tech/the-flaredrop.md), previously called the _Delegation Incentive Pool_ in the [FIP.01](https://flare.network/fip01/), is a distribution method for the 24.25B remaining `$FLR` tokens after the [original airdrop](../../tech/archive/flare-launch-process.md#definitions). - -This page explains how to manage FlareDrop functionality in applications. - -## Required Contracts - -Working with the FlareDrop requires interacting with these contracts: - -* [`DistributionToDelegators`](https://gitlab.com/flarenetwork/flare-smart-contracts/-/blob/master/contracts/tokenPools/implementation/DistributionToDelegators.sol) (Dist). - Manages all claims. -* [`ClaimSetupManager`](ClaimSetupManager.md) (CSM). - Needed to configure autoclaiming. - -To find their addresses, read the [Contract Addresses](../getting-started/contract-addresses.md) page. - -## Operations - -### Basic Claiming - -The `Dist.claim` method allows claiming the FlareDrop one account at a time. - -```solidity -function claim( - address _rewardOwner, - address _recipient, - uint256 _month, - bool _wrap -) external returns( - uint256 _rewardAmount -); -``` - -It transfers the FlareDrop rewards accrued by account `_rewardOwner` during the specified `_month` to the specified `_recipient`. - -`_wrap` controls whether the reward is transferred in native `$FLR` tokens or wrapped in `$WFLR` tokens. - -You can use `Dist.getCurrentMonth()` to find out the current month (starting at 0), or `Dist.getClaimableMonths()` to get the interval of months which are currently available for claiming. -Use `Dist.getClaimableAmount()` or `Dist.getClaimableAmountOf()` to find out if a given address has pending rewards on any given month. - -`Dist.claim()` returns the amount of claimed rewards. - -Two modes of operation are supported: Self-claiming and claiming on behalf of another account. - -* **Self-Claiming**: - - When `msg.sender` matches `_rewardOwner`, the caller is claiming its own rewards. - In this case `_recipient` can be any address. - -* **Claiming on behalf of another account**: - - When `msg.sender` does not match `_rewardOwner`, the caller must be a [claim executor](../../tech/automatic-claiming.md), claiming on behalf of `_rewardOwner`. - - If `_msg.sender` is not in the authorized list of executors for `_rewardOwner`, the call will revert. - Authorized executors must be set beforehand by `_rewardOwner` using `CSM.setClaimExecutors()`. - - The `_recipient` must either be `_rewardOwner`, its [PDA](../../tech/personal-delegation-account.md), or any of the authorized recipients previously set by `_rewardOwner` using `CSM.setAllowedClaimRecipients()`. - The call will revert otherwise. - -### Batched Claiming - -The `Dist.autoClaim()` method allows claiming the FlareDrop for an arbitrary amount of accounts in a single call, with convenient default values. - -```solidity -function autoClaim( - address[] calldata _rewardOwners, - uint256 _month -) external; -``` - -It claims the rewards accrued by all the accounts in the `_rewardOwners` array during the specified `_month`. - -If an account does not have an enabled [PDA](../../tech/personal-delegation-account.md), the rewards are sent to the same account. - -However, if an account does have an enabled PDA, the rewards are sent to the PDA account. -Any rewards accrued by the PDA account are also claimed and sent to the PDA. - -Rewards claimed with this method are always wrapped. - -If the executor is a [registered executor](../../tech/automatic-claiming.md#registered-claiming-process) with a nonzero fee, the fee is automatically deducted from each claimed reward and sent to the executor account (unwrapped). -If rewards are claimed for both an address and its PDA, the fee is deducted only once. - -The call reverts if: - -* `msg.sender` is not in the authorized list of executors for any of the `_rewardOwners`. -* The total claimed rewards for any of the `_rewardOwners` is not high enough to cover the executor's fee. diff --git a/docs/dev/reference/wallets.md b/docs/dev/reference/wallets.md deleted file mode 100644 index 57780f42b..000000000 --- a/docs/dev/reference/wallets.md +++ /dev/null @@ -1,24 +0,0 @@ -# Wallets - -Information for wallet developers wanting to integrate with the Flare networks. - -First off, find all basic network information like Chain ID or public RPC endpoints in the [Network Configuration](./network-config.md) page. - -This page then provides a few more pointers specific to wallet development. - -## Block Explorers and Indexers - -For all its networks, Flare offers public block explorers that double down as indexers. -Learn about them in the [Block Explorers](../../user/block-explorers/index.md) section. - -## Flare's Personal Delegation Accounts - -See the [Integration with a Personal Delegation Account](./personal-delegation-account.md#wallet-or-dapp-integration) page. - -## Address Derivation Paths for HD Wallets - -Address derivation and format validation on Flare are the same as on Ethereum. -In particular, Flare uses the same coin type as Ethereum, this is, 60. -The [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) paths are therefore `m/44’/60’/x’/0/0` (hardened) and `m/44’/60’/0’/0/x`. - -The same path is used on both [the C-chain and the P-chain](../../tech/flare.md#flare-chains). diff --git a/docs/dev/tools.md b/docs/dev/tools.md deleted file mode 100644 index 54eaec526..000000000 --- a/docs/dev/tools.md +++ /dev/null @@ -1,64 +0,0 @@ -# Tooling - -The following tools already support the Flare network. - -## API Providers - -These companies provide API services like [RPC endpoints](glossary.md#rpc), for example. -Unlike [Flare's public RPC endpoints](./reference/network-config.md), paid services are typically not rate-limited. - -* [Flare API Portal](https://api-portal.flare.network/) -* [Ankr](https://www.ankr.com/blog/flare-ankr-s-next-blockchain-connection/) -* [NOWNodes](https://nownodes.io/nodes) - -## Identity and Account Abstraction - -* [web3auth](https://web3auth.io/docs/connect-blockchain/flare) - -## Indexing and Querying - -Blockchains typically store the history of all transactions but not the latest, consolidated state of individual accounts. -The companies below provide fast access to this information - -* [Ankr](https://www.ankr.com/blog/flare-ankr-s-next-blockchain-connection/) -* [SubQuery](https://academy.subquery.network/quickstart/quickstart_chains/flare.html) -* [Subsquid](https://docs.subsquid.io/evm-indexing/supported-networks/) - -## Monitoring Tools - -These tools report information about Flare networks: - -* [Flare Builders](https://www.flare.builders/) -* [FlareMetrics](https://flaremetrics.io/) -* [Validators, presented by Towo Labs](https://validators.towolabs.com/) -* [SolidiFi](https://solidifi.app/validators) - -## Storage - -Storing large amounts of data on-chain is typically very expensive. -These are some decentralized storage alternatives. - -* [Filecoin](https://docs.filecoin.io/developers/introduction/filecoin-and-ipfs) -* [IPFS](https://docs.ipfs.tech) -* [Crust Network](https://www.crust.network) -* [Pinata](https://www.pinata.cloud) -* [Lighthouse](https://www.lighthouse.storage) -* [Arweave](https://www.arweave.org) - -## Wallets - -Please see the [Wallet user guides](../user/wallets/index.md) for a list of wallets currently supporting the Flare network. - -For some common ways of integrating wallets into dapps, see: - -* [WalletConnect Documentation](https://docs.walletconnect.com/) and the [Web3Modal](https://docs.walletconnect.com/web3modal/about) SDK. - -* [MetaMask Documentation](https://docs.metamask.io/wallet/how-to/get-started-building/). - -* [RainbowKit](https://www.rainbowkit.com/) - -## Blockchain Interaction Tools - -Enhancing EVM-compatible blockchain interactions, these tools streamline dapp development by simplifying wallet integration and smart-contract connectivity. - -* [Wagmi](https://wagmi.sh/core/api/chains) \ No newline at end of file diff --git a/docs/dev/tutorials/ftso/getting-data-feeds.md b/docs/dev/tutorials/ftso/getting-data-feeds.md deleted file mode 100644 index 49cf5ffa0..000000000 --- a/docs/dev/tutorials/ftso/getting-data-feeds.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -og_image: assets/thumbnails/tutorial-ftso-1.png -og_description: This tutorial shows the simplest way to use the FTSO system to retrieve a specific data feed, like the price of Bitcoin. -search: - boost: 2 ---- - -# Getting FTSO Data Feeds - -This tutorial shows the simplest way to use the [FTSO system](../../../tech/ftso.md) to retrieve a specific [data feed](glossary.md#data_feed), like the price of Bitcoin. - -The tutorial shows: - -* How to use the Flare periphery packages to simplify working with the Flare API. -* How to retrieve the latest price for a given asset from the FTSO system. - -## Code - -Choose your preferred programming language and ensure you have a working [development environment](../../getting-started/setup/index.md). - -For easy navigation, numbered comments in the source code link to the tutorial sections below. - -{% import "runner.md" as runner with context %} - -=== "Solidity" - - {{ runner.sol("ftso/", "GettingDataFeeds") | indent(4) }} - -=== "JavaScript" - - {{ runner.js("ftso/", "GettingDataFeeds", runFromBrowser='true', params=[{"name":"Symbol", "value":"BTC"}]) | indent(4) }} - - - -
- -## Tutorial - -### 1. Import Dependencies - -The tutorial uses the following dependencies: - -* The [Flare Periphery Package](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contracts) for Solidity and the [Flare Periphery Artifacts Package](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contract-artifacts) for JavaScript, which provide the API for all Flare smart contracts. - -* If you use JavaScript, the [ethers](https://www.npmjs.com/package/ethers) package is also needed to work with smart contracts. - -{{ runner.multisnippet("ftso/GettingDataFeeds", 6, 7, 8, 9) }} - -The Periphery Packages simplify working with the Flare smart contracts significantly. -If you remove this dependency, you must manually provide the signatures for all the methods you want to use. - -### 2. Access the Contract Registry - -The [`FlareContractRegistry`](FlareContractRegistry.md) contains the current addresses for all Flare smart contracts, and it is [the only recommended way](../../getting-started/contract-addresses.md) to retrieve them. - -Its address is the same on all of [Flare's networks](../../../tech/flare.md#flare-networks), and it is the only Flare address that needs to be hard-coded into any program. - -{{ runner.multisnippet("ftso/GettingDataFeeds", 20, 21, 15, 18) }} - -### 3. Retrieve the FTSO Registry - -Prices for all assets tracked by the FTSO system are recovered through the [`FtsoRegistry`](FtsoRegistry.md) contract. - -Use the [`getContractAddressByName()`](FlareContractRegistry.md#fn_getcontractaddressbyname_82760fca) method from the [`FlareContractRegistry`](FlareContractRegistry.md) to retrieve the address of the [`FtsoRegistry`](FtsoRegistry.md). - -{{ runner.multisnippet("ftso/GettingDataFeeds", 24, 25, 21, 26) }} - -This address can be retrieved in the initialization phase of your program and used afterward. -There is no need to fetch it every time it must be used. - -### 4. Get Latest Price - -Finally, the asset's price is fetched from the [`FtsoRegistry`](FtsoRegistry.md) using [`getCurrentPriceWithDecimals`](FtsoRegistry.md#fn_getcurrentpricewithdecimals_a69afdc6). - -{{ runner.multisnippet("ftso/GettingDataFeeds", 28, 29, 29, 33) }} - -* The only parameter of this method is the symbol for the asset being queried, like `"FLR"` or `"BTC"`. - You can use [`getSupportedSymbols()`](FtsoRegistry.md#fn_getsupportedsymbols_ce1c0e4d) to retrieve the list of all supported symbols. - - !!! warning - On Coston and Coston2, the symbol names are prefixed with "test", such as `"testBTC"`. - When you use the [`getSupportedSymbols()`](FtsoRegistry.md#fn_getsupportedsymbols_ce1c0e4d) function to retrieve the list of supported symbols, the symbol names will already contain the prefix. - -* Given that Solidity does not support numbers with decimals, this method returns the requested price as an integer and the number of decimal places by which the comma must be shifted. - - For example, if it returns **1234** for the price and **2** for the decimals, the actual price of the asset in USD is **12.34**. - -* It also returns the time when the price was calculated by the FTSO system as a [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time). - You can use an online tool like [EpochConverter](https://www.epochconverter.com/) to turn the timestamp into a human-readable form, - or use `Date` as in the JavaScript example. - -??? note "JavaScript note on overloaded methods" - - The call to the `getCurrentPriceWithDecimals` method is a bit cumbersome in JavaScript: - - ```js linenums="37" - --8<-- "./docs/samples/ftso/GettingDataFeeds.js:29:30" - ``` - - The call needs to be like this because this method is overloaded. - `getCurrentPriceWithDecimals` has two versions: one accepting a string for the symbol and another one accepting an integer for the asset's index in the FTSO system. - Therefore, the call needs to disambiguate both versions. - - The vast majority of methods are not overloaded and allow a more natural call format. - For example: - - ```js - await ftsoRegistry.getSupportedSymbols(); - ``` - -
- -## Conclusion - -This tutorial served as the Hello World program for the [FTSO system](../../../tech/ftso.md). -It has shown: - -* How to use the Flare Periphery Package, both from [Solidity](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contracts) and from [JavaScript](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contract-artifacts). -* How to retrieve the latest price for a given asset from the FTSO system. diff --git a/docs/dev/tutorials/ftso/getting-random-numbers.md b/docs/dev/tutorials/ftso/getting-random-numbers.md deleted file mode 100644 index 26cc83e97..000000000 --- a/docs/dev/tutorials/ftso/getting-random-numbers.md +++ /dev/null @@ -1,111 +0,0 @@ -# Getting Random Numbers - -This tutorial shows how to obtain random numbers from the [Flare Systems Protocol (FSP)](../../../tech/flare-systems-protocol.md), the infrastructure that powers most current Flare protocols. -The source of the randomness is the submissions from all [FTSO data providers](../../../tech/ftso.md#procedure-overview) and is therefore not centralized. - -Random numbers are generated every 90 seconds and can be read directly from a smart contract. - -This is useful in several development contexts where secure, fair random numbers are required, such as in games and certain blockchain protocol functionalities such as [selecting a random vote power block](../../../tech/ftso.md#vote-power). - -!!! info "Security and Fairness" - - A generated random number is tagged as secure if all data providers correctly followed the FTSO protocol and at least one of them is not malicious. - - If a number is tagged as secure, then the protocol guarantees its fairness, meaning that it has no bias and all outcomes are equally probable. - -This tutorial shows: - -* How to obtain a random number. -* How to use the Flare periphery packages to simplify working with the Flare API. - -## Code - -Choose your preferred programming language and ensure you have a working [development environment](../../getting-started/setup/index.md). - -For easy navigation, numbered comments in the source code (e.g. `// 1.`) link to the tutorial sections below. - -{% import "runner.md" as runner with context %} - -=== "Solidity" - - {{ runner.sol("ftso/", "GetRandomNumber") | indent(4) }} - -=== "JavaScript" - - {{ runner.js("ftso/", "GetRandomNumber", runFromBrowser='false') | indent(4) }} - - - -
- -## Tutorial - -### 1. Import Dependencies - -The tutorial uses the following dependencies: - -* The [Flare Periphery Package](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contracts) for Solidity and the [Flare Periphery Artifacts Package](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contract-artifacts) for JavaScript, which provide the API for all Flare smart contracts. - -* If you use JavaScript, the [ethers](https://www.npmjs.com/package/ethers) package is also needed to work with smart contracts. - -{{ runner.multisnippet("ftso/GetRandomNumber", 3, 5, 8, 11) }} - -The Periphery Packages simplify working with the Flare smart contracts significantly. - -!!! warning - If you remove this dependency, you must manually provide the signatures for all the methods you want to use. - -### 2. Access the Contract Registry - -The [`FlareContractRegistry`](FlareContractRegistry.md) contains the current addresses for all Flare smart contracts, and it is [the only recommended way](../../getting-started/contract-addresses.md) to retrieve them. - -=== "Solidity" - - The `FlareContractsRegistryLibrary` contract from the Flare Periphery Package accesses the Flare Contract Registry for you, as shown next. - -=== "JavaScript" - - The address of the Flare Contract Registry is the same on all of [Flare's networks](../../../tech/flare.md#flare-networks), and it is the only Flare address that needs to be hard-coded into any program. - - ```javascript title="GetRandomNumber.js" linenums="3" - --8<-- "./docs/samples/ftso/GetRandomNumber.js:3:4" - ``` - - ```javascript title="GetRandomNumber.js" linenums="13" - --8<-- "./docs/samples/ftso/GetRandomNumber.js:13:17" - ``` - -### 3. Retrieve the Relay Contract - -Use the [`getContractAddressByName()`](FlareContractRegistry.md#fn_getcontractaddressbyname_82760fca) method of the [`FlareContractRegistry`](FlareContractRegistry.md) smart contract to retrieve the address of the `Relay` smart contract. - -{{ runner.multisnippet("ftso/GetRandomNumber", 9, 11, 20, 27) }} - -### 4. Get the Random Number - -Get the latest generated random number by calling the `getRandomNumber()` method of the `Relay` contract. - -{{ runner.multisnippet("ftso/GetRandomNumber", 12, 15, 30, 33) }} - -In addition to the `randomNumber`, two other variables are retrieved: - -* `isSecure` is a boolean flag that indicates whether the random number was generated securely, according to the description given in the introduction. - - The random number is based on all the data providers' submissions and is therefore decentralized, improving transparency and fairness. - However, this decentralization makes the protocol slightly open to attempts at manipulation. - If such manipulation attempts are detected, the `isSecure` flag is set to `false`, and dapps can decide whether they should discard the generated number. - -* `timestamp` is the [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) indicating the time at the end of the voting epoch during which data was collected from data providers to generate this particular number. - - The timestamp can be useful, for example, to ensure that certain actions have been performed before the random number was generated. - For example, in a roulette game, to ensure all bets were placed before the number was generated. - Each voting epoch is a fixed 90-second window. - -## Conclusion - -This tutorial has shown: - -* How to use the Flare Periphery Package, both from [Solidity](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contracts) and from [JavaScript](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contract-artifacts), to work with the Flare API. -* How to get the latest random number via the `Relay` contract. diff --git a/docs/dev/tutorials/ftso/index.md b/docs/dev/tutorials/ftso/index.md deleted file mode 100644 index fb9fc983b..000000000 --- a/docs/dev/tutorials/ftso/index.md +++ /dev/null @@ -1,9 +0,0 @@ -# FTSO Tutorials - -These code samples and explanations show how to use the [FTSO system](../../../tech/ftso.md). - -## Tutorials - -* [FTSO Developer Overview](../../../dev/reference/ftso.md) -* [Getting FTSO Data Feeds](../ftso/getting-data-feeds.md) -* [Getting Random Numbers](../ftso/getting-random-numbers.md) diff --git a/docs/dev/tutorials/network-access/index.md b/docs/dev/tutorials/network-access/index.md deleted file mode 100644 index ea222898b..000000000 --- a/docs/dev/tutorials/network-access/index.md +++ /dev/null @@ -1,20 +0,0 @@ -# Accessing the Network - -The following tutorials deal with common problems encountered when accessing the Flare networks, like sending transactions or reading events. - -!!! warning "Only EVM versions up to London are currently supported" - - All Flare networks support only EVM versions up to London. - - Learn how to set the EVM version in your compiler in [the Solidity documentation](https://docs.soliditylang.org/en/latest/using-the-compiler.html#setting-the-evm-version-to-target). - [Example of how to do this using Hardhat](https://github.com/flare-foundation/flare-hardhat-starter/blob/master/hardhat.config.ts#L32). - -## Configure your network - -* [Network Config](../../reference/network-config.md) - -## Tutorials - -* [Checking Transaction Finalization](./transaction-finalization.md) -* [Reliable Event Reading](./reliable-event-reading.md) -* [Obtaining a Transaction's Revert Reason](./obtaining-revert-reason.md) diff --git a/docs/dev/tutorials/network-access/obtaining-revert-reason.md b/docs/dev/tutorials/network-access/obtaining-revert-reason.md deleted file mode 100644 index bd0ec8579..000000000 --- a/docs/dev/tutorials/network-access/obtaining-revert-reason.md +++ /dev/null @@ -1,42 +0,0 @@ -# Obtaining a Transaction's Revert Reason - -Sometimes contract calls revert and throw a generic "Transaction has been reverted" exception which is not very helpful, since it does not contain the revert reason. - -In this case, simulating the call in the EVM without sending any transaction, using the [`.call()`](https://web3js.readthedocs.io/en/v1.2.11/web3-eth-contract.html#methods-mymethod-call) syntax, can provide the missing information, assuming the blockchain's state has not changed much between calls. - -The whole process is: - -* Catch the exception, and check if the revert reason is part of the exception data. - -If not: - -* Repeat the same contract call using `.call()` syntax and parse the revert reason. - -Note that the second step should be performed as soon as possible, to ensure that the chain has a similar state in both calls. - -The function below demonstrates this process. - -```javascript -async function contractCall(account, to, gas, gasPrice, fnToEncode, nonce) { - let tx = {from: account.address, to, gas, gasPrice, data: fnToEncode.encodeABI(), nonce}; - let signedTx = await account.signTransaction(tx); - try { - return await web3.eth.sendSignedTransaction(signedTx.rawTransaction); - } catch (e) { - if (e.message.indexOf("Transaction has been reverted by the EVM") >= 0) { - // This call should throw a new exception containing the revert reason - await fnToEncode.call({ from: account.address }); - } - // Otherwise, either revert reason was already part of the original error or - // we failed to get any additional information. - throw e; - } -} -``` - -Where `account` and `fnToEncode` are obtained, for example, as follows: - -```javascript -let account = web3.eth.accounts.privateKeyToAccount(privateKey); -let fnToEncode = web3Contract.methods.someMethodOnContract(param1, param2); -``` diff --git a/docs/dev/tutorials/network-access/reliable-event-reading.md b/docs/dev/tutorials/network-access/reliable-event-reading.md deleted file mode 100644 index 31a8700a5..000000000 --- a/docs/dev/tutorials/network-access/reliable-event-reading.md +++ /dev/null @@ -1,11 +0,0 @@ -# Reliable Event Reading - -Subscription to events, for example using listeners, has proved to be unreliable, especially when high traffic exists on the network. - -To reliably read events it is recommended to use the [`getPastEvents`](https://web3js.readthedocs.io/en/v1.5.2/web3-eth-contract.html#getpastevents) function on web3 contracts. - -This function has parameters `fromBlock` and `toBlock` so the caller has to keep track of which blocks have already been requested. - -The number of blocks the user can request in a single RPC call depends on the configuration of the RPC node being used. -In particular, if the node is run with the environment variable `WEB3_API` set to `debug` (a so-called "full node"), usually 100 blocks of events can be read in one call. -On the other hand, if `WEB3_API` is set to `enabled` (a "light node") only 1 block of events can be read. diff --git a/docs/dev/tutorials/network-access/transaction-finalization.md b/docs/dev/tutorials/network-access/transaction-finalization.md deleted file mode 100644 index cf75a770a..000000000 --- a/docs/dev/tutorials/network-access/transaction-finalization.md +++ /dev/null @@ -1,27 +0,0 @@ -# Checking Transaction Finalization - -On Flare and Songbird, obtaining the receipt of a submitted transaction does not guarantee that the transaction is finalized. -One has to wait until the sender's account nonce (the total number of sent transactions) increases. - -The following function shows how to send a signed transaction and wait for its finalization. - -The function polls the current nonce up to 8 times before giving up, using an exponential backoff. -This means that the time spent between successive polls of the nonce is increased exponentially to avoid taxing the network too much. - -```javascript -async function sendAndFinalize(senderAddress, signedTx, delay = 1000) { - let oldNonce = await web3.eth.getTransactionCount(senderAddress); - let receipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction) - let backoff = 1.5; - let maxRetries = 8; - while ((await web3.eth.getTransactionCount(senderAddress)) == oldNonce) { - await new Promise((resolve) => {setTimeout(()=>{resolve()}, delay)}) - maxRetries--; - if(maxRetries == 0) { - throw new Error("Response timeout"); - } - delay = Math.floor(delay * backoff); - } - return receipt; -} -``` diff --git a/docs/dev/tutorials/sc/address-validity.md b/docs/dev/tutorials/sc/address-validity.md deleted file mode 100644 index 7a007a48a..000000000 --- a/docs/dev/tutorials/sc/address-validity.md +++ /dev/null @@ -1,265 +0,0 @@ -# Basic Attestation Request - -This tutorial shows basic use of the [State Connector](../../../tech/state-connector.md) protocol. - -In this tutorial, you will learn how to: - -* Make a query to the State Connector smart contract. -* Get the result from an attestation provider. -* Use a smart contract to verify that the result returned by the attestation provider matches the result agreed upon by the State Connector. - -The diagram below shows the process that this tutorial follows. -Arrows that match one of the steps in the tutorial are numbered. - -
- ![State Connector usage process](SC-basic-tutorial.png){ loading=lazy .allow-zoom } -
State Connector usage process
-
- -## Code - -For easy navigation, numbered comments in the source code (as in `// 1.`) link to the tutorial sections below. - -{% import "runner.md" as runner with context %} - -{{ runner.js(folder="sc/", filename="AddressValidity", params=[ - {"name": "Network (e.g. btc, eth)", "value": "btc"}, - {"name": "Address to Verify", "value":"tb1p4mdyx3dvgk4dhvv8yv2dtuymf00wxhgkkjheqm7526fu7znnd6msw3qxvj"} - ]) }} - -
- -## Tutorial - -### 1. Set up - -The tutorial uses the following dependencies: - -* The [Flare periphery artifacts package](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contract-artifacts), which provides the API for all Flare smart contracts. - -* The [ethers](https://www.npmjs.com/package/ethers) package, which is also needed to work with smart contracts. - -```javascript linenums="22" ---8<-- "./docs/samples/sc/AddressValidity.js:22:26" -``` - -The periphery package significantly simplifies working with the Flare smart contracts. -If you remove this dependency, you must manually provide the signatures for all the methods you want to use. - -This tutorial needs to send transactions on [the Coston test network](../../../tech/flare.md#flare-networks), so you will need an account with enough `$CFLR` tokens to pay for gas. -The [Getting Started](../../getting-started/setup/index.md) guides explain how to configure your wallet and get test tokens from the [faucet](https://faucet.flare.network/coston). - -!!! warning - For simplicity, this tutorial hard-codes the private key of the wallet being used in the `PRIVATE_KEY` variable. - - ```javascript linenums="10" - --8<-- "./docs/samples/sc/AddressValidity.js:10:11" - ``` - - In a production setting, the private key should be retrieved from an external source (such as a [`.env` file](https://www.npmjs.com/package/dotenv)) and NOT embedded directly in the code. - -### 2. Prepare Attestation Request - -Requests to the State Connector must be extremely specific. -For example, to request a proof that a given transaction exists, the transaction ID alone is not enough. -The block number and block timestamp where the transaction was included must also be provided. -Furthermore, requests must be encoded into a hex string before being submitted to the State Connector. - -You can perform all these operations yourself, but, as a convenience, attestation providers can prepare requests for you, filling in all missing information and taking care of formatting. - -The attestation type chosen for this tutorial, [`AddressValidity`](AddressValidity.md), is the simplest one and requires only the address to be validated. -However, it is still a good example of the process. - -To prepare a request using an Attestation Provider, begin with a raw attestation request: - -```javascript linenums="31" ---8<-- "./docs/samples/sc/AddressValidity.js:31:38" -``` - -The raw attestation request contains: - -* `attestationType`: A unique identifier for the type of attestation you want, which is just an encoded version of its name. - See the list of the currently available [attestation types](../../../apis/attestation-types/index.md). -* `sourceId`: The network on which you want to make the request. - Available networks depend on the attestation type and are listed in the documentation of each one. - This example uses the Coston test network, so network names are prepended with `test`. -* `requestBody`: A JSON object specific to each attestation type. - In this example, it is just the address that you want to validate. - -Then obtain an encoded attestation request: - -```javascript linenums="46" ---8<-- "./docs/samples/sc/AddressValidity.js:46:54" -``` - -This code performs a `POST` request to the [`prepareRequest`](../../../apis/REST/btcverifier.md?tag=AddressValidity&ctrl=BTCAddressValidityVerifierController&op=prepareRequest) endpoint of the attestation provider, using the standard [`fetch` API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). - -`ATTESTATION_PROVIDER_API_KEY` is the API key of the chosen attestation provider, if it needs one. -Attestation providers are typically paid services and require an API key to operate. - -Finally, `encodedAttestationRequest` is the returned encoded request ready to be submitted to the State Connector. - -### 3. Access Contract Registry - -The [`FlareContractRegistry`](FlareContractRegistry.md) contains the current addresses for all Flare smart contracts, and it is [the only recommended way](../../getting-started/contract-addresses.md) to retrieve them. - -Its address is the same on all of [Flare's networks](../../../tech/flare.md#flare-networks), and it is the only Flare address that needs to be hard-coded into any program. - -```javascript linenums="5" ---8<-- "./docs/samples/sc/AddressValidity.js:5:6" -``` - -```javascript linenums="65" ---8<-- "./docs/samples/sc/AddressValidity.js:65:69" -``` - -Note that this tutorial uses the Coston test network here rather than the main Flare Network. - -### 4. Retrieve the State Connector Contract Address - -Retrieve the State Connector's address from the `FlareContractRegistry`. - -```javascript linenums="72" ---8<-- "./docs/samples/sc/AddressValidity.js:72:78" -``` - -Use the [`getContractAddressByName()`](FlareContractRegistry.md#fn_getcontractaddressbyname_82760fca) method from the [`FlareContractRegistry`](FlareContractRegistry.md) smart contract to retrieve the address of the [`StateConnector`](IStateConnector.md) smart contract. - -### 5. Request Attestation from the State Connector Contract - -Now, request an attestation from the State Connector contract by sending the encoded attestation request from [step 2](#2-prepare-attestation-request). - -Use the [`requestAttestations()`](IStateConnector.md#fn_requestattestations_f64b6fda) method from the [`StateConnector`](IStateConnector.md) smart contract. - -```javascript linenums="82" ---8<-- "./docs/samples/sc/AddressValidity.js:82:86" -``` - -`attestationTx` contains the [`TransactionResponse`](https://docs.ethers.org/v5/api/providers/types/#providers-TransactionResponse). -After you `wait` on it and the transaction is added to the blockchain, you obtain a [`TransactionReceipt`](https://docs.ethers.org/v5/api/providers/types/#providers-TransactionReceipt). - -From this receipt you finally retrieve the `block` that includes the request transaction. -This block is needed in the next step. - -### 6. Calculate Round ID - -In order to recover the attestation result when it becomes available, you will need the _round ID_ where the request was submitted. -This is calculated from the block timestamp: - -```javascript linenums="89" ---8<-- "./docs/samples/sc/AddressValidity.js:89:93" -``` - -Attestation rounds last `roundDuration` seconds, starting `roundOffset` seconds after the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time). -You will use `submissionRoundID` later. - -!!! tip - - To optimize performance, consider caching the `roundOffset` and `roundDuration` values instead of retrieving them from the blockchain every time. - -### 7. Wait for the Attestation Round to Finalize - -You need to wait for the attestation round to finalize, because results are only available after finalization. - -```javascript linenums="98" ---8<-- "./docs/samples/sc/AddressValidity.js:98:110" -``` - -Attestation rounds use the [Collect-Choose-Commit-Reveal (CCCR)](../../../tech/state-connector.md#overlapped-cccr-protocol) protocol, which requires 270 - 360 seconds, depending on attestation provider's submissions, and the point inside the **Collect phase** in which the request was submitted. - -For this reason, this tutorial polls the State Connector's last finalized round ([`StateConnector.lastFinalizedRoundID`](IStateConnector.md#fn_lastfinalizedroundid_dd862157)) every 10 seconds so that results are obtained as soon as they are available. - -!!! note "Polling vs Waiting" - - Polling every 10 seconds is a good tradeoff to minimize the waiting time, but you can choose to always wait the maximum amount of time (360s), or even wait the minimum amount (270s), and then poll. - -!!! note "Proof Accessibility Window" - - Proofs are kept on-chain for just a week. - After this period, the proofs will no longer be accessible, so timely verification is crucial. - -### 8. Retrieve Proof - -It is time now to fetch from the attestation provider the result for the round ID where the request was submitted (`submissionRoundID`). - -The result is a [Merkle root](glossary.md#merkle_root), which is the root of a [Merkle tree](glossary.md#merkle_tree). -This tree has been constructed with the hashes of all the requests received during that round that were considered valid by a majority of attestation providers. - -If your request was valid, i.e., if the provided address was a valid Bitcoin address, then its hash will be part of the received Merkle root. - -```javascript linenums="113" ---8<-- "./docs/samples/sc/AddressValidity.js:113:127" -``` - -You need to construct a `proofRequest` and make a `POST` request to the [`get-specific-proof`](../../../apis/REST/attestation-client.md?tag=Proof&ctrl=ProofController&op=getSpecificProofController) endpoint of the attestation provider. - -Doing so returns, among other things, a Merkle proof consisting of one or more nodes (hashes). -If the Merkle tree is rebuilt using these nodes plus the hash of your request, and the resulting root hash matches the agreed-upon value stored in the State Connector, it means that the proof can be trusted. - -You can perform these operations yourself or you can use a verifier smart contract, as shown in the next step. - -The received proof already contains a field, `proof.data.responseBody.isValid`, which indicates whether this particular attestation provider believes the queried address to be valid or not. -But this result cannot be trusted until you verify that it matches what the rest of attestation providers submitted, as explained next. - -### 9. Send Proof to Verifier Contract - -Send the proof to the [`AddressValidityVerification`](AddressValidityVerification.md) smart contract. -This smart contract verifies the request by rebuilding the Merkle root using the hashes contained in the `proof.data.merkleProof` object and comparing it to the Merkle root stored in the State Connector. - -```javascript linenums="136" ---8<-- "./docs/samples/sc/AddressValidity.js:136:155" -``` - -`isVerified` contains the result of the verification, analyzed next. - -!!! note - This tutorial uses a verification contract provided by Flare, but dapps can embed the same logic into their own smart contracts if they wish to. - -### 10. Check if the Address is Valid - -Finally, check if the address is valid or invalid according to the attestation providers, but only if the attestation has been verified. - -`isVerified` indicates whether the attestation you received from the attestation provider matches what the majority of them agreed upon. -If the value is `false`, you do not need to look further because the attestation provider is probably lying and its results cannot be trusted. -In this case, you need to make the request again, ideally through a different provider. - -If `isVerified` is `true`, then you can look at the actual result of your request in the [`isValid`](AddressValidity.md#response-body) field of `fullProof.data.responseBody` obtained in [step 8](#8-retrieve-proof). -If this value is `true` too, then the queried address is valid. - -```javascript linenums="159" ---8<-- "./docs/samples/sc/AddressValidity.js:159:169" -``` - -
- -## Conclusion - -This tutorial has shown how to: - -* Prepare a State Connector request using the [`prepareRequest`](../../../apis/REST/btcverifier.md?tag=AddressValidity&ctrl=BTCAddressValidityVerifierController&op=prepareRequest) REST endpoint of an attestation provider. -* Make a request to the State Connector smart contract using [`requestAttestations()`](IStateConnector.md#fn_requestattestations_f64b6fda). -* Get the result from an attestation provider by making a `POST` request to the [`get-specific-proof`](../../../apis/REST/attestation-client.md?tag=Proof&ctrl=ProofController&op=getSpecificProofController) REST endpoint. -* Use the [`AddressValidityVerification`](AddressValidityVerification.md) smart contract to verify that the result returned by the attestation provider matches the result agreed upon by the State Connector. - -## Next Steps - -The State Connector can be used for a host of other things beyond just verifying address correctness. -The attestation type of the request selects the type of information you want. - -```javascript linenums="33" ---8<-- "./docs/samples/sc/AddressValidity.js:33:33" -``` - -Other attestation types include: - -* [**Payment**](Payment.md): Verifies whether a payment transaction occurred in which funds were sent from one address to another address. -* [**Balance-decreasing transaction**](BalanceDecreasingTransaction.md): Verifies whether a transaction that might have decreased a balance occurred. -* [**Referenced payment nonexistence**](ReferencedPaymentNonexistence.md): Verifies whether an account did not receive funds from a different account by a specific deadline. -* [**Confirmed block height**](ConfirmedBlockHeightExists.md): Verifies whether a block on a certain height exists and was confirmed. - -More attestation types are to be added in the future, subject to community approval and support. - -Also, recall that the [`AddressValidity`](AddressValidity.md) attestation type used in this tutorial is the simplest one to use as it does not require accessing any connected networks. -Other attestation types do, however, and so they tend to be more complex to use. - -See the [state connector attestation types](../../../apis/attestation-types/index.md) for more information on other attestation types. \ No newline at end of file diff --git a/docs/dev/tutorials/sc/evm-transaction.md b/docs/dev/tutorials/sc/evm-transaction.md deleted file mode 100644 index 67d92598b..000000000 --- a/docs/dev/tutorials/sc/evm-transaction.md +++ /dev/null @@ -1,261 +0,0 @@ -# Fetch EVM Transactions - -This tutorial is almost identical to the [Basic Attestation Request](./address-validity.md) one, and shows how to use the [State Connector](../../../tech/state-connector.md) protocol to retrieve information about a transaction that happened on a different EVM blockchain. - -In this tutorial, you will learn how to: - -* Make a query to the State Connector smart contract. -* Get the result from an attestation provider. -* Use a smart contract to verify that the result returned by the attestation provider matches the result agreed upon by the State Connector. - -The diagram below shows the process that this tutorial follows. -Arrows that match one of the steps in the tutorial are numbered. - -
- ![State Connector usage process](SC-basic-tutorial.png){ loading=lazy .allow-zoom } -
State Connector usage process
-
- -## Code - -For easy navigation, numbered comments in the source code (as in `// 1.`) link to the tutorial sections below. - -{% import "runner.md" as runner with context %} - -{{ runner.js(folder="sc/", filename="EVMTransaction", params=[ - {"name": "Network (e.g. eth, sgb)", "value": "eth"}, - {"name": "Transaction Hash to retrieve", "value":"0x58d98ffe5f960f63ac55184ef5215f5cf2c1ab1983ac3c11a39e24477299170d"} - ]) }} - -
- -## Tutorial - -### 1. Set up - -The tutorial uses the following dependencies: - -* The [Flare periphery artifacts package](https://www.npmjs.com/package/@flarenetwork/flare-periphery-contract-artifacts), which provides the API for all Flare smart contracts. - -* The [ethers](https://www.npmjs.com/package/ethers) package, which is also needed to work with smart contracts. - -```javascript linenums="23" ---8<-- "./docs/samples/sc/EVMTransaction.js:23:27" -``` - -The periphery package significantly simplifies working with the Flare smart contracts. -If you remove this dependency, you must manually provide the signatures for all the methods you want to use. - -This tutorial needs to send transactions on [the Coston test network](../../../tech/flare.md#flare-networks), so you will need an account with enough `$CFLR` tokens to pay for gas. -The [Getting Started](../../getting-started/setup/index.md) guides explain how to configure your wallet and get test tokens from the [faucet](https://faucet.flare.network/coston). - -!!! warning - For simplicity, this tutorial hard-codes the private key of the wallet being used in the `PRIVATE_KEY` variable. - - ```javascript linenums="11" - --8<-- "./docs/samples/sc/EVMTransaction.js:11:12" - ``` - - In a production setting, the private key should be retrieved from an external source (such as a [`.env` file](https://www.npmjs.com/package/dotenv)) and NOT embedded directly in the code. - -### 2. Prepare Attestation Request - -Requests to the State Connector must be extremely specific. -For example, to request a proof that a given transaction exists, the transaction ID alone is not enough. -The block number and block timestamp where the transaction was included must also be provided. -Furthermore, requests must be encoded into a hex string before being submitted to the State Connector. - -You can perform all these operations yourself, but, as a convenience, attestation providers can prepare requests for you, filling in all missing information and taking care of formatting. - -The attestation type chosen for this tutorial, [`EVMTransaction`](EVMTransaction.md), requires the hash of the transaction to retrieve and a bit of configuration to select the retrieved information. - -To prepare a request using an Attestation Provider, begin with a raw attestation request: - -```javascript linenums="32" ---8<-- "./docs/samples/sc/EVMTransaction.js:32:43" -``` - -The raw attestation request contains: - -* `attestationType`: A unique identifier for the type of attestation you want, which is just an encoded version of its name. - See the list of the currently available [attestation types](../../../apis/attestation-types/index.md). -* `sourceId`: The network on which you want to make the request. - Available networks depend on the attestation type and are listed in the documentation of each one. - This example uses the Coston test network, so network names are prepended with `test`. -* `requestBody`: A JSON object specific to each attestation type. - In this example, it is an [`EVMTransaction`](EVMTransaction.md) object. - -Then obtain an encoded attestation request: - -```javascript linenums="51" ---8<-- "./docs/samples/sc/EVMTransaction.js:51:59" -``` - -This code performs a `POST` request to the [`prepareRequest`](../../../apis/REST/evmverifier.md?tag=EVMTransaction&ctrl=ETHEVMTransactionVerifierController&op=prepareRequest) endpoint of the attestation provider, using the standard [`fetch` API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). - -`VERIFIER_API_KEY` is the API key of the chosen attestation provider, if it needs one. -Attestation providers are typically paid services and require an API key to operate. - -Finally, `encodedAttestationRequest` is the returned encoded request ready to be submitted to the State Connector. - -### 3. Access Contract Registry - -The [`FlareContractRegistry`](FlareContractRegistry.md) contains the current addresses for all Flare smart contracts, and it is [the only recommended way](../../getting-started/contract-addresses.md) to retrieve them. - -Its address is the same on all of [Flare's networks](../../../tech/flare.md#flare-networks), and it is the only Flare address that needs to be hard-coded into any program. - -```javascript linenums="6" ---8<-- "./docs/samples/sc/EVMTransaction.js:6:7" -``` - -```javascript linenums="70" ---8<-- "./docs/samples/sc/EVMTransaction.js:70:74" -``` - -Note that this tutorial uses the Coston test network here rather than the main Flare Network. - -### 4. Retrieve the State Connector Contract Address - -Retrieve the State Connector's address from the `FlareContractRegistry`. - -```javascript linenums="77" ---8<-- "./docs/samples/sc/EVMTransaction.js:77:83" -``` - -Use the [`getContractAddressByName()`](FlareContractRegistry.md#fn_getcontractaddressbyname_82760fca) method from the [`FlareContractRegistry`](FlareContractRegistry.md) smart contract to retrieve the address of the [`StateConnector`](IStateConnector.md) smart contract. - -### 5. Request Attestation from the State Connector Contract - -Now, request an attestation from the State Connector contract by sending the encoded attestation request from [step 2](#2-prepare-attestation-request). - -Use the [`requestAttestations()`](IStateConnector.md#fn_requestattestations_f64b6fda) method from the [`StateConnector`](IStateConnector.md) smart contract. - -```javascript linenums="87" ---8<-- "./docs/samples/sc/EVMTransaction.js:87:91" -``` - -`attestationTx` contains the [`TransactionResponse`](https://docs.ethers.org/v5/api/providers/types/#providers-TransactionResponse). -After you `wait` on it and the transaction is added to the blockchain, you obtain a [`TransactionReceipt`](https://docs.ethers.org/v5/api/providers/types/#providers-TransactionReceipt). - -From this receipt you finally retrieve the `block` that includes the request transaction. -This block is needed in the next step. - -### 6. Calculate Round ID - -In order to recover the attestation result when it becomes available, you will need the _round ID_ where the request was submitted. -This is calculated from the block timestamp: - -```javascript linenums="94" ---8<-- "./docs/samples/sc/EVMTransaction.js:94:98" -``` - -Attestation rounds last `roundDuration` seconds, starting `roundOffset` seconds after the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time). -You will use `submissionRoundID` later. - -!!! tip - - To optimize performance, consider caching the `roundOffset` and `roundDuration` values instead of retrieving them from the blockchain every time. - -### 7. Wait for the Attestation Round to Finalize - -You need to wait for the attestation round to finalize, because results are only available after finalization. - -```javascript linenums="103" ---8<-- "./docs/samples/sc/EVMTransaction.js:103:115" -``` - -Attestation rounds use the [Collect-Choose-Commit-Reveal (CCCR)](../../../tech/state-connector.md#overlapped-cccr-protocol) protocol, which requires 270 - 360 seconds, depending on attestation provider's submissions, and the point inside the **Collect phase** in which the request was submitted. - -For this reason, this tutorial polls the State Connector's last finalized round ([`StateConnector.lastFinalizedRoundID`](IStateConnector.md#fn_lastfinalizedroundid_dd862157)) every 10 seconds so that results are obtained as soon as they are available. - -!!! note "Polling vs Waiting" - - Polling every 10 seconds is a good tradeoff to minimize the waiting time, but you can choose to always wait the maximum amount of time (360s), or even wait the minimum amount (270s), and then poll. - -!!! note "Proof Accessibility Window" - - Proofs are kept on-chain for just a week. - After this period, the proofs will no longer be accessible, so timely verification is crucial. - -### 8. Retrieve Proof - -It is time now to fetch from the attestation provider the result for the round ID where the request was submitted (`submissionRoundID`). - -The result is a [Merkle root](glossary.md#merkle_root), which is the root of a [Merkle tree](glossary.md#merkle_tree). -This tree has been constructed with the hashes of all the requests received during that round that were considered valid by a majority of attestation providers. - -If your request was valid, i.e., if a transaction with the provided hash was found on the requested network, then the hash of the request will be part of the received Merkle root. - -```javascript linenums="118" ---8<-- "./docs/samples/sc/EVMTransaction.js:118:132" -``` - -You need to construct a `proofRequest` and make a `POST` request to the [`get-specific-proof`](../../../apis/REST/attestation-client.md?tag=Proof&ctrl=ProofController&op=getSpecificProofController) endpoint of the attestation provider. - -Doing so returns, among other things, a Merkle proof consisting of one or more nodes (hashes). -If the Merkle tree is rebuilt using these nodes plus the hash of your request, and the resulting root hash matches the agreed-upon value stored in the State Connector, it means that the proof can be trusted. - -You can perform these operations yourself or you can use a verifier smart contract, as shown in the next step. - -The received proof already contains a field, `proof.data.responseBody`, which contains the requested transaction's content, as seen by this particular attestation provider. -But this result cannot be trusted until you verify that it matches what the rest of attestation providers submitted, as explained next. - -### 9. Send Proof to Verifier Contract - -Send the proof to the [`EVMTransactionVerification`](EVMTransactionVerification.md) smart contract. -This smart contract verifies the request by rebuilding the Merkle root using the hashes contained in the `proof.data.merkleProof` object and comparing it to the Merkle root stored in the State Connector. - -```javascript linenums="141" ---8<-- "./docs/samples/sc/EVMTransaction.js:141:160" -``` - -`isVerified` contains the result of the verification, analyzed next. - -!!! note - This tutorial uses a verification contract provided by Flare, but dapps can embed the same logic into their own smart contracts if they wish to. - -### 10. Check if the Address is Valid - -Finally, check if the transaction could be retrieved and all attestation providers agree on its contents, but only if the attestation has been verified. - -`isVerified` indicates whether the attestation you received from the attestation provider matches what the majority of them agreed upon. -If the value is `false`, you do not need to look further because the attestation provider is probably lying and its results cannot be trusted. -In this case, you need to make the request again, ideally through a different provider. - -If `isVerified` is `true`, then you can look at the actual result of your request in the [`responseBody`](EVMTransaction.md#response-body) field of `fullProof.data` obtained in [step 8](#8-retrieve-proof). - -```javascript linenums="164" ---8<-- "./docs/samples/sc/EVMTransaction.js:164:171" -``` - -
- -## Conclusion - -This tutorial has shown how to: - -* Prepare a State Connector request using the [`prepareRequest`](../../../apis/REST/evmverifier.md?tag=EVMTransaction&ctrl=ETHEVMTransactionVerifierController&op=prepareRequest) REST endpoint of an attestation provider. -* More precisely, make an [`EVMTransaction`](EVMTransaction.md) request that retrieves information about a transaction that happened on another blockchain. -* Make a request to the State Connector smart contract using [`requestAttestations()`](IStateConnector.md#fn_requestattestations_f64b6fda). -* Get the result from an attestation provider by making a `POST` request to the [`get-specific-proof`](../../../apis/REST/attestation-client.md?tag=Proof&ctrl=ProofController&op=getSpecificProofController) REST endpoint. -* Use the [`EVMTransactionVerification`](EVMTransactionVerification.md) smart contract to verify that the result returned by the attestation provider matches the result agreed upon by the State Connector. - -## Next Steps - -The State Connector can be used for a host of other things beyond retrieving transactions from other blockchains. -The attestation type of the request selects the type of information you want. - -```javascript linenums="34" ---8<-- "./docs/samples/sc/EVMTransaction.js:34:34" -``` - -Other attestation types include: - -* [**Payment**](Payment.md): Verifies whether a payment transaction occurred in which funds were sent from one address to another address. -* [**Balance-decreasing transaction**](BalanceDecreasingTransaction.md): Verifies whether a transaction that might have decreased a balance occurred. -* [**Referenced payment nonexistence**](ReferencedPaymentNonexistence.md): Verifies whether an account did not receive funds from a different account by a specific deadline. -* [**Confirmed block height**](ConfirmedBlockHeightExists.md): Verifies whether a block on a certain height exists and was confirmed. - -More attestation types are to be added in the future, subject to community approval and support. - -See the [state connector attestation types](../../../apis/attestation-types/index.md) for more information on other attestation types. diff --git a/docs/dev/tutorials/sc/index.md b/docs/dev/tutorials/sc/index.md deleted file mode 100644 index 363102e43..000000000 --- a/docs/dev/tutorials/sc/index.md +++ /dev/null @@ -1,8 +0,0 @@ -# State Connector Tutorials - -These tutorials contain code samples and explanations that show how to use the [State Connector](../../../tech/state-connector.md). - -## Tutorials - -* [Basic Attestation Request](./address-validity.md) -* [Fetch EVM Transactions](./evm-transaction.md) diff --git a/docs/developer-hub.md b/docs/developer-hub.md new file mode 100644 index 000000000..4c1d2a839 --- /dev/null +++ b/docs/developer-hub.md @@ -0,0 +1,3 @@ +# Developer Hub + +Flare’s developer documentation has been moved to the [Flare Developer Hub](https://dev.flare.network/). diff --git a/docs/exchange/architecture.md b/docs/exchange/architecture.md deleted file mode 100644 index 23fddb593..000000000 --- a/docs/exchange/architecture.md +++ /dev/null @@ -1,147 +0,0 @@ -# Architecture of an Exchange - -What follows is the suggested architecture for a centralized Exchange. Even if your Exchange does not adopt this exact design, it defines the concepts that are used throughout the other pages in this section. - -## General Structure - -The suggested architecture uses a **Central Exchange wallet** with multiple **User reception wallets** controlled by the Exchange. - -
- ![General structure of an Exchange](exchanges-general.png){ loading=lazy .allow-zoom } -
General structure of an Exchange.
-
- -### Exchange's Central Wallet (Hot) - -This account contains the Exchange's funds required to perform user operations: Users' deposits are ultimately routed here, and users' withdrawals are taken from here. - -The private keys to this account need to be on an online machine (the [Exchange server](#exchange-server)) so this is considered a **hot wallet**. For security reasons, it is recommended that the hot wallet only contains enough funds to perform daily operations, whereas the bulk of the funds are kept in the [cold wallet](#exchanges-central-wallet-cold). - -### Exchange's Central Wallet (Cold) - -The private keys to this account are kept in an offline machine so it is less vulnerable to attacks. Moreover, it is recommended that this is a multi-signature account so the approval of more than one administrator is required to move funds from it. - -Periodically (e.g., once a day) funds are transferred from or to the [hot wallet](#exchanges-central-wallet-hot) so it can continue operating while the bulk of the funds are protected in the cold wallet. - -### Users' Reception Wallets - -When users sign up with the Exchange, a reception wallet is created for them in order to perform deposits. The reception wallets are usually empty: as soon as they receive funds these are transferred to the [Exchange's hot wallet](#exchanges-central-wallet-hot). - -The private keys to the reception wallets always remain under the Exchange's control; these wallets are offered to users as a convenience only. Users cannot perform any operation on these wallets other than deposits. - -### User's Wallet - -This is the origin of deposits made to the Exchange and the receiver of withdrawals made from the Exchange. It can be a wallet in control of the user (the user holds its private key), a custodial wallet or another Exchange, for example. - -### Exchange Server - -This is an online server, part of the Exchange's infrastructure, that receives withdrawal requests from users and monitors the reception wallets to detect incoming deposits. It holds the private keys to the [hot wallet](#exchanges-central-wallet-hot) and to all the [reception wallets](#users-reception-wallets) so it can move funds from them in response to user's requests. - -!!! warning - This server must be available 24/7 so it is a clear target for malicious actors. - -### Balances DB - -This database keeps track of every user's funds, since the actual tokens from all users are pooled together in the hot and cold wallets. - -The [Exchange server](#exchange-server) updates this DB in response to user's deposits and withdrawals. - -### Flare Observer Node - -An observer node is a regular Flare node that does not partake in [consensus](glossary.md#consensus) but is still aware of the current state of the blockchain and allows submitting transactions. **It is highly recommended** that Exchanges deploy their own observer nodes to access the network, instead of relying on third-party services. Read the [Deploying an Observer Node](../infra/observation/deploying.md) guide to learn how to do this. - -## Detecting Deposits - -The [Exchange server](#exchange-server) must be continuously monitoring transfers into **ALL** [reception wallets](#users-reception-wallets) to detect incoming deposits. Here's a summary of the process: - -
- ![Depositing to an Exchange](exchanges-deposits.png){ loading=lazy .allow-zoom } -
Depositing to an Exchange.
-
- -1. The user **deposits** (transfers) funds to their assigned [reception wallet](#users-reception-wallets). - -2. The transaction is **detected** by the [Exchange server](#exchange-server) monitoring the wallets. - - The server can discover a new transaction as soon as it is submitted by **subscribing** to the `pendingTransactions` event. This allows showing the transaction as "pending" in the UI, but there is still a chance that it is reverted. - - To avoid problems, the Exchange should only act on transactions appearing on blocks **old enough** for the chance of them being reverted to be negligible. This can be done by subscribing to the `newBlockHeaders` event and examining the transactions in a previous block (for example, 5 blocks behind). - - The code below exemplifies this process ([See the web3.js documentation](https://web3js.readthedocs.io) for the API details): - - ``` typescript - // https://web3js.readthedocs.io - const Web3 = require('web3'); - - // Use your own node URL - // https://docs.flare.network/dev/reference/coston-testnet/ - const web3 = new Web3("wss://coston-api.flare.network/ext/bc/C/ws"); - - // Use your receiving wallet address - const receivingAddress = "0x947c76694491d3fD67a73688003c4d36C8780A97"; - - web3.eth.subscribe("pendingTransactions") - .on("data", async (transactionHash) => { - // New transaction hash received. - // Retrieve the actual transaction. - let tx = await web3.eth.getTransaction(transactionHash); - // If it is directed to our address... - if (tx.to === receivingAddress) { - // Mark it as pending. - console.log("Transaction", tx.hash, "is pending"); - } - }).on("error", console.error); - - web3.eth.subscribe("newBlockHeaders") - .on("data", async (blockHeader) => { - // New block has been produced. - // Retrieve a block old enough to be considered confirmed. - let block = await web3.eth.getBlock(blockHeader.number - 5); - - // Get all its transactions. - block.transactions.forEach(async (transactionHash) => { - // Retrieve the actual transaction. - let tx = await web3.eth.getTransaction(transactionHash); - // If it is directed to our address... - if (tx.to === receivingAddress) { - // Mark it as confirmed. - console.log("Transaction", tx.hash, - "is confirmed in block", block.number); - } - }); - }).on("error", console.error); - ``` - - !!! warning - Note that all transactions from a block are retrieved **simultaneously** and this can easily trigger a rate limit on the node. A proper implementation should avoid this by **serializing requests** or **managing the request rate manually**. - -3. The server then **checks the wallet address** to find which user account it belongs to, and **adds the received amount to the user's balance**. - -4. The server **announces a transaction** to the network (through the Exchange's own [observer node](#flare-observer-node)) to move the received funds to the [hot wallet](#exchanges-central-wallet-hot). - - [See a JavaScript example in the Ethereum documentation](https://ethereum.org/en/developers/tutorials/sending-transactions-using-web3-and-alchemy/). Since you will be using your own node, you can skip the Alchemy part and directly use the `web3` package as in the example above. - -5. The received funds are **transferred to the hot wallet** when the transaction is approved by the network. The reception wallets always remain empty. - -## Performing Withdrawals - -Users must request withdrawals directly to the [Exchange server](#exchange-server) **through its user interface**. After checking that the user has the required balance, the funds are transferred from the Exchange's hot wallet directly to the user's wallet. Here's a summary of the process: - -
- ![Withdrawing from an Exchange](exchanges-withdrawals.png){ loading=lazy .allow-zoom } -
Withdrawing from an Exchange.
-
- -1. The user **requests a withdrawal** to the [Exchange server](#exchange-server). The request includes some kind of user ID, the requested amount and the destination wallet's address. - -2. The server **checks** that the user has the required balance to perform the withdrawal. - -3. The server **announces a transaction** to the network (through the Exchange's own [observer node](#flare-observer-node)) to move the requested funds from the [hot wallet](#exchanges-central-wallet-hot) to the requested destination address. - - [See a JavaScript example in the Ethereum documentation](https://ethereum.org/en/developers/tutorials/sending-transactions-using-web3-and-alchemy/). Since you will be using your own node, you can skip the Alchemy part and directly use the `web3` package as in the example above. - - !!! warning - Please make sure you **sign the transaction** before submitting it, as shown in the example. - Unsigned transactions are ignored by the network. - -4. The requested funds are **transferred to the user's wallet** when the transaction is approved by the network. diff --git a/docs/exchange/delegation.md b/docs/exchange/delegation.md deleted file mode 100644 index b0d050ae5..000000000 --- a/docs/exchange/delegation.md +++ /dev/null @@ -1,46 +0,0 @@ -# Delegating on the User's Behalf - -Delegation is one of the multiple ways in which the Flare blockchain rewards participants of the ecosystem. -In particular, delegation allows token holders to put their stake behind an FTSO [data provider](glossary.md#data_provider) to increase its relative weight (See the [FTSO page](../tech/ftso.md#delegation) for more information). -In return, each time a data provider submits useful information it **shares its reward with all the token holders that delegated to it**. - -The [Delegation Guide](../user/delegation/index.md) details this process for users. -However, since Exchanges keep user's tokens, only Exchanges can perform delegation. -If you are an Exchange and want to offer your users the ability to earn rewards by delegation, this page summarizes the process and explains how to perform it on the user's behalf. - -## Introduction - -Flare (and Songbird) accounts can delegate **any percentage they choose** of their tokens to **one or two FTSO data providers**. - -This limitation means that, if your Exchange keeps all users' tokens in **a single wallet** (as described in the [Architecture of an Exchange](./architecture.md) page), you cannot give your users the option to select the data provider they want to delegate to: **The wallet containing all tokens can only delegate to one (or two) data providers**. - -Keeping this in mind, this page explains how to delegate the users' tokens and collect the rewards. - -!!! note "Reward Epochs" - As shown later, several features of the delegation mechanism are timed in **Reward Epochs**. - - * On Songbird, these epochs last 7 days and start every **Saturday at around 8:40AM UTC**. - * On Flare, they last 3.5 days and start roughly every **Monday at 7:00 UTC and Thursday at 19:00 UTC**. - -## Selecting a Data Provider - -It is the Exchange that must select the FTSO [data provider](glossary.md#data_provider) upon which to delegate, so the first step is to choose the one you are most confident to provide **consistently good data** (and therefore higher rewards). - -Anyone can become an FTSO data provider, but only the ones that had the most [voting power](glossary.md#vote-power) during the previous reward epoch are available for delegation. - -The list of **available data providers** for the current reward epoch can be retrieved from the `VoterWhitelister` smart contract, method `getFtsoWhitelistedPriceProviders`. -There exist a number of websites like [flaremetrics.io](https://flaremetrics.io/) or [ftso-signal-providers](https://github.com/TowoLabs/ftso-signal-providers) that display this information in a far more convenient way. - -!!! note - Data providers [take a fee](../tech/ftso.md#rewards) before sharing their rewards with their delegators. - An Exchange can decide to **run its own data provider** to avoid paying this fee to an external entity, at the cost of having to **develop a good price prediction algorithm**. - - Keep in mind that FTSO data providing is already a very competitive business, and only the most successful algorithms are being rewarded. - -Lastly, delegations can be changed at any time, but they are only taken into account **once per reward epoch** (See more details in the [FTSO](../tech/ftso.md#vote-power) page). -Therefore, depending on the time it is submitted, **a new delegation will not take effect until the beginning of the next reward epoch, or the one after that**. -Furthermore, rewards cannot be collected until **another reward epoch has elapsed**. - -## Delegation Process - -See [Manual Delegation and Claiming](../tech/ftso.md#manual-delegation-and-claiming) in the FTSO page. diff --git a/docs/exchange/index.md b/docs/exchange/index.md deleted file mode 100644 index 92ba20198..000000000 --- a/docs/exchange/index.md +++ /dev/null @@ -1,48 +0,0 @@ -# Exchange Guides - -This section contains information and bits of advice for Exchanges willing to support the Flare blockchain. - -The first thing you should know is that: - -!!! tip "Flare is used just like Ethereum!" - - Even though the node code is different, Flare offers the same API as Ethereum so you can integrate with it in the same way. - - * [Deploy a Flare Observer node](../infra/observation/deploying.md) to access the network. - * [Use the appropriate Chain ID](../dev/reference/network-config.md). - * Use standard Ethereum libraries like [web3.js](https://web3js.readthedocs.io/) if you want. - -## Quick Information about Flare - -| | | -| --------------------------------------- | ----------------------------------------------------------------------------------- | -| **Website address** | [flare.network](https://flare.network) | -| **Brand assets** | [Google Drive][brand-assets] | -| **[Rosetta][rosetta-api] API endpoint** | `https://flare-rosetta-api.flare.network/` | -| **Node source code** | [github.com/flare-foundation/flare][github] | -| **Node installation documentation** | [docs.flare.network/infra/observation/deploying](../infra/observation/deploying.md) | -| **Node requirements** | 8 CPU, 16 GB RAM, 2 TB disk space | -| **Maximum block rate** | 1 block/second. | -| **Token names** | `FLARE`, `SONGBIRD` | -| **Tickers** | `FLR`, `SGB` | -| **Tokens precision** | 18 decimal places | -| **Supported wallets** | [docs.flare.network/user/wallets](../user/wallets/index.md) | - -[brand-assets]: https://drive.google.com/drive/folders/1mPrtIBb2k88E4f1fguEm3eAXLW74xOry?usp=sharing -[github]: https://github.com/flare-foundation/flare -[rosetta-api]: - -Network configuration information, including: - -* [Flare Networks Configuration Values](../dev/reference/network-config.md#flare-networks) -* [RPC Nodes for Connected Chains](../dev/reference/network-config.md#connected-networks) - -!!! note - - The `$FLR` and `$SGB` tokens are **not** [ERC-20](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) tokens: they are the **native currency** of **Flare** (the [Main network](glossary.md#main_network)) and **Songbird** (The [Canary network](glossary.md#canary_network)) respectively. As such, these tokens are handled the same way `$ETH` is handled on the Ethereum blockchain. - -Select one of the topics below: - -* [Architecture of an Exchange](./architecture.md) -* [Delegating on the User's Behalf](./delegation.md) -* [Troubleshooting Guide](./troubleshooting.md) diff --git a/docs/exchange/troubleshooting.md b/docs/exchange/troubleshooting.md deleted file mode 100644 index 9cd0e35a0..000000000 --- a/docs/exchange/troubleshooting.md +++ /dev/null @@ -1,9 +0,0 @@ -# Troubleshooting Guide - -This page contains links to other sections answering the most common support requests received when integrating with the Flare network. - -* [Regarding Node Deployment](../infra/observation/deploying.md#5-maintaining-a-healthy-node) - -* [Regarding Delegation](../user/delegation/managing-delegations.md) - -* [Regarding Reward Claiming](../user/delegation/managing-rewards.md) diff --git a/docs/get-started-building/index.md b/docs/get-started-building/index.md deleted file mode 100644 index 23fe1e019..000000000 --- a/docs/get-started-building/index.md +++ /dev/null @@ -1,17 +0,0 @@ -# Get Started Building - -The following collections of guides provide information to quickly start developing on the Flare networks. - -!!! warning "Only EVM versions up to London are currently supported" - - All Flare networks support only EVM versions up to London. - - Learn how to set the EVM version in your compiler in [the Solidity documentation](https://docs.soliditylang.org/en/latest/using-the-compiler.html#setting-the-evm-version-to-target). - [Example of how to do this using Hardhat](https://github.com/flare-foundation/flare-hardhat-starter/blob/master/hardhat.config.ts#L32). - -## Guides - -* [Getting started](../dev/getting-started/index.md) -* [Network Configuration](../dev/tutorials/network-access/index.md) -* [External learning resources](../dev/external-resources.md) -* [Tooling](../dev/tools.md) diff --git a/docs/index.md b/docs/index.md index b29d93448..cfe6c273e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -26,63 +26,6 @@ Quick links:
-#### For developers - -
- -
- -## Get Started Building - -Information to quickly start developing on the Flare networks - - -
- -
- -## Developer Guides - -In-depth information about the Flare networks - - -
- -
- -## API Reference - -in-depth information about the Flare smart contracts APIs - - -
- -
- #### For everyone
diff --git a/docs/infra/attestation/index.md b/docs/infra/attestation/index.md deleted file mode 100644 index 0617556ef..000000000 --- a/docs/infra/attestation/index.md +++ /dev/null @@ -1,7 +0,0 @@ -# Attestation Providers - -The following guides explain how to provide the infrastructure required for the [State Connector](../../tech/state-connector.md). - -Select one of the guides below: - -* [Operating an Attestation Provider](./operating.md) diff --git a/docs/infra/attestation/operating.md b/docs/infra/attestation/operating.md deleted file mode 100644 index 871f64192..000000000 --- a/docs/infra/attestation/operating.md +++ /dev/null @@ -1,6 +0,0 @@ -# Operating an Attestation Provider - -Anyone can operate an attestation provider without any capital requirement (see the [attestation-client repository](https://github.com/flare-foundation/attestation-client) for deployment information), which can readily be used as a **local provider** on validators that trust it. - -To be included in the [default set](../../tech/state-connector.md#attestation-provider-sets), though, the same operator must run one of the **top-performing [FTSO](glossary.md#ftso) data providers** to prove its commitment to the network's well-being. -More details will be added soon. diff --git a/docs/infra/data/managing-ecosystem/index.md b/docs/infra/data/managing-ecosystem/index.md index 6f9eab826..21cb6ff9a 100644 --- a/docs/infra/data/managing-ecosystem/index.md +++ b/docs/infra/data/managing-ecosystem/index.md @@ -33,10 +33,8 @@ The `PollingFtso` contract handles interactions such as managing group members, The following procedure explains how to interact directly with this contract. However, if you prefer a simpler interface, the Flare community is developing front-ends to facilitate the interactions, such as [Flaremetrics](https://flaremetrics.io/ftso/proposals). -1. Open a [block explorer](../../../user/block-explorers/index.md) for the appropriate network. -2. Follow the [Retrieval from Blockchain procedure](../../../dev/getting-started/contract-addresses.md#retrieval-from-blockchain) to find and open the `PollingFtso` contract. - The **Contract Address Details** page is displayed. -3. Optional: If you need to call a method in the **Write** tab, click the **Write Contract** tab, click **Connect Wallet**, and complete the steps to connect your wallet. +1. Find the address of the `PollingFtso` contract in the [Developer Hub](https://dev.flare.network). +2. Open a block explorer for the appropriate network and go to the `PollingFtso` address. After the `PollingFtso` contract is open in the explorer, you can complete operations to manage members and chill proposals. diff --git a/docs/infra/data/operating.md b/docs/infra/data/operating.md index 92141952f..2fabeb580 100644 --- a/docs/infra/data/operating.md +++ b/docs/infra/data/operating.md @@ -69,7 +69,7 @@ Other useful contracts are: * `FtsoManager`: Holds epoch and voting-related configuration data, oversees all FTSOs, and gives access to additional useful contracts, such as the `Inflation` and `Supply` contracts. * `VoterWhitelister`: Accepts the names of data providers that list themselves to submit data. -Find these contract's addresses in the [Contract Addresses](../../dev/getting-started/contract-addresses.md) page. +Find these contract addresses in the [Developer Hub](https://dev.flare.network/). ## Generating Random Numbers diff --git a/docs/infra/data/whitelisting.md b/docs/infra/data/whitelisting.md index 03b6b9b15..7d7120e3c 100644 --- a/docs/infra/data/whitelisting.md +++ b/docs/infra/data/whitelisting.md @@ -11,7 +11,7 @@ Increased vote power on a different block will not enable your address to be whi Vote power is only read and whitelists updated once per reward epoch. Reward epochs start roughly on Saturdays at 8:40AM UTC on Songbird, and on Monday at 7:00 UTC and Thursday at 19:00 UTC on Flare. Whitelisting a data provider is a fully decentralized process facilitated by the `VoterWhitelister` contract. -To retrieve this contract, see [Contract Addresses](../../dev/getting-started/contract-addresses.md). +To retrieve this contract, see [Developer Hub](https://dev.flare.network/). To be added to the whitelist, submit a request for your address by using one of the functions listed in the next section. When the whitelist is not full, your address is immediately added to it. diff --git a/docs/infra/fassets/deploying-agent.md b/docs/infra/fassets/deploying-agent.md index 608ef9d4c..a4d89bb24 100644 --- a/docs/infra/fassets/deploying-agent.md +++ b/docs/infra/fassets/deploying-agent.md @@ -206,7 +206,7 @@ When you want to stop the server, press Ctrl + C. ## Verifying Collateral Pool Smart Contracts Verification of a smart contract on a block explorer allows future users of the smart contract to inspect the Solidity source code instead of the bytecode, greatly improving the security and transparency of the ecosystem. -Follow these steps to upload the source code for the Collateral Pool and Collateral Pool Token smart contracts, verifying them on the [Original Flare block explorer](../../user/block-explorers/index.md). +Follow these steps to upload the source code for the Collateral Pool and Collateral Pool Token smart contracts, verifying them on the block explorer. 1. Execute the FAssets system information command to determine your collateral pool smart contract address. diff --git a/docs/infra/index.md b/docs/infra/index.md index f43674c67..08a1c7074 100644 --- a/docs/infra/index.md +++ b/docs/infra/index.md @@ -4,7 +4,6 @@ This section contains step-by-step guides on how to deploy the different compone Select one of the topics below: -* [Becoming an Attestation Provider](./attestation/index.md) * [Deploying FAssets Agent](./fassets/index.md) * [FTSO Data Providers](./data/index.md) * [Observer Nodes](./observation/index.md) diff --git a/docs/security/index.md b/docs/security/index.md deleted file mode 100644 index ace315d54..000000000 --- a/docs/security/index.md +++ /dev/null @@ -1,69 +0,0 @@ -# Security - -## Source Code Audit Reports - -The following table lists reviews of the Flare source code and Flare smart-contract security reports. - -| Auditor | Date | Title | -| --------- | -------- | --------------------------------------------------------------------------- | -| Coinspect | Aug 2021 | [Smart Contract Audit v2][report001]{:download=""} | -| Coinspect | Feb 2022 | [Smart Contract Audit][report002]{:download=""} | -| Coinspect | Jun 2022 | [Launch Smart Contract Audit][report003]{:download=""} | -| Coinspect | Jun 2022 | [FAsset Smart Contract Audit][report004]{:download=""} | -| Coinspect | Jun 2022 | [Attestation Client Source Code Review][report005]{:download=""} | -| Coinspect | Jun 2022 | [Multichain Client Library Source Code Review][report006]{:download=""} | -| FYEO | Aug 2022 | [Validator Codebase Secure Code Review][report007]{:download=""} | -| FYEO | Sep 2022 | [Solidity Contracts Secure Code Review][report008]{:download=""} | -| FYEO | Sep 2022 | [Validator V2 Secure Code Review][report009]{:download=""} | -| Coinspect | Oct 2022 | [Flare Airdrop Update Smart Contract Audit][report010]{:download=""} | -| FYEO | Oct 2022 | [Solidity Code Contracts Secure Code Review][report011]{:download=""} | -| Coinspect | Dec 2022 | [Flare TDE Updates Smart Contract Audit][report012]{:download=""} | -| FYEO | Dec 2022 | [Solidity Smart Contracts Secure Code Review][report013]{:download=""} | -| FYEO | Dec 2022 | [Golang Validator Secure Code Review][report014]{:download=""} | -| Coinspect | Feb 2023 | [Hybrid Band Reward Smart Contract Audit][report015]{:download=""} | -| FYEO | Feb 2023 | [Golang Validator Secure Code Review V1][report016]{:download=""} | -| Coinspect | Sep 2023 | [Staking P2 Smart Contract Security Review][report019]{:download=""} | -| Coinspect | Oct 2023 | [Staking P2 Offchain Services Security Review][report018]{:download=""} | -| Coinspect | Nov 2023 | [FAsset V2 Smart Contract Security Review][report017]{:download=""} | -| Coinspect | Nov 2023 | [FAsset V2 Bots Source Code Review][report021]{:download=""} | -| Coinspect | Dec 2023 | [Hex Wrapped Tokens Smart Contract Audit][report020]{:download=""} | -| Coinspect | Dec 2023 | [FAsset Liquidator Smart Contract Review][report022]{:download=""} | -| Coinspect | Feb 2024 | [Attestation Suite Smart Contract Review][report023]{:download=""} | -| Coinspect | Mar 2024 | [Transaction Verifier Source Code Security Review][report029]{:download=""} | -| Coinspect | Apr 2024 | [C Chain Indexer Source Code Security Review][report024]{:download=""} | -| Coinspect | Apr 2024 | [Fast Updates Source Code Security Review][report025]{:download=""} | -| Coinspect | Apr 2024 | [Top Level Client Source Code Security Review][report026]{:download=""} | -| Coinspect | Apr 2024 | [FTSO Scaling Security Review][report027]{:download=""} | -| Coinspect | Apr 2024 | [Smart Contracts V2 Security Review][report028]{:download=""} | -| Coinspect | May 2024 | [Voter Registry Fix Security Review][report030]{:download=""} | - -[report001]: ../assets/reports/Coinspect%20-%20Flare%20Contracts%20Audit%20v210809.pdf -[report002]: ../assets/reports/Coinspect%20-%20Smart%20Contract%20Audit%20-%20Flare%20March%202022.pdf -[report003]: ../assets/reports/Coinspect%20-%20Smart%20Contract%20Audit%20-%20Flare%20Network%20Launch.pdf -[report004]: ../assets/reports/Coinspect_Smart_Contract_Audit_fAsset_v220829.pdf -[report005]: ../assets/reports/Coinspect%20-%20Flare%20-%20Source%20Code%20Review%20-%20Attestation%20Client%20-%20v240220.pdf -[report006]: ../assets/reports/Coinspect%20-%20Flare%20-%20Source%20Code%20Review%20-%20Multichain%20Client%20Library%20-%20v240220.pdf -[report007]: ../assets/reports/Flare%20Networks%20Ltd.%20-%20Secure%20Code%20Review%20of%20the%20Flare%20Network's%20Validator%20Codebase%20v1.0_Public.pdf -[report008]: ../assets/reports/Flare%20Networks%20Ltd.%20-%20Secure%20Code%20Review%20of%20Solidity%20Contracts%20on%20the%20Flare%20Network%20v1.0_public.pdf -[report009]: ../assets/reports/Flare%20Networks%20Ltd.%20-%20Secure%20Code%20Review%20of%20the%20Flare%20Validator%20V2%20-%20Report%20v1.0_Public.pdf -[report010]: ../assets/reports/Coinspect%20-%20Smart%20Contract%20Audit%20-%20Flare%20Airdrop%20Update%20-%20v221109.pdf -[report011]: ../assets/reports/Flare%20Networks%20Ltd.%20-%20Secure%20Code%20Review%20of%20Solidity%20Smart%20Contracts%20on%20the%20Flare%20Network%20v1.0_Public.pdf -[report012]: ../assets/reports/Coinspect%20-%20Smart%20Contract%20Audit%20-%20Flare%20TDE%20Updates%20-%20v221220.pdf -[report013]: ../assets/reports/Flare%20Networks%20Ltd.%20-%20Dec%202022%20-%20Secure%20Code%20Review%20of%20Solidity%20Smart%20Contracts%20on%20the%20Flare%20Network%20v1.0_Public.pdf -[report014]: ../assets/reports/Flare%20Networks%20Ltd.%20-%20Secure%20Code%20Review%20of%20Golang%20Validator%20on%20the%20Flare%20Network%20v1.0_Public.pdf -[report015]: ../assets/reports/Coinspect%20-%20Smart%20Contract%20Audit%20-%20Flare%20Hybrid%20Band%20Reward%20v230220.pdf -[report016]: ../assets/reports/Flare%20Networks%20Ltd.%20-%20Secure%20Code%20Review%20of%20Golang%20Validator%20on%20the%20Flare%20Network%20v1.0_February_Public.pdf -[report017]: ../assets/reports/Coinspect%20-%20Flare%20-%20Smart%20Contract%20Review%20-%20FAsset%20V2%20-%20v240220.pdf -[report018]: ../assets/reports/Coinspect%20-%20Flare%20-%20Source%20Code%20Review%20-%20Staking%20P2%20Offchain%20Services%20-%20v240220.pdf -[report019]: ../assets/reports/Coinspect%20-%20Flare%20-%20Smart%20Contract%20Review%20-%20StakingP2%20-%20v240220.pdf -[report020]: ../assets/reports/Coinspect%20-%20Flare%20-%20Smart%20Contract%20Audit%20-%20HexWrappedTokens%20-%20v231211.pdf -[report021]: ../assets/reports/Coinspect%20-%20Flare%20-%20Source%20Code%20Review%20-%20FAsset%20Bots%20-%20v240220.pdf -[report022]: ../assets/reports/Coinspect%20-%20Flare%20-%20Smart%20Contract%20Review%20-%20FAsset%20Liquidator%20-%20v231207.pdf -[report023]: ../assets/reports/Coinspect%20-%20Smart%20Contract%20Review%20-%20%20Flare%20Attestation%20Suite%20-%20v240220.pdf -[report024]: ../assets/reports/Coinspect%20-%20Flare%20-%20Source%20Code%20Security%20Review%20-%20CChain%20Indexer%20%20-%20v240409.pdf -[report025]: ../assets/reports/Coinspect%20-%20Flare%20-%20Source%20Code%20Security%20Review%20-%20FastUpdates%20-%20v240612.pdf -[report026]: ../assets/reports/Coinspect%20-%20Flare%20-%20Source%20Code%20Security%20Review%20-%20Top%20Level%20Client%20-%20v240515.pdf -[report027]: ../assets/reports/Coinspect%20-%20Flare%20-%20Source%20Code%20Security%20Review%20-%20FTSO%20Scaling%20-%20v240515.pdf -[report028]: ../assets/reports/Coinspect%20-%20Flare%20-%20Source%20Code%20Security%20Review%20-%20Smart%20Contracts%20V2%20-%20v240515.pdf -[report029]: ../assets/reports/Coinspect%20-%20Flare%20-%20Source%20Code%20Security%20Review%20-%20Transaction%20Verifier%20-%20v240516.pdf -[report030]: ../assets/reports/Coinspect%20-%20Flare%20-%20Security%20Review%20-%20Voter%20Registry%20Fix%20-%20v240603.pdf diff --git a/docs/tech/automatic-claiming.md b/docs/tech/automatic-claiming.md index 88539666c..0b09a4bd6 100644 --- a/docs/tech/automatic-claiming.md +++ b/docs/tech/automatic-claiming.md @@ -114,14 +114,6 @@ Additionally, this avoids the fee that a public executor will typically charge. The Flare network offers only the possibility of setting up an automatic execution service and is not liable for any damages if this service is not performed. For more information, see [FLARE TERMS OF SERVICE & PRIVACY POLICY](https://flare.network/privacy-policy/). -!!! example "Developing autoclaiming functionality" - - For information on how to develop an executor, or how to write an application that supports autoclaiming, see [Automatic Claiming](../dev/reference/automatic-claiming.md) in the Developer section. - ## Related User Guides * [Automatic claiming](../user/automatic-claiming.md) - -## Related Developer Docs - -* [Automatic claiming](../dev/reference/automatic-claiming.md) diff --git a/docs/tech/flare.md b/docs/tech/flare.md index de77fee81..e52271242 100644 --- a/docs/tech/flare.md +++ b/docs/tech/flare.md @@ -28,21 +28,7 @@ Flare has the following native data acquisition protocols at these stages of dev ## Developing on Flare -Flare developers can work in a familiar Ethereum-like environment. -It offers the same [API](../apis/index.md) and uses the Ethereum Virtual Machine ([EVM](glossary.md#evm)), so Ethereum's Solidity smart contracts can be used directly. -Like Ethereum, Flare supports other assets, such as NFTs. -See [Getting Started](../dev/getting-started/index.md). - -The Flare native currency, `$FLR`, works the same as `$ETH` on the Ethereum blockchain. -For those contracts that can only work with [ERC-20](glossary.md#erc20) tokens, `$FLR` can be easily [wrapped](../user/wrapping-tokens.md) as `$WFLR`, which is an ERC-20 representation of `$FLR`. -Flare's [FTSO delegation](./ftso.md#delegation) and Flare [governance](./governance.md) are examples of such apps. - -Common blockchain tools like [wallets](../user/wallets/index.md), a [token management portal](https://portal.flare.network/), and [block explorers](../user/block-explorers/index.md) are available on Flare. - -Flare is actively seeking developers eager to discover what new utility can be brought to the blockchain industry when acquiring data is possible in a decentralized way. -To start, since Flare is EVM-compatible, you can migrate Ethereum smart-contract dapps to Flare. -Then consider, for example, creating DeFi, gaming, NFT, music, or social network dapps. -See [Start Building](https://flare.network/start-building/), for more information. +For information about developing on Flare, see the [Flare Developer Hub](https://dev.flare.network/). ## Flare Networks @@ -58,16 +44,9 @@ Flare has 4 networks with different purposes:
General feature adoption flow.
-For technical details about each network see [Network Configuration](../dev/reference/network-config.md). - ## Flare Chains Flare uses two chains and is developing a built-in interoperability mechanism between them. * **C-Chain:** The contract chain that is used for smart contracts. It is where the Ethereum Virtual Machine operates, and is the chain where the vast bulk of the community currently interact. * **P-Chain:** The platform chain that accommodates [staking](../tech/validators.md) and provides rewards to its validators. - -## Security - -The Flare source code has been audited and is secure and safe. -[View the audit reports](../security/index.md) on Flare clients and smart contracts. diff --git a/docs/tech/ftso.md b/docs/tech/ftso.md index a1899c485..6f1ebe52c 100644 --- a/docs/tech/ftso.md +++ b/docs/tech/ftso.md @@ -175,8 +175,6 @@ You can [delegate your tokens using the Flare Portal](../user/delegation/managin Some FTSO data providers have already started providing these dapps as a convenience. Take a look at [flaremetrics.io](https://flaremetrics.io/) and pick the one you prefer. -If you are an advanced user, you can [delegate manually](../user/block-explorers/managing-delegations.md) by interacting directly with the FTSO smart contracts. - ## Rewards A percentage of the annual network **[inflation](glossary.md#inflation)** is reserved to reward FTSO data providers and distributed uniformly among the year's reward epochs. @@ -226,8 +224,6 @@ Instead, the amounts are accumulated in a smart contract and must be claimed **o You can [claim your rewards using the Flare Portal](../user/delegation/managing-rewards.md), a supported wallet like [Bifrost](../user/wallets/bifrost-wallet.md), or a [dapp](glossary.md#dapp). Take a look at [flaremetrics.io](https://flaremetrics.io/) and pick the one you prefer. -If you are an advanced user, you can [claim manually](../user/block-explorers/managing-rewards.md) by interacting directly with the FTSO smart contracts. - To save on gas costs, rewards from multiple reward epochs are claimed simultaneously when you use the Portal. However, be aware that **rewards expire after 90 days**. Moreover, you probably want to claim soon, to redelegate the received amount and obtain compounded rewards. @@ -247,8 +243,3 @@ It is also worth noting that: * [Operating a Data Provider](../infra/data/operating.md) * [Working with Whitelists](../infra/data/whitelisting.md) * [Managing the Ecosystem](../infra/data/managing-ecosystem/index.md) - -## Related Developer Docs - -* [FTSO Reference](../dev/reference/ftso.md) -* [FTSO Tutorials](../dev/tutorials/ftso/index.md) diff --git a/docs/tech/glossary.md b/docs/tech/glossary.md index 70d58c51d..d2d63ee77 100644 --- a/docs/tech/glossary.md +++ b/docs/tech/glossary.md @@ -24,13 +24,13 @@ Block { #block } : For performance reasons, [blockchains](#blockchain) do not process transactions one by one. Instead, transactions are grouped together in blocks which are then validated by the [consensus](#consensus) algorithm. Block Explorer { #block_explorer } -: A tool that enables its users to analyze transactions and interact with addresses on blockchains. [Read more...](../user/block-explorers/index.md) +: A tool that enables its users to analyze transactions and interact with addresses on blockchains. Blockchain { #blockchain } : Digital [ledger](#ledger) storing data and transactions on a distributed network of computers to make it more robust. Cryptography protects against information tampering, and a [consensus](#consensus) algorithm ensures that the majority of the network agrees on the stored data even if some of its nodes act maliciously. Bootstrapping Node { #bootstrapping_node } -: An observation node associated with a [validator node](#validator) and acting as its bastion: the bootstrapping node exposes a minimum RPC interface, so the validator does not have to. The nodeID and nodeIP returned by the bootstrapping node's RPC allow an external node to connect and peer with the core network of validators. The bootstrapping node also [gossips](https://en.wikipedia.org/wiki/Gossip_protocol) the core network's validators nodeIDs and nodeIPs to the external node to peer to. The main purpose of a bootstrapping node is to allow new nodes to connect to the network (hence the name "bootstrapping") while reducing its associated validator node attack surface. [Flare offers some public bootstrapping nodes](../dev/reference/network-config.md#flare-networks). +: An observation node associated with a [validator node](#validator) and acting as its bastion: the bootstrapping node exposes a minimum RPC interface, so the validator does not have to. The nodeID and nodeIP returned by the bootstrapping node's RPC allow an external node to connect and peer with the core network of validators. The bootstrapping node also [gossips](https://en.wikipedia.org/wiki/Gossip_protocol) the core network's validators nodeIDs and nodeIPs to the external node to peer to. The main purpose of a bootstrapping node is to allow new nodes to connect to the network (hence the name "bootstrapping") while reducing its associated validator node attack surface. Bridge { #bridge } : A protocol that connects otherwise independent blockchains, enabling interoperability between them. Read more about Flare's bridging: [LayerCake](#layercake). @@ -195,7 +195,8 @@ Quorum Slice { #quorum_slice } : In [FBA](#fba) consensus each node has multiple lists of other nodes which it voluntarily decides to trust, forming its quorum slices. All nodes in a quorum slice agreeing on a result are enough to convince the node of that result. If the quorum slices are correctly built, global quorum emerges from these local quorum slices. RPC { #rpc } -: Remote Procedure Call is a protocol that allows a program executing on a computer to request a service from another program, typically running on a different computer. [Flare offers some public and private nodes with RPC capabilities](../apis/index.md#access-nodes). +: Remote Procedure Call is a protocol that allows a program executing on a computer to request a service from another program, typically running on a different computer. +Flare offers some public and private nodes with RPC capabilities. Real World Assets { #rwa } : Tokens that represent tangible or intangible assets, such as real estate or government bonds, respectively, as opposed to digital assets such as cryptocurrency. diff --git a/docs/tech/personal-delegation-account.md b/docs/tech/personal-delegation-account.md index d0ce12a97..a1ab0431a 100644 --- a/docs/tech/personal-delegation-account.md +++ b/docs/tech/personal-delegation-account.md @@ -26,14 +26,6 @@ Here are some of the differences from a regular account: The Flare Foundation is not liable for any damages, especially pertaining to tax related issues when using this service. Check your local tax laws. -!!! example "Developing PDA functionality" - - For information on how to develop a PDA, or how to write an application that supports a PDA, see [Personal Delegation Accounts](../dev/reference/personal-delegation-account.md) in the Developer section. - ## Related User Guides * [Managing your PDA](../user/personal-delegation-account.md) - -## Related Developer Docs - -* [Managing PDAs in applications](../dev/reference/personal-delegation-account.md) diff --git a/docs/tech/state-connector.md b/docs/tech/state-connector.md index c1a274dd3..b1c0b33fd 100644 --- a/docs/tech/state-connector.md +++ b/docs/tech/state-connector.md @@ -45,19 +45,6 @@ Requests must adhere to one of the [**available request types**](#attestation-ty Otherwise, queries like "What is the weather like in Paris?" would have a hard time reaching consensus among the different attestation providers. Section [Adding New Attestation Types](#adding-new-attestation-types) below contains more details. -??? example "Making a request (for App developers)" - - Make your requests using the `requestAttestations` method (#2) of the [StateConnector contract](../dev/getting-started/contract-addresses.md): - - ```solidity - function requestAttestations( - bytes calldata data - ) external; - ``` - - The `requestAttestations` method has a single parameter, `data`, which is a byte array with a content that depends on the desired **request type**. - You can learn how to build this array in the [state-connector-attestation-types repository](https://github.com/flare-foundation/state-connector-attestation-types). - ### 2. Request forwarding The State Connector simply **forwards the request** to all connected attestation providers through an [EVM](glossary.md#evm) event. @@ -99,14 +86,6 @@ Otherwise, **no consensus is achieved**: requests remain **unanswered** and must **The answers are stored in the State Connector smart contract for a week**, where anybody can read them, including the original requester. -??? example "Retrieving your request's answer (for App developers)" - - To retrieve the stored answers just read the `merkleRoots` public array (#8) in the [StateConnector contract](../dev/getting-started/contract-addresses.md). - - More information on how to retrieve a particular answer in the [State Connector contract source code](https://gitlab.com/flarenetwork/flare-smart-contracts/-/blob/master/contracts/genesis/implementation/StateConnector.sol#L59). - - As shown below, multiple answers are actually packed into a single Merkle root. The [Attestation Packing](#attestation-packing) section explains how to retrieve an individual answer. - ## Attestation Protocols For simplicity, the above description omitted **two very important mechanisms**, reviewed here. @@ -183,39 +162,6 @@ Additional points worth noting: * The exact way in which the root hash is calculated can be changed without impacting the State Connector contract, which will continue to vote only on the hash value. -??? example "Proof Unpacking (for App developers)" - - The procedure for apps to check whether the State Connector answered yes or no to their request is detailed in the [Attestation Client repository](https://github.com/flare-foundation/attestation-client/blob/main/docs/end-users/verification-workflow.md). What follows is an illustrative summary. - - The basic idea is that you must **retrieve all data** (both requests and answers) for the round from an attestation provider. - You then **rebuild the Merkle tree** with this data and check that it matches the Attestation Proof provided by the State Connector. - -
- ![Proof unpacking](SC-proof-unpacking.png){ loading=lazy .allow-zoom } -
Proof unpacking.
-
- - 1. In the attestation round after you made the request (3 attestation phases, so from 3 to 4.5 minutes) the **Attestation Proof** for the round should be available in the State Connector. - Retrieve it using method `getAttestation` (#7) of the [StateConnector contract](../dev/getting-started/contract-addresses.md). - - 2. **Select any attestation provider** you want and use the [Proof API](https://github.com/flare-foundation/attestation-client/blob/main/docs/end-users/apis.md#proof-api-on-attestation-provider-server) path `api/proof/votes-for-round/{roundId}` to **retrieve all data for the round**. - - 3. **Rebuild the Merkle tree** for the retrieved data. - There are tools to help you, like the [MerkleTree.ts](https://github.com/flare-foundation/attestation-client/blob/main/src/utils/data-structures/MerkleTree.ts) library. - - 4. **Check** that the tree's root matches the Attestation Proof from step 1. - If it does not match, this provider did not submit the answer agreed by the majority. - Choose another provider in step 2. - - Conversely, you can use the `api/proof/get-specific-proof` API in step 2 which does steps 2, 3 and 4 for you. - This API returns the JSON response data, including the attestation proof, if the attestation request was successfully verified in the given round. - - 5. Now that you know that the retrieved data has been agreed upon by the consensus, you can use it. - **Look for your request inside the returned data**. - If it is not present, your request was deemed **invalid** (for example, the queried transaction was not present). - - Otherwise, your request is valid and you can find any extra information about it in the data array. - ## Branching Protocol Besides the consensus algorithm that runs on all received attestations, the State Connector provides **one further security mechanism**: @@ -227,7 +173,7 @@ To achieve this, two **sets** of attestation providers are defined: * **Default attestation providers set** - Anybody can submit attestations to the State Connector, but the contract will only accept submissions from attestation providers in the [**default set**](../infra/attestation/operating.md). + Anybody can submit attestations to the State Connector, but the contract will only accept submissions from attestation providers in the [**default set**]. **Every validator node** in the Flare network relies on this set. * **Local attestation providers set** @@ -337,8 +283,8 @@ In summary, validators using at least one reliable local attestation provider do Attestation providers currently support these attestation types: -* [**AddressValidity**](AddressValidity.md): Whether a given address is valid in the specified network. -* [**Balance-decreasing transaction**](BalanceDecreasingTransaction.md): Whether a transaction that might have decreased a balance occurred. +* **AddressValidity**: Whether a given address is valid in the specified network. +* **Balance-decreasing transaction**: Whether a transaction that might have decreased a balance occurred. This type allows for several possibilities: * During a transaction, funds, including fees, were deducted from the balance at an address. @@ -346,10 +292,10 @@ Attestation providers currently support these attestation types: * During a transaction, funds to pay for fees were deducted from the balance at an address at the same time as more funds arrived. As a result, the balance at the address experienced a decrease, but the final balance is more than the balance was before the transaction. -* [**Confirmed block height**](ConfirmedBlockHeightExists.md): Whether a block on a certain height exists and was confirmed. -* [**EVMTransaction**](EVMTransaction.md): A relay of a transaction from an EVM chain. -* [**Payment**](Payment.md): Whether a payment transaction occurred in which funds were sent from one address to another address. -* [**Referenced payment nonexistence**](ReferencedPaymentNonexistence.md): Whether an account did not receive funds from a different account by a specific deadline. +* **Confirmed block height**: Whether a block on a certain height exists and was confirmed. +* **EVMTransaction**: A relay of a transaction from an EVM chain. +* **Payment**: Whether a payment transaction occurred in which funds were sent from one address to another address. +* **Referenced payment nonexistence**: Whether an account did not receive funds from a different account by a specific deadline. This type can serve as proof that a user's payment obligations to a DeFi protocol have been breached, considering the following cases: * The required transaction was not confirmed on time. diff --git a/docs/tech/the-flaredrop.md b/docs/tech/the-flaredrop.md index c326d6409..983b18c4e 100644 --- a/docs/tech/the-flaredrop.md +++ b/docs/tech/the-flaredrop.md @@ -50,7 +50,3 @@ You can also enable [automatic claiming](./automatic-claiming.md) to make sure y * [Claiming the FlareDrop](../user/claiming-the-flaredrop.md) * [Wrapping tokens](../user/wrapping-tokens.md) - -## Related Developer Docs - -* [The FlareDrop](../dev/reference/the-flaredrop.md) diff --git a/docs/user/automatic-claiming.md b/docs/user/automatic-claiming.md index 03f7cffca..1b10d274d 100644 --- a/docs/user/automatic-claiming.md +++ b/docs/user/automatic-claiming.md @@ -11,7 +11,7 @@ However, the Flare Portal does not help you find executor addresses, so you must * [Manual executors](../tech/automatic-claiming.md#manual-claiming-process) are ones that you locate yourself. Whether they charge a fee or not and how you pay it is between you and the executor. -* [Registered executors](../tech/automatic-claiming.md#registered-claiming-process) are listed in a [smart contract](glossary.md#smart_contract) and can be retrieved, for instance, using the [block explorer](./block-explorers/index.md) or third-party applications. +* [Registered executors](../tech/automatic-claiming.md#registered-claiming-process) are listed in a [smart contract](glossary.md#smart_contract) and can be retrieved, for instance, using the block explorer or third-party applications. These executors charge a fee when you set them up and every time they claim for you. !!! note "Overview of autoclaiming functionality" @@ -22,20 +22,7 @@ However, the Flare Portal does not help you find executor addresses, so you must To enable an executor, obtain its address off-chain or, for registered executors, on-chain. -The list of registered executors has not been added yet to the Flare Portal, but a manual method is given below using the [block explorer](./block-explorers/index.md) (recommended for advanced users). - -??? example "Find a registered executor (using the Block Explorer)" - - To find an executor you will need to use the `ClaimSetupManager` contract. - See the [Contract Addresses](../dev/getting-started/contract-addresses.md) page to learn how to find the address of this contract. - - 1. In the [Block Explorer](https://flare-explorer.flare.network/), paste the address of the `ClaimSetupManager` contract and scroll down to select the **Read Contract** tab. - 2. To get the available executors' addresses, scroll down to `getRegisteredExecutors` and enter a range of how many addresses to check, for example, `0` in the **_start** field and `10` in the **_end** field. - 3. Click **Query**. The Block Explorer returns the addresses and the total number available, so you can know if you've gotten them all. - 4. To get the executor's fee, copy one address at a time and enter it in the executor field for `getExecutorCurrentFeeValue`. - 5. Click **Query**. - In the future, there will be more criteria to help with making this decision. - 6. Choose an executor and copy its address. +Note that the list of registered executors has not been added yet to the Flare Portal. ## Enabling Automatic Claiming diff --git a/docs/user/block-explorers/finding-reward-epoch.md b/docs/user/block-explorers/finding-reward-epoch.md deleted file mode 100644 index 0a5d8cb25..000000000 --- a/docs/user/block-explorers/finding-reward-epoch.md +++ /dev/null @@ -1,21 +0,0 @@ -# Finding the Reward Epoch - -!!! example "This page is for advanced users." - -[Reward epochs](../../tech/ftso.md#reward-epoch) are periods during which delegations rewards are accrued. Use the block explorer to find the current reward epoch, which you can use to find the epoch for which you can claim rewards and to determine the [vote-power block](../../tech/ftso.md#vote-power) for the next epoch. - -The following guide refers to the [original Flare block explorers](./index.md). - -1. Open a [block explorer](./index.md) for the appropriate network. - [The block explorer dashboard](./user-interface.md) is displayed. -2. From the block explorer, follow the [Retrieval from Blockchain procedure](../../dev/getting-started/contract-addresses.md#retrieval-from-blockchain) to find and open the `FtsoManager` contract. - The **Contract Address Details** page is displayed. -3. Click the **Read Contract** tab, and locate the `getCurrentRewardEpoch` method. - The current reward epoch number is already displayed beside the function, as shown in the following example: - -
- ![Current Reward Epoch](block-explorer-current-epoch.png){ loading=lazy .allow-zoom} -
Current Reward Epoch.
-
- - In this example, the FTSO reward epoch is 80. diff --git a/docs/user/block-explorers/index.md b/docs/user/block-explorers/index.md deleted file mode 100644 index f4cfe15f0..000000000 --- a/docs/user/block-explorers/index.md +++ /dev/null @@ -1,30 +0,0 @@ -# Block Explorers - -Block explorers enable you to analyze transactions and interact with addresses on blockchains. - -Flare provides two versions of its block explorer to examine the network activities in the Flare ecosystem. - -* **Flarescan block explorers**: Provide full support for the [C-chain](../../tech/flare.md#flare-chains), basic support for the [P-chain](../../tech/flare.md#flare-chains), and analytics. - -* **Original Flare block explorers**: Provide analytics plus full support for the [C-chain](../../tech/flare.md#flare-chains), but they do not provide support for the P-chain. - -| [Network](../../tech/flare.md#flare-networks) | Flarescan Block Explorers | Original Flare Block Explorers | -| --------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| Flare Mainnet | [Flare Mainnet Explorer](https://mainnet.flarescan.com) | [Original Flare Mainnet Explorer](https://flare-explorer.flare.network) | -| Songbird | [Songbird Canary Explorer](https://songbird.flarescan.com) | [Original Songbird Explorer](https://songbird-explorer.flare.network) | -| Coston | [Coston Canary Explorer](https://coston.testnet.flarescan.com) | [Original Coston Explorer](https://coston-explorer.flare.network) | -| Coston2 | [Coston2 Testnet Explorer](https://coston2.testnet.flarescan.com) | [Original Coston2 Explorer](https://coston2-explorer.flare.network) | - -## Guides - -These guides refer to the original Flare block explorers. - -* [Finding the Reward Epoch](./finding-reward-epoch.md) -* [Managing Delegations](./managing-delegations.md) -* [Managing Rewards](./managing-rewards.md) -* [Verifying the Vote-Power Block](./verifying-vote-power-block.md) -* [Viewing NFTs](./viewing-nfts.md) -* [Viewing Token Balances](./viewing-token-balances.md) -* [Viewing Token Transfers](./viewing-token-transfers.md) -* [Viewing Transactions](./viewing-transactions.md) -* [Block Explorer Dashboard](./user-interface.md) diff --git a/docs/user/block-explorers/managing-delegations.md b/docs/user/block-explorers/managing-delegations.md deleted file mode 100644 index 276ab64b6..000000000 --- a/docs/user/block-explorers/managing-delegations.md +++ /dev/null @@ -1,113 +0,0 @@ -# Managing Delegations Using the Block Explorer - -!!! example "This page is for advanced users." - -When you make [delegations to FTSO data providers](../../tech/ftso.md#delegation), you increase their vote power, reinforce the stability of the FTSO ecosystem, and earn monetary rewards. - -Use the following information to manage your vote-power delegations with the the block explorer, which provides many options but is more complex. -Alternatively, if you prefer a simpler interface, use the [Flare Portal](https://portal.flare.network/). - -## Prerequisites - -Before you delegate your vote power, you must: - -* [Wrap your native tokens](../wrapping-tokens.md). - Wrapped tokens are required to delegate your vote power to data providers. -* Choose 1 or 2 data providers. - Multiple lists of data providers are available online, such as [FlareMetrics](https://flaremetrics.io/). - As you browse the lists, consider the [factors that affect the potential for rewards](../../tech/ftso.md#rewards). -* [Understand how the timing of delegations affects rewards](../../tech/ftso.md#effects-of-the-vote-power-block-snapshot-on-delegations), and consider the implications about the vote-power snapshot that will affect your rewards. - -The following guide refers to the [original Flare block explorers](./index.md). - -## Delegating Your Vote Power - -1. After you choose your data provider from the [list of data providers](https://flaremetrics.io/), locate its address beneath its name, and copy it. -2. To verify the address of the data provider, open a [block explorer](../block-explorers/index.md), paste the address in the search field, and click the same address displayed as the result. - - On the **Transactions** tab, a list of recently submitted `SubmitHash` and `RevealPrices` transactions are displayed to confirm that the data provider is operating. - -3. Open a [block explorer](./index.md) for the appropriate network. - The [block explorer dashboard](./user-interface.md) is displayed. -4. Follow the [Retrieval from Blockchain procedure](../../dev/getting-started/contract-addresses.md#retrieval-from-blockchain) to find and open the `WNat` contract. - The **Contract Address Details** page is displayed. -5. Click the **Write Contract** tab, and then click **Connect Wallet**, as shown in the following image: - -
- ![Write Contract Tab and Connect Your Wallet](block-explorer-write-wallet.png){ loading=lazy .allow-zoom} -
Write Contract Tab and Connect Your Wallet.
-
- -6. Complete the steps to connect your wallet. -7. Locate the `delegate` method, and specify values for these parameters: - - * **_to(address)**: The address for the data provider you copied in Step 1. - * **_bips(uin256)**: The percentage in basis points. For example, 10000 bips = 100%, and 5000 bips = 50%. - -8. Click **Write** to run the `delegate` method. -9. Follow the steps to complete the transaction in your wallet. - Delegation is complete. - - In the next reward epoch, your newly delegated tokens will be included in the calculation of your selected data provider's weight. - If the data provider submits useful data and garners any rewards, you will be able to [claim your share of the rewards](./managing-rewards.md) when the reward epoch is over. - -## Removing Delegations - -1. Open a [block explorer](./index.md) for the appropriate network. - The [block explorer dashboard](./user-interface.md) is displayed. -2. Follow the [Retrieval from Blockchain procedure](../../dev/getting-started/contract-addresses.md#retrieval-from-blockchain) to find and open the `WNat` contract. - The **Contract Address Details** page is displayed. -3. Click the **Write Contract** tab, and then click **Connect Wallet**, as shown in the following image: - -
- ![Write Contract Tab and Connect Your Wallet](block-explorer-write-wallet.png){ loading=lazy .allow-zoom} -
Write Contract Tab and Connect Your Wallet.
-
- -4. Complete the steps to connect your wallet. -5. Locate the `delegate` method, change the value of **_bips(uin256)** for the data provider's address to 0, and click **Write** to run the method. -6. Follow the steps to complete the transaction in your wallet. - -## Redelegating Vote Power - -1. Open a [block explorer](./index.md) for the appropriate network. - The [block explorer dashboard](./user-interface.md) is displayed. -2. Follow the [Retrieval from Blockchain procedure](../../dev/getting-started/contract-addresses.md#retrieval-from-blockchain) to find and open the `WNat` contract. - The **Contract Address Details** page is displayed. -3. Click the **Write Contract** tab, and then click **Connect Wallet**, as shown in the following image: - -
- ![Write Contract Tab and Connect Your Wallet](block-explorer-write-wallet.png){ loading=lazy .allow-zoom} -
Write Contract Tab and Connect Your Wallet.
-
- -4. Complete the steps to connect your wallet. -5. Locate the `undelegateAll` method, and click **Write** to run the method. -6. Follow the steps to complete the transaction in your wallet. - All your delegations are removed. -7. Delegate to the data providers you've chosen by following [the previous set of steps to delegate](#delegating-your-vote-power). - -## Revoking Vote Power - -You can [immediately revoke your vote power](../../tech/ftso.md#immediate-delegation-revocation) from a malicious data provider. - -1. Open a [block explorer](./index.md) for the appropriate network. - The [block explorer dashboard](./user-interface.md) is displayed. -2. Follow the [Retrieval from Blockchain procedure](../../dev/getting-started/contract-addresses.md#retrieval-from-blockchain) to find and open the `WNat` contract. - The **Contract Address Details** page is displayed. -3. Click the **Write Contract** tab, and then click **Connect Wallet**, as shown in the following image: - -
- ![Write Contract Tab and Connect Your Wallet](block-explorer-write-wallet.png){ loading=lazy .allow-zoom} -
Write Contract Tab and Connect Your Wallet.
-
- -4. Complete the steps to connect your wallet. -5. Locate the `revokeDelegationAt` method, and specify values for the following parameters: - - * **_who(address)**: The address of the data provider from whom you will revoke your delegation. - * **_blockNumber(uint256)**: The block number at which your delegation will be revoked. - -6. Click **Write** to run the method. -7. Follow the steps to complete the transaction in your wallet. - Your delegation is immediately revoked. diff --git a/docs/user/block-explorers/managing-rewards.md b/docs/user/block-explorers/managing-rewards.md deleted file mode 100644 index 93657ba7c..000000000 --- a/docs/user/block-explorers/managing-rewards.md +++ /dev/null @@ -1,73 +0,0 @@ -# Managing Rewards Using the Block Explorer - -!!! example "This page is for advanced users." - -Rewards are accrued from your delegations to FTSO data providers whose submitted data is close to the calculated median value in a price epoch. - -Use the following information to [check your reward balance](#checking-your-reward-balance) and [claim your rewards](#claiming-your-rewards) with the block explorer, which provides many options but is more complex. -Alternatively, if you prefer a simple interface, use the [Flare Portal](https://portal.flare.network/). - -The following guide refers to the [original Flare block explorers](./index.md). - -## Checking Your Reward Balance - -1. Open a [block explorer](./index.md) for the appropriate network. - [The block explorer dashboard](./user-interface.md) is displayed. -2. Follow the [Retrieval from Blockchain procedure](../../dev/getting-started/contract-addresses.md#retrieval-from-blockchain) to find and open the `FtsoRewardManager` contract. - The **Contract Address Details** page is displayed. -3. Click the **Read Contract** tab, and then click **Connect Wallet**, as shown in the following image: - -
- ![Read Contract Tab and Connect Your Wallet](block-explorer-read-wallet.png){ loading=lazy .allow-zoom} -
Read Contract Tab and Connect Your Wallet.
-
- -4. Complete the steps to connect your wallet. -5. Locate the `getStateOfRewards` method, and specify values for the following parameters: - - * **_beneficiary(address)**: The address to check for rewards. - * **_rewardEpoch(uint256)**: The epoch in which you want to check the address for rewards. To check rewards for the epoch currently in progress, [get the current reward epoch](./finding-reward-epoch.md). - -6. Click **Query** to run the `getStateOfRewards` method. - The following information is returned: - - * **_dataProviders**: List of providers to which the address delegated vote power during this epoch. - * **_rewardAmounts**: List of reward amounts from each delegation. - * **_claimed**: List of boolean values indicating whether each of the amounts has already been claimed. - * **_claimable**: Boolean value indicating whether rewards for the address are claimable. [Rewards are claimable](../../tech/ftso.md#reward-claiming-procedure) if they are not expired and the epoch has ended. The value of `_claimable` is independent of the value of `_claimed.` - -## Claiming Your Rewards - -1. Open a [block explorer](./index.md) for the appropriate network. - [The block explorer dashboard](./user-interface.md) is displayed. -2. Follow the [Retrieval from Blockchain procedure](../../dev/getting-started/contract-addresses.md#retrieval-from-blockchain) to find and open the `FtsoRewardManager` contract. - The **Contract Address Details** page is displayed. -3. Click the **Read Contract** tab, and then click **Connect Wallet**, as shown in the following image: - -
- ![Read Contract Tab and Connect Your Wallet](block-explorer-read-wallet.png){ loading=lazy .allow-zoom} -
Read Contract Tab and Connect Your Wallet.
-
- -4. Complete the steps to connect your wallet. - In the next steps, you will check this wallet for accrued rewards. - You can disconnect this wallet and connect a different wallet as frequently as necessary. -5. Run the `getEpochsWithUnclaimedRewards(beneficiary_address)` method by clicking **Query**. - A list of previous epochs with pending rewards to be claimed is returned. -6. On the **Write Contract** tab, locate the `claimReward` method, and specify values for the following parameters: - - * **_recipient(address)**: The address to which you want claimed rewards to be sent. - It can be the address you used to connect your wallet to the block explorer or a different address. - * **_rewardEpochs(uint256[])**: One or more epoch numbers retrieved in Step 5. - Specify multiple epoch numbers in a comma-separated list enclosed by square brackets, such as `[59,60]`. - -7. Click **Write** to run the `claimReward` method. One of the following results occurs: - - * The `claimReward` method prompts you to confirm the transaction. - Go to Step 8. - * The `claimReward` method fails. For security reasons, the `FtsoRewardManager` contract contains a **limited amount of tokens** and is replenished periodically. - Sometimes, all delegators claim their rewards in a short period of time immediately after the reward epoch ends, and the contract becomes empty. - If you are unable to claim your rewards because the contract is empty, **try again the next day**. - -8. Follow the steps to confirm the transaction in your wallet. - Your rewards are claimed, and your updated balance of native tokens is displayed. diff --git a/docs/user/block-explorers/user-interface.md b/docs/user/block-explorers/user-interface.md deleted file mode 100644 index b1ae501b5..000000000 --- a/docs/user/block-explorers/user-interface.md +++ /dev/null @@ -1,64 +0,0 @@ -# Block Explorer Dashboard - -Each block explorer provides this dashboard, which includes: - -
-![Block Explorer Dashboard](block-explorer-dashboard.png){ loading=lazy } -
Block Explorer Dashboard.
-
- -* [Navigation Bar](#header-navigation-bar) -* [Metrics](#metrics) -* [Blocks](#blocks) -* [Transactions](#transactions) - -This dashboard represents the dashboard of the [original Flare block explorers](./index.md). - -## Navigation Bar - -Use the options in the navigation bar to explore the blockchain and toggle light and dark modes. - -* **Blocks**: View recently created blocks and their constituent transactions. -* **Transactions**: View validated or pending transactions. -* **Tokens**: View a list of all the tokens on the blockchain or the addresses of wallets that hold a specific token. -* **APIs**: For web3 developers to retrieve blockchain data. -* **Network**: View the explorers for other networks in the Flare ecosystem. -* **Display theme**: Toggle between light and dark mode. -* **Search**: Search the blockchain by address, token symbol, token name, transaction hash, or block number. - -## Metrics - -The metrics section displays the following information: - -* **Gas tracker**: The average amount of gas required to process a transaction on a Flare network. Gas is denominated in units of gwei, where 1,000,000,000 gwei equals one token on a Flare network. -* **Average block time**: The average time required to confirm a block. -* **Total transactions**: The total amount of verified transactions. -* **Total blocks**: The total amount of confirmed blocks. -* **Wallet addresses**: The total amount of wallets created on the network. - -## Blocks - -A block is a group of transactions submitted, validated, and recorded on the blockchain. -Each block has a sequential ID and a number of transactions aggregated in the block. -To view details about a block and the transactions it contains, click the block ID. -Alternatively, view a continuous list of confirmed blocks as they occur by clicking **View All Blocks**. - -
-![Blocks](block-explorer-blocks.png){ loading=lazy .allow-zoom} -
Blocks.
-
- -## Transactions - -Transactions are the various actions you can take on a blockchain. -They are categorized by the following types: - -* **Standard**: Transfers of tokens between two wallets. -* **Contract**: Interactions between two smart contracts or a wallet and a smart contract. - Contract transactions include delegating tokens, transferring tokens, wrapping and unwrapping tokens, and so on. - Interactions between two smart contracts are [internal transactions](./viewing-transactions.md#internal-transactions). - -
-![Transaction Types](block-explorer-transaction-types.png){ loading=lazy .allow-zoom} -
Transaction Types.
-
diff --git a/docs/user/block-explorers/verifying-vote-power-block.md b/docs/user/block-explorers/verifying-vote-power-block.md deleted file mode 100644 index a8edffaf0..000000000 --- a/docs/user/block-explorers/verifying-vote-power-block.md +++ /dev/null @@ -1,27 +0,0 @@ -# Verifying the Vote-Power Block - -!!! example "This page is for advanced users." - -Use the block explorer to verify the [vote-power block](../../tech/ftso.md#vote-power) snapshot for a specific epoch. -The snapshot indicates when your delegations are enacted. - -The following guide refers to the [original Flare block explorers](./index.md). - -1. Open a [block explorer](./index.md) for the appropriate network. - [The block explorer dashboard](./user-interface.md) is displayed. -2. From the block explorer, follow the [Retrieval from Blockchain procedure](../../dev/getting-started/contract-addresses.md#retrieval-from-blockchain) to find and open the `FtsoManager` contract. - The **Contract Address Details** page is displayed. -3. Click the **Read Contract** tab. -4. On the **Read Contract** tab, locate the `getRewardEpochVotePowerBlock` method, and specify the epoch number. -5. Click **Query** to run the `getRewardEpochVotePowerBlock` method. - The block number that was used to determine the vote power for the next epoch is returned. -6. Copy this block number, paste it into the **Search** field, and press Enter. - The **Block Details** page is displayed. - The timestamp is displayed, as shown in the following image: - -
- ![Vote-Power Block Snapshot](block-explorer-vp-snapshot.png){ loading=lazy .allow-zoom} -
Vote-Power Block Snapshot.
-
- - The displayed timestamp is the exact date and UTC time when vote power was locked during the epoch you specified. diff --git a/docs/user/block-explorers/viewing-nfts.md b/docs/user/block-explorers/viewing-nfts.md deleted file mode 100644 index b031dbada..000000000 --- a/docs/user/block-explorers/viewing-nfts.md +++ /dev/null @@ -1,19 +0,0 @@ -# Viewing NFTs - -!!! example "This page is for advanced users." - -Use the block explorer to view NFTs. -Before you begin, ensure the status of the transaction to mint the NFT is **Confirmed**. - -The following guide refers to the [original Flare block explorers](./index.md). - -1. Retrieve the transaction hash for the NFT. -2. Open a [block explorer](./index.md) for the appropriate network. - [The block explorer dashboard](./user-interface.md) is displayed. -3. Specify the NFT transaction hash from Step 1 in the **Search** field, and click the result. - The **Transaction Details** page is displayed. -4. Locate the **Tokens Minted** section. - The value of the **For** parameter is the numerical ID for the NFT. -5. Click the ID. The NFT collection page is displayed. - In most cases, your NFT is displayed in the upper-right hand side of the page. - However, if the NFT creator used public IPFS gateways or did not create the NFT according to the ERC-721 or ERC-1155 standards, the NFT might not display. diff --git a/docs/user/block-explorers/viewing-token-balances.md b/docs/user/block-explorers/viewing-token-balances.md deleted file mode 100644 index 03d728bbc..000000000 --- a/docs/user/block-explorers/viewing-token-balances.md +++ /dev/null @@ -1,44 +0,0 @@ -# Viewing Token Balances - -!!! example "This page is for advanced users." - -Use the block explorer to view the list of token balances at an address. - -The following guide refers to the [original Flare block explorers](./index.md). - -1. Retrieve the address whose tokens you want to view. -2. Open the [block explorer](./index.md) for the appropriate network. [The block explorer dashboard](./user-interface.md) is displayed. -3. Insert the address from Step 1 into the **Search** field. If the address exists, it is highlighted in the results list. -4. Click the highlighted address. The **Address Details** page is displayed. -5. Click the **Tokens** tab, as shown in the following image: - -
- ![Tokens](block-explorer-tokens.png){ loading=lazy .allow-zoom} -
Tokens.
-
- - The address's `$FLR` balance and a list of the non-native tokens it contains are displayed. The list can include ERC-20, ERC-721, and ERC-1155 tokens. - -## Balance History - -Use the block explorer to view a historical chart of the native-token balance at the address. - -1. Retrieve the address whose tokens you want to view. -2. Open the [block explorer](./index.md) for the network appropriate network. - [The block explorer dashboard](./user-interface.md) is displayed. -3. Insert the address from Step 1 into the **Search** field. - If the address exists, it is highlighted in the results list. -4. Click the highlighted address. The **Address Details** page is displayed. -5. Click the **Coin Balance History** tab, as shown in the following image: - -
- ![Coin Balance History](block-explorer-history.png){ loading=lazy .allow-zoom} -
Coin Balance History.
-
- - A chart that shows the history of the native token at the address and a list of associated blocks is displayed, as shown in the following image: - -
- ![Coin Balance Chart](block-explorer-balance.png){ loading=lazy .allow-zoom} -
Coin Balance Chart.
-
diff --git a/docs/user/block-explorers/viewing-token-transfers.md b/docs/user/block-explorers/viewing-token-transfers.md deleted file mode 100644 index 4339edbc8..000000000 --- a/docs/user/block-explorers/viewing-token-transfers.md +++ /dev/null @@ -1,56 +0,0 @@ -# Viewing Token Transfers - -!!! example "This page is for advanced users." - -The following guide refers to the [original Flare block explorers](./index.md). - -Use the block explorer to view token transfers to and from an address. - -1. Retrieve the address whose token transfers you want to view. -2. Open the [block explorer](./index.md) for the appropriate network. - [The block explorer dashboard](./user-interface.md) is displayed. -3. Insert the address from Step 1 into the **Search** field. - If the address exists, it is highlighted in the results list. -4. Click the highlighted address. The **Address Details** page is displayed. -5. Click the **Token Transfers** tab, as shown in the following image: - -
- ![Token Transfers](block-explorer-transfers.png){ loading=lazy .allow-zoom} -
Token Transfers.
-
- - The **Token Transfers** list is displayed. - -6. Click the transaction hash for the token transfer you want to view. - The following details about the transfer are displayed: - - * **Transaction Hash**: A unique identifier that proves a transaction is verified and added to the blockchain. - * **Result**: The state of the transaction. - The state is either **Success**, **Pending**, or **Failed**. - * **Status**: The status of the transaction. - The status is either **Confirmed** or **Unconfirmed**. - * **Block**: The number of the block that contains the transaction. - * **Timestamp**: The date and time when the transaction was added to the blockchain and the amount of time required to confirm it. - * **From**: The address of the transaction sender. - * **Interacted With (To)**: The address of the contract that handles the transaction. - * **Tokens Transferred** - * **From**: The address that initiated the transaction with the contract. - * **To**: The address of the recipient of the token in the transaction. - * **For**: The symbol of the token and its quantity in the transaction. - * **Value**: The quantity of tokens sent. - * **Transaction Fee**: The total cost of the transaction. - * **Gas Price**: The price per unit of gas specified by the sender. - Units are measured in gwei. - * **Transaction Type**: - * **Gas Limit**: The maximum amount of gas approved for the transaction. - * **Max Fee Per Gas**: The maximum total amount per unit of gas the sender would pay, including the base fee and priority fee. - * **Max Priority Fee per Gas**: The maximum fee per unit of gas specified by the sender to pay a validator to prioritize the transaction. - This fee is also called a tip. - * **Priority Fee/Tip**: The priority fee specified by the sender to pay a validator to prioritize the transaction. - * **Transaction Burnt Fee**: The amount of `$FLR` [burned](glossary.md#burn) for the transaction. - * **Gas Used by Transaction**: The actual amount of gas used by the transaction. - * **Nonce Position**: The transaction number from the sender's address. - Each transaction made by an address increases the nonce by one. - * **Raw Input**: The hashed input of a transaction. - This input accompanies the transaction to process it. - * **Input**: The relevant functions that were called and parameters used in the transaction. diff --git a/docs/user/block-explorers/viewing-transactions.md b/docs/user/block-explorers/viewing-transactions.md deleted file mode 100644 index 9d5d5dc4e..000000000 --- a/docs/user/block-explorers/viewing-transactions.md +++ /dev/null @@ -1,124 +0,0 @@ -# Viewing Transactions - -!!! example "This page is for advanced users." - -Use the block explorer to view transaction details that explain where the transactions exist on the blockchain, when they were processed, how much gas they consumed, and more. - -The following guide refers to the [original Flare block explorers](./index.md). - -1. Retrieve the address whose transactions you want to view. -2. Open the [block explorer](./index.md) for the appropriate network. - [The block explorer dashboard](./user-interface.md) is displayed. -3. Insert the address from Step 1 into the **Search** field. - If the address exists, it is highlighted in the results list. -4. Click the highlighted address. - The **Address Details** page is displayed, as shown in the following image. The preselected **Transactions** tab lists the transactions associated with the address. - -
- ![Transactions](block-explorer-transactions.png){ loading=lazy .allow-zoom} -
Transactions.
-
- -5. Click the transaction hash, as shown in the following image, which highlights in sequence a [standard transaction and a contract transaction](./user-interface.md#transactions). - The listed transactions were made by the address you specified. Details about a transaction are displayed when you click a transaction hash. - -
- ![Transaction Hash](block-explorer-tx-hash.png){ loading=lazy .allow-zoom} -
Transaction Hash.
-
- - The **Transaction Details** page is displayed, as shown in the following image: - -
- ![Transaction Details](block-explorer-tx-details.png){ loading=lazy .allow-zoom} -
Transaction Details.
-
- -## Transaction Details - -The following transaction information is provided: - -* **Transaction Hash**: A unique identifier that proves a transaction is verified and added to the blockchain. -* **Result**: The state of the transaction. - The state is either **Success**, **Pending**, or **Failed**. -* **Status**: The status of the transaction. - The status is either **Confirmed** or **Unconfirmed**. -* **Block**: The number of the block that contains the transaction. -* **Timestamp**: The date and time when the transaction was added to the blockchain and the amount of time required to confirm it. -* **From**: The address of the transaction sender. -* **To**: The address of the transaction recipient. -* **Value**: The quantity of tokens sent. -* **Transaction Fee**: The total cost of the transaction. -* **Gas Price**: The price per unit of gas specified by the sender. - Units are measured in gwei. -* **Transaction Type**: -* **Gas Limit**: The maximum amount of gas approved for the transaction. -* **Max Fee Per Gas**: The maximum total amount per unit of gas the sender would pay, including the base fee and priority fee. -* **Max Priority Fee per Gas**: The maximum fee per unit of gas specified by the sender to pay a validator to prioritize the transaction. - This fee is also called a tip. -* **Priority Fee/Tip**: The priority fee specified by the sender to pay a validator to prioritize the transaction. -* **Transaction Burnt Fee**: The amount of `$FLR` [burned](glossary.md#burn) for the transaction. -* **Gas Used by Transaction**: The actual amount of gas used by the transaction. -* **Nonce Position**: The transaction number from the sender's address. - Each transaction made by an address increases the nonce by one. - -The following elements are specific to contract transactions: - -* **Interacted With (To)**: The address of the contract that handles the transaction. -* **Tokens Minted** - * **From**: The address that initiated the transaction with the contract. - * **To**: The address of the recipient of the token in the transaction. - * **For**: The symbol of the token and its quantity in the transaction. -* **Raw Input**: The hashed input of a transaction. This input accompanies the transaction to process it. - -### Input - -The **Input** section shows the methods that were called and the parameters used in the transaction. - -### Internal Transactions - -Internal transactions occur between multiple smart contracts. -In some cases, tokens are transferred to a smart contract during an internal transaction. - -1. Locate the **Internal Transactions** tab, as shown in the following image: - -
- ![Internal Transactions](block-explorer-internal-tx.png){ loading=lazy .allow-zoom} -
Internal Transactions.
-
- -2. Click the transaction hash, as shown in the following image: - -
- ![Transaction Hash](block-explorer-tx-hash.png){ loading=lazy .allow-zoom} -
Transaction Hash.
-
- - The [transaction details](#tx-details) are displayed. - -### Logs - -Transaction logs show events that were trigged by smart contracts during a transaction and information related to those events. - -Click the **Logs** tab, as shown in the following image: - -
-![Logs](block-explorer-logs.png){ loading=lazy .allow-zoom} -
Logs.
-
- -The logs are displayed. - -### Raw Trace - -The raw trace shows all parameters and data related to a transaction. -If errors occurred during the transaction, this information can be used to debug them. - -Click the **Raw Trace** tab, as shown in the following image: - -
-![Raw Trace](block-explorer-raw-trace.png){ loading=lazy .allow-zoom} -
Raw Trace.
-
- -The raw trace is displayed in JSON format. diff --git a/docs/user/claiming-the-flaredrop.md b/docs/user/claiming-the-flaredrop.md index 83e027956..3e3a15d7e 100644 --- a/docs/user/claiming-the-flaredrop.md +++ b/docs/user/claiming-the-flaredrop.md @@ -15,7 +15,6 @@ You can claim: * Using the [Flare Portal](https://portal.flare.network/). * Through an [executor](../tech/automatic-claiming.md), which you can configure using the Portal, or -* [Directly against a smart contract](../dev/reference/the-flaredrop.md) (for advanced users). !!! warning "Two steps to ensure receiving all your `$FLR` !" diff --git a/docs/user/delegation/managing-delegations.md b/docs/user/delegation/managing-delegations.md index e97066d66..b20f491fc 100644 --- a/docs/user/delegation/managing-delegations.md +++ b/docs/user/delegation/managing-delegations.md @@ -2,7 +2,7 @@ When you make delegations to data providers, you increase their vote power, reinforce the stability of the FTSO ecosystem, and earn monetary rewards. -This information explains how to manage your delegations using the [Flare Portal](https://portal.flare.network). Alternatively, if you have used block explorers for other networks and are competent interacting with smart contracts without a user interface, you can [use the block explorer](../block-explorers/managing-delegations.md), which provides more options but can be more complex. Using it is intended for advanced users. +This information explains how to manage your delegations using the [Flare Portal](https://portal.flare.network). Alternatively, if you have used block explorers for other networks and are competent interacting with smart contracts without a user interface, you can use the block explorer, which provides more options but can be more complex. Using it is intended for advanced users. ## Prerequisites diff --git a/docs/user/delegation/managing-rewards.md b/docs/user/delegation/managing-rewards.md index affa9340c..c9edfa6ce 100644 --- a/docs/user/delegation/managing-rewards.md +++ b/docs/user/delegation/managing-rewards.md @@ -2,7 +2,7 @@ [Rewards](../../tech/ftso.md#rewards) are accrued from your delegations to FTSO data providers whose submitted data is close to the calculated median value in a price epoch. -Use this information to claim FTSO delegation rewards by using the Flare Portal. Alternatively, if you have used block explorers for other networks and are competent interacting with smart contracts without a user interface, you can [use the block explorer](../block-explorers/managing-rewards.md), which provides more options but can be more complex. Using it is intended for advanced users. +Use this information to claim FTSO delegation rewards by using the Flare Portal. Alternatively, if you have used block explorers for other networks and are competent interacting with smart contracts without a user interface, you can use the block explorer, which provides more options but can be more complex. Using it is intended for advanced users. 1. Open the [Flare Portal](https://portal.flare.network). The home page is displayed. diff --git a/docs/user/index.md b/docs/user/index.md index 4575b1d01..cc9decac9 100644 --- a/docs/user/index.md +++ b/docs/user/index.md @@ -5,7 +5,6 @@ This section contains step-by-step guides on how to use tools like the Block Exp Select one of the topics below: * [Automatic Claiming](./automatic-claiming.md) -* [Block Explorers](./block-explorers/index.md) * [Claiming the FlareDrop](./claiming-the-flaredrop.md) * [FTSO Delegation](./delegation/index.md) * [Governance](./governance/index.md) diff --git a/docs/user/staking/staking-cli.md b/docs/user/staking/staking-cli.md index 2a94e4b26..79444575a 100644 --- a/docs/user/staking/staking-cli.md +++ b/docs/user/staking/staking-cli.md @@ -427,14 +427,14 @@ Press the down key a few times for this last option to show. secp256k1 public key: 0x●●●●●●●●●●●●●●●● ``` - 2. You need to interact with the `AddressBinder` smart contract, so you must retrieve its address from the `FlareContractRegistry` as explained in the [retrieving Contract Addresses page](../../dev/getting-started/contract-addresses.md). - 3. Enter the address of the `AddressBinder` contract in the [Block Explorer](../block-explorers/index.md), and go to the **Write Contract** tab. + 2. You need to interact with the `AddressBinder` smart contract, so you must retrieve its address from the `FlareContractRegistry`. + 3. Enter the address of the `AddressBinder` contract in the block explorer, and go to the **Write Contract** tab. 4. Click on **Connect Wallet**. You do not need to use the same account as the one you are binding. 5. Locate the `registerPublicKey` method and paste the public key from step 1 into the `_publicKey` field. 6. Click on **Write** and confirm the transaction from your wallet. - If the transaction is successful, your account's P and C-chain addresses are now bound. + If the transaction is successful, your account's P- and C-chain addresses are now bound. You then need to provide the following information: @@ -595,8 +595,8 @@ Finished execution Rewards can also be claimed directly from the `ValidatorRewardManager` contract that accumulates them: - 1. You need to interact with the `ValidatorRewardManager` smart contract, so you must retrieve its address from the `FlareContractRegistry` as explained in the [retrieving Contract Addresses page](../../dev/getting-started/contract-addresses.md). - 2. Enter the address of the `ValidatorRewardManager` contract in the [Block Explorer](../block-explorers/index.md), and go to the **Write Contract** tab. + 1. You need to interact with the `ValidatorRewardManager` smart contract, so you must retrieve its address from the `FlareContractRegistry`. + 2. Enter the address of the `ValidatorRewardManager` contract in the block explorer, and go to the **Write Contract** tab. 3. Click on **Connect Wallet**. You need to connect the account for which you are claiming. 4. Locate the `claim` method and enter the following information: diff --git a/docs/user/wrapping-tokens.md b/docs/user/wrapping-tokens.md index a075b142c..09cd64539 100644 --- a/docs/user/wrapping-tokens.md +++ b/docs/user/wrapping-tokens.md @@ -59,8 +59,8 @@ If your wrapped token balance is not displayed in your wallet, you must manually !!! example "This section is for advanced users." -1. Open a [block explorer](./block-explorers/index.md). -2. From the block explorer, follow the [Retrieval from Blockchain procedure](../dev/getting-started/contract-addresses.md#retrieval-from-blockchain) to find and open the `WNat` contract. +1. Open a block explorer. +2. From the block explorer, open the `WNat` contract. 3. Click **Connect Wallet**, and complete the steps to connect your wallet, ensuring you are on the network on which you will wrap tokens. 4. Click the **Write Contract** tab, and use the following methods to wrap and unwrap tokens: @@ -127,5 +127,3 @@ If the automatic method did not work for you, most wallets can still be configur The exact instructions depend on your wallet, but they generally just require you to locate the aforementioned menu and provide the address of the `WNat` contract. The wallet can usually then retrieve the token name, symbol, and number of decimals directly from the contract. - -See the [Contract Addresses](../dev/getting-started/contract-addresses.md) page to find the address of the `WNat` contract. diff --git a/mkdocs.yml b/mkdocs.yml index 9d39631be..37f2a8378 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -67,11 +67,11 @@ plugins: - autolinks # Use just filenames instead of full or relative paths - redirects: # Allow creating redirects for moved pages redirect_maps: - 'en/state-connector.md': 'tech/state-connector.md' + 'en/state-connector.md': 'tech/state-connector.md' 'technology/glossary.md': 'tech/glossary.md' 'technology/state-connector.md': 'tech/state-connector.md' - 'networks/songbird.md': 'dev/reference/network-config.md' - 'networks/coston-testnet.md': 'dev/reference/network-config.md' + 'networks/songbird.md': 'developer-hub.md' + 'networks/coston-testnet.md': 'developer-hub.md' 'tech/flare-launch-process.md': 'tech/archive/flare-launch-process.md' 'tutorials/wallets/index.md': 'user/wallets/index.md' 'tutorials/wallets/bifrost-wallet.md': 'user/wallets/bifrost-wallet.md' @@ -81,10 +81,10 @@ plugins: 'tutorials/wallets/how-to-access-flare-network-with-metamask.md': 'user/wallets/how-to-access-flare-network-with-metamask.md' 'tutorials/wallets/safepal-s1-wallet.md': 'user/wallets/safepal-s1-wallet.md' 'tutorials/wallets/brave-wallet.md': 'user/wallets/brave-wallet.md' - 'tutorials/explorer/songbird-explorer.md': 'user/block-explorers/index.md' - 'tutorials/explorer/coston-explorer.md': 'user/block-explorers/index.md' - 'tutorials/developing-on-top-of-flare/README.md': 'dev/index.md' - 'tutorials/developing-on-top-of-flare/important-links.md': 'dev/index.md' + 'tutorials/explorer/songbird-explorer.md': 'developer-hub.md' + 'tutorials/explorer/coston-explorer.md': developer-hub.md + 'tutorials/developing-on-top-of-flare/README.md': 'developer-hub.md' + 'tutorials/developing-on-top-of-flare/important-links.md': 'developer-hub.md' 'tutorials/delegation/README.md': 'user/delegation/index.md' 'tutorials/delegation/delegation-in-detail.md': 'tech/ftso.md' 'tutorials/delegation-faq/README.md': 'tech/ftso.md' @@ -100,15 +100,145 @@ plugins: 'tutorials/price-provider/ftso-price-provider/whitelisting-a-price-provider.md': 'infra/data/whitelisting.md' 'tutorials/price-provider/ftso-price-provider/whitelisting-price-provider-faq.md': 'infra/data/whitelisting.md' 'tutorials/price-provider/troubleshooting/price-provider.md': 'infra/data/operating.md' - 'infra/data/deploying.md': 'infra/data/operating.md' + 'infra/data/deploying.md': 'infra/data/operating.md' 'tutorials/price-provider/troubleshooting/observation-node.md': 'infra/observation/deploying.md' 'tutorials/price-provider/whitelisting.md': 'infra/data/whitelisting.md' - 'dev/reference/flare.md': 'dev/reference/network-config.md' - 'dev/reference/songbird.md': 'dev/reference/network-config.md' - 'dev/reference/coston-testnet.md': 'dev/reference/network-config.md' - 'dev/reference/network-configs.md': 'dev/reference/network-config.md' - 'dev/contracts.md': 'dev/getting-started/contract-addresses.md' + 'dev/getting-started/index.md': 'developer-hub.md' + 'dev/getting-started/setup/index.md': 'developer-hub.md' + 'dev/getting-started/setup/remix.md': 'developer-hub.md' + 'dev/getting-started/setup/hardhat.md': 'developer-hub.md' + 'dev/getting-started/setup/foundry.md': 'developer-hub.md' + 'dev/getting-started/contract-addresses.md': 'developer-hub.md' + 'dev/tutorials/network-access/index.md': 'developer-hub.md' + 'dev/tutorials/network-access/transaction-finalization.md': 'developer-hub.md' + 'dev/tutorials/network-access/reliable-event-reading.md': 'developer-hub.md' + 'dev/tutorials/network-access/obtaining-revert-reason.md': 'developer-hub.md' + 'dev/tutorials/ftso/index.md': 'developer-hub.md' + 'dev/tutorials/ftso/getting-data-feeds.md': 'developer-hub.md' + 'dev/tutorials/ftso/getting-random-numbers.md': 'developer-hub.md' + 'dev/tutorials/sc/index.md': 'developer-hub.md' + 'dev/tutorials/sc/address-validity.md': 'developer-hub.md' + 'dev/reference/automatic-claiming.md': 'developer-hub.md' + 'dev/reference/personal-delegation-account.md': 'developer-hub.md' + 'dev/reference/explorers-and-indexers.md': 'developer-hub.md' + 'dev/reference/the-flaredrop.md': 'developer-hub.md' + 'dev/reference/wallets.md': 'developer-hub.md' + 'dev/external-resources.md': 'developer-hub.md' + 'dev/tools.md': 'developer-hub.md' + 'security/index.md': 'developer-hub.md' + 'apis/index.md': 'developer-hub.md' + 'apis/smart-contracts/index.md': 'developer-hub.md' + 'apis/smart-contracts/AddressUpdatable.md': 'developer-hub.md' + 'apis/smart-contracts/AddressUpdater.md': 'developer-hub.md' + 'apis/smart-contracts/AddressValidityVerification.md': 'developer-hub.md' + 'apis/smart-contracts/BalanceDecreasingTransactionVerification.md': 'developer-hub.md' + 'apis/smart-contracts/CheckPointable.md': 'developer-hub.md' + 'apis/smart-contracts/ClaimSetupManager.md': 'developer-hub.md' + 'apis/smart-contracts/CleanupBlockNumberManager.md': 'developer-hub.md' + 'apis/smart-contracts/CloneFactory.md': 'developer-hub.md' + 'apis/smart-contracts/ConfirmedBlockHeightExistsVerification.md': 'developer-hub.md' + 'apis/smart-contracts/Delegatable.md': 'developer-hub.md' + 'apis/smart-contracts/EVMTransactionVerification.md': 'developer-hub.md' + 'apis/smart-contracts/FlareContractRegistry.md': 'developer-hub.md' + 'apis/smart-contracts/FlareDaemon.md': 'developer-hub.md' + 'apis/smart-contracts/Ftso.md': 'developer-hub.md' + 'apis/smart-contracts/FtsoManager.md': 'developer-hub.md' + 'apis/smart-contracts/FtsoRegistry.md': 'developer-hub.md' + 'apis/smart-contracts/FtsoRewardManager.md': 'developer-hub.md' + 'apis/smart-contracts/GovernanceSettings.md': 'developer-hub.md' + 'apis/smart-contracts/GovernanceVotePower.md': 'developer-hub.md' + 'apis/smart-contracts/Governed.md': 'developer-hub.md' + 'apis/smart-contracts/GovernedAndFlareDaemonized.md': 'developer-hub.md' + 'apis/smart-contracts/GovernedAtGenesis.md': 'developer-hub.md' + 'apis/smart-contracts/GovernedBase.md': 'developer-hub.md' + 'apis/smart-contracts/Inflation.md': 'developer-hub.md' + 'apis/smart-contracts/PaymentVerification.md': 'developer-hub.md' + 'apis/smart-contracts/PChainStake.md': 'developer-hub.md' + 'apis/smart-contracts/PChainStakeMirror.md': 'developer-hub.md' + 'apis/smart-contracts/PriceSubmitter.md': 'developer-hub.md' + 'apis/smart-contracts/ReferencedPaymentNonexistenceVerification.md': 'developer-hub.md' + 'apis/smart-contracts/RevertErrorTracking.md': 'developer-hub.md' + 'apis/smart-contracts/VoterWhitelister.md': 'developer-hub.md' + 'apis/smart-contracts/VPContract.md': 'developer-hub.md' + 'apis/smart-contracts/VPToken.md': 'developer-hub.md' + 'apis/smart-contracts/WNat.md': 'developer-hub.md' + 'apis/smart-contracts/IAddressValidityVerification.md': 'developer-hub.md' + 'apis/smart-contracts/IBalanceDecreasingTransactionVerification.md': 'developer-hub.md' + 'apis/smart-contracts/IClaimSetupManager.md': 'developer-hub.md' + 'apis/smart-contracts/IConfirmedBlockHeightExistsVerification.md': 'developer-hub.md' + 'apis/smart-contracts/IEVMTransactionVerification.md': 'developer-hub.md' + 'apis/smart-contracts/IFlareContractRegistry.md': 'developer-hub.md' + 'apis/smart-contracts/IFlareDaemonize.md': 'developer-hub.md' + 'apis/smart-contracts/IFtso.md': 'developer-hub.md' + 'apis/smart-contracts/IFtsoGenesis.md': 'developer-hub.md' + 'apis/smart-contracts/IFtsoManager.md': 'developer-hub.md' + 'apis/smart-contracts/IFtsoManagerGenesis.md': 'developer-hub.md' + 'apis/smart-contracts/IFtsoRegistry.md': 'developer-hub.md' + 'apis/smart-contracts/IFtsoRegistryGenesis.md': 'developer-hub.md' + 'apis/smart-contracts/IFtsoRewardManager.md': 'developer-hub.md' + 'apis/smart-contracts/IGovernanceSettings.md': 'developer-hub.md' + 'apis/smart-contracts/IGovernanceVotePower.md': 'developer-hub.md' + 'apis/smart-contracts/IInflationGenesis.md': 'developer-hub.md' + 'apis/smart-contracts/IMerkleRootStorage.md': 'developer-hub.md' + 'apis/smart-contracts/IPaymentVerification.md': 'developer-hub.md' + 'apis/smart-contracts/IPChainStakeMirror.md': 'developer-hub.md' + 'apis/smart-contracts/IPChainVotePower.md': 'developer-hub.md' + 'apis/smart-contracts/IPriceSubmitter.md': 'developer-hub.md' + 'apis/smart-contracts/IReferencedPaymentNonexistenceVerification.md': 'developer-hub.md' + 'apis/smart-contracts/IStateConnector.md': 'developer-hub.md' + 'apis/smart-contracts/IVoterWhitelister.md': 'developer-hub.md' + 'apis/smart-contracts/IVPContractEvents.md': 'developer-hub.md' + 'apis/smart-contracts/IVPToken.md': 'developer-hub.md' + 'apis/smart-contracts/IWNat.md': 'developer-hub.md' + 'apis/smart-contracts/IIAddressUpdatable.md': 'developer-hub.md' + 'apis/smart-contracts/IIAddressUpdater.md': 'developer-hub.md' + 'apis/smart-contracts/IIClaimSetupManager.md': 'developer-hub.md' + 'apis/smart-contracts/IICleanable.md': 'developer-hub.md' + 'apis/smart-contracts/IIFtso.md': 'developer-hub.md' + 'apis/smart-contracts/IIFtsoManager.md': 'developer-hub.md' + 'apis/smart-contracts/IIFtsoRegistry.md': 'developer-hub.md' + 'apis/smart-contracts/IIFtsoRewardManager.md': 'developer-hub.md' + 'apis/smart-contracts/IIGovernanceVotePower.md': 'developer-hub.md' + 'apis/smart-contracts/IIInflationReceiver.md': 'developer-hub.md' + 'apis/smart-contracts/IIPriceSubmitter.md': 'developer-hub.md' + 'apis/smart-contracts/IITokenPool.md': 'developer-hub.md' + 'apis/smart-contracts/IIVoterWhitelister.md': 'developer-hub.md' + 'apis/smart-contracts/IIVPContract.md': 'developer-hub.md' + 'apis/smart-contracts/IIVPToken.md': 'developer-hub.md' + 'apis/REST/index.md': 'developer-hub.md' + 'apis/REST/attestation-client.md': 'developer-hub.md' + 'apis/REST/btcverifier.md': 'developer-hub.md' + 'apis/REST/dogeverifier.md': 'developer-hub.md' + 'apis/REST/evmverifier.md': 'developer-hub.md' + 'apis/REST/xrpverifier.md': 'developer-hub.md' + 'apis/attestation-types/index.md': 'developer-hub.md' + 'apis/attestation-types/AddressValidity.md': 'developer-hub.md' + 'apis/attestation-types/BalanceDecreasingTransaction.md': 'developer-hub.md' + 'apis/attestation-types/ConfirmedBlockHeightExists.md': 'developer-hub.md' + 'apis/attestation-types/EVMTransaction.md': 'developer-hub.md' + 'apis/attestation-types/Payment.md': 'developer-hub.md' + 'apis/attestation-types/ReferencedPaymentNonexistence.md': 'developer-hub.md' + 'dev/reference/flare.md': 'developer-hub.md' + 'dev/reference/songbird.md': 'developer-hub.md' + 'dev/reference/coston-testnet.md': 'developer-hub.md' + 'dev/reference/network-configs.md': 'developer-hub.md' + 'dev/contracts.md': 'developer-hub.md' + 'exchange/index.md': 'developer-hub.md' + 'exchange/architecture.md': 'developer-hub.md' + 'exchange/delegation.md': 'developer-hub.md' + 'exchange/troubleshooting.md': 'developer-hub.md' + 'get-started-building/index.md': 'developer-hub.md' 'user/delegation/delegation-overview.md': 'tech/ftso.md' + 'user/block-explorers/index.md': 'developer-hub.md' + 'user/block-explorers/finding-reward-epoch.md': 'developer-hub.md' + 'user/block-explorers/managing-delegations.md': 'developer-hub.md' + 'user/block-explorers/managing-rewards.md': 'developer-hub.md' + 'user/block-explorers/verifying-vote-power-block.md': 'developer-hub.md' + 'user/block-explorers/viewing-nfts.md': 'developer-hub.md' + 'user/block-explorers/viewing-token-balances.md': 'developer-hub.md' + 'user/block-explorers/viewing-token-transfers.md': 'developer-hub.md' + 'user/block-explorers/viewing-transactions.md': 'developer-hub.md' + 'user/block-explorers/user-interface.md': 'developer-hub.md' 'user/delegation/delegation-faq.md': 'tech/ftso.md' 'user/delegation/delegation-in-detail.md': 'tech/ftso.md' 'user/delegation/manual-delegation.md': 'user/delegation/managing-delegations.md' @@ -126,7 +256,6 @@ extra_javascript: - assets/javascripts/mathjax.js - assets/javascripts/images.js - assets/javascripts/links.js - - https://polyfill.io/v3/polyfill.min.js?features=es6 - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js extra: social: @@ -162,6 +291,7 @@ nav: - Home: - index.md - tech/flare.md + - developer-hub.md - User Guides: - user/index.md - Wallets: @@ -194,153 +324,10 @@ nav: - Governance: - user/governance/index.md - user/governance/voting.md - - Block Explorers: - - user/block-explorers/index.md - - user/block-explorers/finding-reward-epoch.md - - Managing Delegations: user/block-explorers/managing-delegations.md - - Managing Rewards: user/block-explorers/managing-rewards.md - - user/block-explorers/verifying-vote-power-block.md - - user/block-explorers/viewing-nfts.md - - user/block-explorers/viewing-token-balances.md - - user/block-explorers/viewing-token-transfers.md - - user/block-explorers/viewing-transactions.md - - user/block-explorers/user-interface.md - - Exchange Guides: - - exchange/index.md - - exchange/architecture.md - - exchange/delegation.md - - exchange/troubleshooting.md - - Get Started Building: - - get-started-building/index.md - - Getting Started: - - dev/getting-started/index.md - - Setting Up Your Environment: - - dev/getting-started/setup/index.md - - Using Remix: dev/getting-started/setup/remix.md - - Using Hardhat: dev/getting-started/setup/hardhat.md - - Using Foundry: dev/getting-started/setup/foundry.md - - dev/getting-started/contract-addresses.md - - Network Configuration: - - dev/tutorials/network-access/index.md - - dev/reference/network-config.md - - dev/tutorials/network-access/transaction-finalization.md - - dev/tutorials/network-access/reliable-event-reading.md - - dev/tutorials/network-access/obtaining-revert-reason.md - Developer Guides: - - dev/index.md - - FTSO: - - dev/tutorials/ftso/index.md + - dev/index.md - dev/reference/ftso.md - - dev/tutorials/ftso/getting-data-feeds.md - - dev/tutorials/ftso/getting-random-numbers.md - - State Connector: - - dev/tutorials/sc/index.md - - dev/tutorials/sc/address-validity.md - - dev/tutorials/sc/evm-transaction.md - - dev/reference/automatic-claiming.md - - dev/reference/personal-delegation-account.md - - dev/reference/explorers-and-indexers.md - - dev/reference/the-flaredrop.md - - dev/reference/wallets.md - - dev/external-resources.md - - dev/tools.md - - security/index.md - - APIs: - - apis/index.md - - Smart Contracts API: - - apis/smart-contracts/index.md - - apis/smart-contracts/AddressUpdatable.md - - apis/smart-contracts/AddressUpdater.md - - apis/smart-contracts/AddressValidityVerification.md - - apis/smart-contracts/BalanceDecreasingTransactionVerification.md - - apis/smart-contracts/CheckPointable.md - - apis/smart-contracts/ClaimSetupManager.md - - apis/smart-contracts/CleanupBlockNumberManager.md - - apis/smart-contracts/CloneFactory.md - - apis/smart-contracts/ConfirmedBlockHeightExistsVerification.md - - apis/smart-contracts/Delegatable.md - - apis/smart-contracts/EVMTransactionVerification.md - - apis/smart-contracts/FlareContractRegistry.md - - apis/smart-contracts/FlareDaemon.md - - apis/smart-contracts/Ftso.md - - apis/smart-contracts/FtsoManager.md - - apis/smart-contracts/FtsoRegistry.md - - apis/smart-contracts/FtsoRewardManager.md - - apis/smart-contracts/GovernanceSettings.md - - apis/smart-contracts/GovernanceVotePower.md - - apis/smart-contracts/Governed.md - - apis/smart-contracts/GovernedAndFlareDaemonized.md - - apis/smart-contracts/GovernedAtGenesis.md - - apis/smart-contracts/GovernedBase.md - - apis/smart-contracts/Inflation.md - - apis/smart-contracts/PaymentVerification.md - - apis/smart-contracts/PChainStake.md - - apis/smart-contracts/PChainStakeMirror.md - - apis/smart-contracts/PriceSubmitter.md - - apis/smart-contracts/ReferencedPaymentNonexistenceVerification.md - - apis/smart-contracts/RevertErrorTracking.md - - apis/smart-contracts/VoterWhitelister.md - - apis/smart-contracts/VPContract.md - - apis/smart-contracts/VPToken.md - - apis/smart-contracts/WNat.md - - apis/smart-contracts/IAddressValidityVerification.md - - apis/smart-contracts/IBalanceDecreasingTransactionVerification.md - - apis/smart-contracts/IClaimSetupManager.md - - apis/smart-contracts/IConfirmedBlockHeightExistsVerification.md - - apis/smart-contracts/IEVMTransactionVerification.md - - apis/smart-contracts/IFlareContractRegistry.md - - apis/smart-contracts/IFlareDaemonize.md - - apis/smart-contracts/IFtso.md - - apis/smart-contracts/IFtsoGenesis.md - - apis/smart-contracts/IFtsoManager.md - - apis/smart-contracts/IFtsoManagerGenesis.md - - apis/smart-contracts/IFtsoRegistry.md - - apis/smart-contracts/IFtsoRegistryGenesis.md - - apis/smart-contracts/IFtsoRewardManager.md - - apis/smart-contracts/IGovernanceSettings.md - - apis/smart-contracts/IGovernanceVotePower.md - - apis/smart-contracts/IInflationGenesis.md - - apis/smart-contracts/IMerkleRootStorage.md - - apis/smart-contracts/IPaymentVerification.md - - apis/smart-contracts/IPChainStakeMirror.md - - apis/smart-contracts/IPChainVotePower.md - - apis/smart-contracts/IPriceSubmitter.md - - apis/smart-contracts/IReferencedPaymentNonexistenceVerification.md - - apis/smart-contracts/IStateConnector.md - - apis/smart-contracts/IVoterWhitelister.md - - apis/smart-contracts/IVPContractEvents.md - - apis/smart-contracts/IVPToken.md - - apis/smart-contracts/IWNat.md - - apis/smart-contracts/IIAddressUpdatable.md - - apis/smart-contracts/IIAddressUpdater.md - - apis/smart-contracts/IIClaimSetupManager.md - - apis/smart-contracts/IICleanable.md - - apis/smart-contracts/IIFtso.md - - apis/smart-contracts/IIFtsoManager.md - - apis/smart-contracts/IIFtsoRegistry.md - - apis/smart-contracts/IIFtsoRewardManager.md - - apis/smart-contracts/IIGovernanceVotePower.md - - apis/smart-contracts/IIInflationReceiver.md - - apis/smart-contracts/IIPriceSubmitter.md - - apis/smart-contracts/IITokenPool.md - - apis/smart-contracts/IIVoterWhitelister.md - - apis/smart-contracts/IIVPContract.md - - apis/smart-contracts/IIVPToken.md - - OpenAPI REST API: - - apis/REST/index.md - - apis/REST/attestation-client.md - - apis/REST/btcverifier.md - - apis/REST/dogeverifier.md - - apis/REST/evmverifier.md - - apis/REST/xrpverifier.md - - Attestation Types: - - apis/attestation-types/index.md - - apis/attestation-types/AddressValidity.md - - apis/attestation-types/BalanceDecreasingTransaction.md - - apis/attestation-types/ConfirmedBlockHeightExists.md - - apis/attestation-types/EVMTransaction.md - - apis/attestation-types/Payment.md - - apis/attestation-types/ReferencedPaymentNonexistence.md + - dev/reference/network-config.md - Products: - products/index.md - tech/ftso.md @@ -353,13 +340,13 @@ nav: - tech/fassets/liquidation.md - tech/fassets/open-beta.md - tech/fassets/parameters.md - - tech/validators.md - tech/api-portal.md - Concepts: - tech/index.md - tech/automatic-claiming.md - tech/flare-beta.md - tech/flare-systems-protocol.md + - tech/validators.md - tech/governance.md - tech/personal-delegation-account.md - tech/the-flaredrop.md @@ -370,9 +357,6 @@ nav: - tech/archive/flare-launch-process.md - Infrastructure: - infra/index.md - - Attestation Providers: - - infra/attestation/index.md - - infra/attestation/operating.md - FTSO Data Providers: - infra/data/index.md - infra/data/operating.md @@ -392,4 +376,4 @@ nav: - infra/observation/deploying-docker.md - Validator Nodes: - infra/validation/index.md - - infra/validation/deploying.md \ No newline at end of file + - infra/validation/deploying.md