Skip to content
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(plugins): adds testnet address for unruggable #56

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

ZackAttax
Copy link
Contributor

No description provided.

"allowed_internal_tools": ["get_balance", "get_own_balance", "swap_tokens"]
"external_client": [],
"allowed_external_client_tools": [],
"allowed_internal_tools": ["get_balance", "get_own_balance", "swap_tokens", "create_memecoin", "launch_on_ekubo"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you rather implement a specific config for unruggable agents under config/agents/unruggable.agent.json

Copy link
Contributor Author

@ZackAttax ZackAttax Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using this config for manual testing but sure

@antiyro antiyro changed the title Feat/adds testnet address for unruggable feat(plugins): added testnet address for unruggable Feb 12, 2025
@ZackAttax ZackAttax changed the title feat(plugins): added testnet address for unruggable feat(plugins): adds testnet address for unruggable Feb 13, 2025
@ZackAttax ZackAttax marked this pull request as ready for review February 13, 2025 02:04
.env.example Outdated
@@ -1,4 +1,5 @@
# Starknet configuration (mandatory)
STARKNET_NETWORK=testnet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you keep an exemple value here like YOUR_STARKNET_NETWORK

@antiyro
Copy link
Member

antiyro commented Feb 13, 2025

@ZackAttax Actually, I’m not sure if relying on an environment variable for the network is the right solution since "mainnet" could be defined as:

  • "mainnet"
  • "SN_MAIN"
  • "0x534e5f4d41494e"

Each plugin could define it in its own way if we don’t enforce a standard. But the problem is that limiting it to just "mainnet" and "testnet," for example, would break compatibility with App Chains.

One possible solution to ensure a unique source of truth would be for getNetwork to store once provider.chainId, which should return option 3, "0x534e5f4d41494e," for mainnet. This can then be interpreted as option 2, "SN_MAIN".
In the case of App Chains, it would work out of the box.

Users would then have to implement it as follows:

export const getNetworkFactoryAddress = (agent: StarknetAgentInterface) => {
  const network = agent.getNetwork();
  return network === 'SN_MAIN'
    ? FACTORY_ADDRESS_MAINNET
    : FACTORY_ADDRESS_TESTNET;
};

The only cons is that it is a bit more low level for users and devs but way more exportable accross all networks.

@ZackAttax ZackAttax requested a review from antiyro February 14, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants