Skip to content

Commit e47b5b2

Browse files
committed
Updated the sample in the readme.md
1 parent c284cc2 commit e47b5b2

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,13 @@
77
## Documentation
88
You can access the full docs at [docs.gaming.chainsafe.io](https://docs.gaming.chainsafe.io).
99

10-
Our codebase is quite easy to use. This is an example of accessing player balance and calling a write method of a custom Smart Contract within Unity.
10+
Our codebase is quite easy to use. To immediately start with reading from the blockchain, once you've installed our core package,you can simply drag and drop our Web3Unity prefab to the scene and do the following
1111

1212
```csharp
1313
async void Awake()
1414
{
15-
// Build Web3 client
16-
var web3 = await BuildWeb3();
17-
18-
// Get ERC-20 balance for current user
19-
var balance = await web3.Erc20.GetBalanceOf(erc20ContractAddress);
20-
21-
// Interact with custom Contract
22-
var customContract = web3.ContractBuilder.Build(contractAbi, contractAddress);
23-
var friendHp = await customContract.SendSingle<int, BigInteger>("healPlayer", nftItemId);
15+
await Web3Unity.Instance.Initialize(false);
16+
var balance = await Web3Unity.Web3.Erc20.GetBalanceOf(contractAddress, accountAddress);
2417
}
2518
```
2619

0 commit comments

Comments
 (0)