From 7b129343155e255680c18a537d96d355fa7ab6e7 Mon Sep 17 00:00:00 2001 From: Viraj Patva Date: Wed, 13 Dec 2023 11:54:05 +0530 Subject: [PATCH 1/3] DOCS : Readme updated for better understanding of how to accept ownership --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7dcbfe6a..7d67fd8a 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ Install **both** of the following: - `PRIVATE_KEY` for your development wallet - `POLYGON_MUMBAI_RPC_URL`, `ETHEREUM_SEPOLIA_RPC_URL`, or `AVALANCHE_FUJI_RPC_URL` - `POLYGONSCAN_API_KEY`, `ETHERSCAN_API_KEY`, or `FUJI_SNOWTRACE_API_KEY` blockchain explore API keys depending on which network you're using - `COINMARKETCAP_API_KEY` (from [here](https://pro.coinmarketcap.com/)) + - `SECOND_PRIVATE_KEY` (optional) , if you want to Accepts ownership of a Functions subscription after a transfer is requested. It should be private key of address you want to transfer ownership to.

4. Set the required environment variables. For improved security, Chainlink provides the NPM package [@chainlink/env-enc](https://www.npmjs.com/package/@chainlink/env-enc) which can be used to keep environment variables in a password encrypted `.env.enc` file instead of a plaintext `.env` for additional security. More detail on environment variable management and the tooling is provided in the [Environment Variable Management](#environment-variable-management) section. 1. Set an encryption password for your environment variables to a secure password by running `npx env-enc set-pw`. This password needs to be set each time you create or restart a terminal shell session.
@@ -206,7 +207,7 @@ Example: `npx hardhat functions-read --network polygonMumbai --contract 0x787Fe0 | `functions-sub-add` | Authorizes a consumer contract to use the Functions billing subscription | `network`: Name of blockchain network, `subid`: Subscription ID, `contract`: Address of the consumer contract to authorize for billing | | `functions-sub-remove` | Removes a consumer contract from a Functions billing subscription | `network`: Name of blockchain network, `subid`: Subscription ID, `contract`: Address of the consumer contract to remove from billing subscription | | `functions-sub-transfer` | Request ownership of a Functions subscription be transferred to a new address | `network`: Name of blockchain network, `subid`: Subscription ID, `newowner`: Address of the new owner | -| `functions-sub-accept` | Accepts ownership of a Functions subscription after a transfer is requested | `network`: Name of blockchain network, `subid`: Subscription ID | +| `functions-sub-accept` | Accepts ownership of a Functions subscription after a transfer is requested , before trying `functions-sub-accept` set env variable `SECOND_PRIVATE_KEY` | `network`: Name of blockchain network, `subid`: Subscription ID | | `functions-timeout-requests` | Times out expired Functions requests which have not been fulfilled within 5 minutes | `network`: Name of blockchain network, `requestids`: 1 or more request IDs to timeout separated by commas, `toblock` (optional): Ending search block number (defaults to latest block), `pastblockstosearch` (optional): Number of past blocks to search (defaults to 1,000) | # Request Configuration From d943e9fc48491be34d6d1d44e881b54f48ad5aa6 Mon Sep 17 00:00:00 2001 From: Viraj Patva Date: Wed, 13 Dec 2023 12:05:55 +0530 Subject: [PATCH 2/3] lint error solved --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7d67fd8a..fd5b7cf0 100644 --- a/README.md +++ b/README.md @@ -198,17 +198,17 @@ Example: `npx hardhat functions-read --network polygonMumbai --contract 0x787Fe0 ## Functions Subscription Management Commands -| Command | Description | Parameters | -| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `functions-sub-create` | Creates a new Functions billing subscription for Functions consumer contracts | `network`: Name of blockchain network, `amount` (optional): Initial amount used to fund the subscription in LINK (decimals are accepted), `contract` (optional): Address of the consumer contract to add to the subscription | -| `functions-sub-info` | Gets the Functions billing subscription balance, owner, and list of authorized consumer contract addresses | `network`: Name of blockchain network, `subid`: Subscription ID | -| `functions-sub-fund` | Funds a Functions billing subscription with LINK | `network`: Name of blockchain network, `subid`: Subscription ID, `amount`: Amount to fund subscription in LINK (decimals are accepted) | -| `functions-sub-cancel` | Cancels a Functions billing subscription and refunds the unused balance. Cancellation is only possible if there are no pending requests. | `network`: Name of blockchain network, `subid`: Subscription ID, `refundaddress` (optional): Address where the remaining subscription balance is sent (defaults to caller's address) | -| `functions-sub-add` | Authorizes a consumer contract to use the Functions billing subscription | `network`: Name of blockchain network, `subid`: Subscription ID, `contract`: Address of the consumer contract to authorize for billing | -| `functions-sub-remove` | Removes a consumer contract from a Functions billing subscription | `network`: Name of blockchain network, `subid`: Subscription ID, `contract`: Address of the consumer contract to remove from billing subscription | -| `functions-sub-transfer` | Request ownership of a Functions subscription be transferred to a new address | `network`: Name of blockchain network, `subid`: Subscription ID, `newowner`: Address of the new owner | -| `functions-sub-accept` | Accepts ownership of a Functions subscription after a transfer is requested , before trying `functions-sub-accept` set env variable `SECOND_PRIVATE_KEY` | `network`: Name of blockchain network, `subid`: Subscription ID | -| `functions-timeout-requests` | Times out expired Functions requests which have not been fulfilled within 5 minutes | `network`: Name of blockchain network, `requestids`: 1 or more request IDs to timeout separated by commas, `toblock` (optional): Ending search block number (defaults to latest block), `pastblockstosearch` (optional): Number of past blocks to search (defaults to 1,000) | +| Command | Description | Parameters | +| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `functions-sub-create` | Creates a new Functions billing subscription for Functions consumer contracts | `network`: Name of blockchain network, `amount` (optional): Initial amount used to fund the subscription in LINK (decimals are accepted), `contract` (optional): Address of the consumer contract to add to the subscription | +| `functions-sub-info` | Gets the Functions billing subscription balance, owner, and list of authorized consumer contract addresses | `network`: Name of blockchain network, `subid`: Subscription ID | +| `functions-sub-fund` | Funds a Functions billing subscription with LINK | `network`: Name of blockchain network, `subid`: Subscription ID, `amount`: Amount to fund subscription in LINK (decimals are accepted) | +| `functions-sub-cancel` | Cancels a Functions billing subscription and refunds the unused balance. Cancellation is only possible if there are no pending requests. | `network`: Name of blockchain network, `subid`: Subscription ID, `refundaddress` (optional): Address where the remaining subscription balance is sent (defaults to caller's address) | +| `functions-sub-add` | Authorizes a consumer contract to use the Functions billing subscription | `network`: Name of blockchain network, `subid`: Subscription ID, `contract`: Address of the consumer contract to authorize for billing | +| `functions-sub-remove` | Removes a consumer contract from a Functions billing subscription | `network`: Name of blockchain network, `subid`: Subscription ID, `contract`: Address of the consumer contract to remove from billing subscription | +| `functions-sub-transfer` | Request ownership of a Functions subscription be transferred to a new address | `network`: Name of blockchain network, `subid`: Subscription ID, `newowner`: Address of the new owner | +| `functions-sub-accept` | Accepts ownership of a Functions subscription after a transfer is requested , before trying `functions-sub-accept` set env variable `SECOND_PRIVATE_KEY` | `network`: Name of blockchain network, `subid`: Subscription ID | +| `functions-timeout-requests` | Times out expired Functions requests which have not been fulfilled within 5 minutes | `network`: Name of blockchain network, `requestids`: 1 or more request IDs to timeout separated by commas, `toblock` (optional): Ending search block number (defaults to latest block), `pastblockstosearch` (optional): Number of past blocks to search (defaults to 1,000) | # Request Configuration From 51753e57712bc2b80fbf6ae609511d5ed46118e3 Mon Sep 17 00:00:00 2001 From: Viraj Patva Date: Fri, 15 Dec 2023 09:53:42 +0530 Subject: [PATCH 3/3] Rephrased the message --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd5b7cf0..0d931040 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Install **both** of the following: - `PRIVATE_KEY` for your development wallet - `POLYGON_MUMBAI_RPC_URL`, `ETHEREUM_SEPOLIA_RPC_URL`, or `AVALANCHE_FUJI_RPC_URL` - `POLYGONSCAN_API_KEY`, `ETHERSCAN_API_KEY`, or `FUJI_SNOWTRACE_API_KEY` blockchain explore API keys depending on which network you're using - `COINMARKETCAP_API_KEY` (from [here](https://pro.coinmarketcap.com/)) - - `SECOND_PRIVATE_KEY` (optional) , if you want to Accepts ownership of a Functions subscription after a transfer is requested. It should be private key of address you want to transfer ownership to. + - `SECOND_PRIVATE_KEY` (optional) ,to accept the transfer of ownership using `./tasks/Functions-billing/accept.js` you will need to set this environment variable to act as the "transferee's" account.

4. Set the required environment variables. For improved security, Chainlink provides the NPM package [@chainlink/env-enc](https://www.npmjs.com/package/@chainlink/env-enc) which can be used to keep environment variables in a password encrypted `.env.enc` file instead of a plaintext `.env` for additional security. More detail on environment variable management and the tooling is provided in the [Environment Variable Management](#environment-variable-management) section. 1. Set an encryption password for your environment variables to a secure password by running `npx env-enc set-pw`. This password needs to be set each time you create or restart a terminal shell session.