# SafeERC20

## library SafeERC20

Source: [contracts/common/SafeERC20.sol](https://github.com/aragon/aragonOS/blob/v4.4.0/contracts/common/SafeERC20.sol)

## Index

* [safeApprove](#safeapprove)
* [safeTransfer](#safetransfer)
* [safeTransferFrom](#safetransferfrom)
* [staticAllowance](#staticallowance)
* [staticBalanceOf](#staticbalanceof)
* [staticTotalSupply](#statictotalsupply)

## Reference

### Functions

#### **safeApprove** <a href="#safeapprove" id="safeapprove"></a>

` function`` `` `**`safeApprove`**`(ERC20 _token, address _spender, uint256 _amount) internal returns (bool)`

***

Same as a standards-compliant ERC20.approve() that never reverts (returns false). Note that this makes an external call to the token.

Parameters:

* `_token` - ERC20
* `_spender` - address
* `_amount` - uint256

Returns:

* bool

#### **safeTransfer** <a href="#safetransfer" id="safetransfer"></a>

` function`` `` `**`safeTransfer`**`(ERC20 _token, address _to, uint256 _amount) internal returns (bool)`

***

Same as a standards-compliant ERC20.transfer() that never reverts (returns false). Note that this makes an external call to the token.

Parameters:

* `_token` - ERC20
* `_to` - address
* `_amount` - uint256

Returns:

* bool

#### **safeTransferFrom** <a href="#safetransferfrom" id="safetransferfrom"></a>

` function`` `` `**`safeTransferFrom`**`(ERC20 _token, address _from, address _to, uint256 _amount) internal returns (bool)`

***

Same as a standards-compliant ERC20.transferFrom() that never reverts (returns false). Note that this makes an external call to the token.

Parameters:

* `_token` - ERC20
* `_from` - address
* `_to` - address
* `_amount` - uint256

Returns:

* bool

#### **staticAllowance** <a href="#staticallowance" id="staticallowance"></a>

` function`` `` `**`staticAllowance`**`(ERC20 _token, address _owner, address _spender) internal view returns (uint256)`

***

Static call into ERC20.allowance(). Reverts if the call fails for some reason (should never fail).

Parameters:

* `_token` - ERC20
* `_owner` - address
* `_spender` - address

Returns:

* uint256

#### **staticBalanceOf** <a href="#staticbalanceof" id="staticbalanceof"></a>

` function`` `` `**`staticBalanceOf`**`(ERC20 _token, address _owner) internal view returns (uint256)`

***

Static call into ERC20.balanceOf(). Reverts if the call fails for some reason (should never fail).

Parameters:

* `_token` - ERC20
* `_owner` - address

Returns:

* uint256

#### **staticTotalSupply** <a href="#statictotalsupply" id="statictotalsupply"></a>

` function`` `` `**`staticTotalSupply`**`(ERC20 _token) internal view returns (uint256)`

***

Static call into ERC20.totalSupply(). Reverts if the call fails for some reason (should never fail).

Parameters:

* `_token` - ERC20

Returns:

* uint256


---

# 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://legacy-docs.aragon.org/developers/tools/aragonos/smart-contract-references/common/safeerc20.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.
