-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support greenfield chain in bnb plugin #1
Conversation
add faucet action
feat: Deploy ERC20 / ERC721 / ERC1155 contract
@@ -51,6 +52,10 @@ export class WalletProvider { | |||
return this.account.address; | |||
} | |||
|
|||
getPk(): Address { | |||
return this.pk; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some security concerns regarding this approach. If we directly store the private key in plaintext, it poses a significant risk of exposure, especially since this is a public interface. Is there a way to reuse the sign
method from the PrivateKeyAccount
class for signing without compromising the private key?
|
||
export const InitGnfdClient = async (runtime: IAgentRuntime) => { | ||
const rpcUrl = runtime.getSetting("GREENFIELD_RPC_URL"); | ||
const chainId = runtime.getSetting("GREENFIELD_CHAIN_ID"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Chain ID can be obtained from the RPC URL. Therefore, I believe users do not need to set this parameter to enhance their experience. You can get the chainID here: https://greenfield-chain-us.bnbchain.org/genesis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to configure testnet
and mainnet
easily?
default config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GREENFIELD_RPC_URL
can be configured for both the mainnet and testnet. By utilizing this RPC URL, you can retrieve the chain ID using the above method.
.env.example
Outdated
@@ -379,3 +379,5 @@ BNB_PRIVATE_KEY= # BNB chain private key | |||
BNB_PUBLIC_KEY= # BNB-smart-chain public key (address) | |||
BSC_PROVIDER_URL= # BNB-smart-chain rpc url | |||
OPBNB_PROVIDER_URL= # OPBNB rpc url | |||
GREENFIELD_RPC_URL= # Greenfield rpc url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just relized that we need bridge token from BSC to gnfd... would you please add it in the bridge action?
Background
What does this PR do?
Add
Greenfield
actionWhat kind of change is this?
gnfdAction.ts
Documentation changes needed?
Add env:
Testing
Where should a reviewer start?
Detailed testing steps