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

chore: Fix Smart Contract reads without ABI specified #217

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

alex-stone
Copy link
Contributor

What changed? Why?

This fixes Smart Contract reads with no ABI specified. We support using ABIs from our deployed smart contracts and well known asset standards, namely ERC20, ERC721, and ERC1155 token contracts.

How to test this

Make a request to read a well known ERC20 asset without specifying an ABI:

asset = Coinbase::Asset.fetch('base-sepolia', 'usdc')

Coinbase::SmartContract.read(
  network: Coinbase::Network::BASE_SEPOLIA,
  contract_address: asset.address_id,
  method: 'balanceOf',
  args: { account: "alexstone.base.eth"},
)

Qualified Impact

This fixes Smart Contract reads with no ABI specified. We support
using ABIs from our deployed smart contracts and well known asset
standards, namely ERC20, ERC721, and ERC1155 token contracts.

```
asset = Coinbase::Asset.fetch('base-sepolia', 'usdc')

Coinbase::SmartContract.read(
  network: Coinbase::Network::BASE_SEPOLIA,
  contract_address: asset.address_id,
  method: 'balanceOf',
  args: { account: "alexstone.base.eth"},
)
```
@alex-stone alex-stone merged commit 1e4a621 into v0.11.0 Nov 13, 2024
10 checks passed
@alex-stone alex-stone deleted the stone/fix-smart-contract-abi-reads branch November 13, 2024 18:42
@alex-stone alex-stone mentioned this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants