# Interactions

**User executes a simple stake of ERC20 tokens into a pool**

```javascript
// get addresses and connect to contracts
const pool = await Pool.at('0xpool');
const stk = await ERC20.at('0xtoken');
const stakingmodule = await Pool.stakingModule();

// make sure tokens are approved
await stk.approve(stakingmodule, toWei('100'), { from: alice });

// alice stakes 100 tokens
await pool.stake(toWei('100'), [], [], { from: alice });
```

**Pool controller funds rewards tokens for a pool**

```javascript
// get addresses and connect to contracts
const pool = await Pool.at('0xpool');
const rew = await ERC20.at('0xtoken');
const rewardmodule = await ERC20FriendlyRewardModule.at(Pool.rewardModule());

// make sure tokens are approved
await rew.approve(this.rewardmodule.address, toWei('5000'), { from: controller });

// controller funds 5000 tokens
await rewardmodule.fund(toWei('5000'), [], [], { from: controller });
```

*More examples coming soon!*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gysr.io/developers/interactions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
