# Should ERC20 and ERC721 return true or not

**URL:** <https://forum.openzeppelin.com/t/should-erc20-and-erc721-return-true-or-not/6539>\
**Category:** Contracts\
**Created:** [March 26, 2021, 11:35am UTC](https://forum.openzeppelin.com/t/should-erc20-and-erc721-return-true-or-not/6539 "2021-03-26T11:35:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxareo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/maxareo/32/11606_2.png) [@maxareo](https://forum.openzeppelin.com/u/maxareo)\
**Post date:** [March 26, 2021, 11:35am UTC](https://forum.openzeppelin.com/t/should-erc20-and-erc721-return-true-or-not/6539/1 "2021-03-26T11:35:06Z")

</div>

Hi there,

As I was writing both ERC20 and ERC721 lately, I found out that in ERC20, functions like transfer, approve and transferFrom return the boolean value true, whereas in ERC721, the same functions don’t return any boolean value.

Can anyone please tell me if they should return true or not? Can OpenZeppelin double check on their implementations? I bet more consistency is always more favorable.

Besides, inconsistencies also happen at how input variables are cannotated: for example, in ERC20, variables like from, to have a postfix underscore, i.e., from\_, to\_, whereas in ERC721, the postfix is not added. Is there a reason for this as well?

Cheers!

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [March 30, 2021, 3:56am UTC](https://forum.openzeppelin.com/t/should-erc20-and-erc721-return-true-or-not/6539/2 "2021-03-30T03:56:29Z")

</div>

Hi @maxareo,

OpenZeppelin Contracts token implementations should follow the EIP.

ERC20 transfer returns a boolean:  
[https://eips.ethereum.org/EIPS/eip-20](https://eips.ethereum.org/EIPS/eip-20)

ERC721 transfer doesn't return:  
[https://eips.ethereum.org/EIPS/eip-721](https://eips.ethereum.org/EIPS/eip-721)

There may be inconsistencies between the EIPs.

> [@maxareo](#):
>
> Besides, inconsistencies also happen at how input variables are cannotated: for example, in ERC20, variables like from, to have a postfix underscore, i.e., from\_, to\_, whereas in ERC721, the postfix is not added. Is there a reason for this as well?

Can you give an example of inconsistencies in the OpenZeppelin Contracts implementations?

I couldn't find `from_` or `to_` in the following:

> <https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC20/ERC20.sol>

> <https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC721/ERC721.sol>

---

<div class="post-metadata">

**Author:** ![maxareo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/maxareo/32/11606_2.png) [@maxareo](https://forum.openzeppelin.com/u/maxareo)\
**Post date:** [March 30, 2021, 4:23am UTC](https://forum.openzeppelin.com/t/should-erc20-and-erc721-return-true-or-not/6539/3 "2021-03-30T04:23:48Z")

</div>

I figured out that the postfixes are only used in constructors, so it may not be an issue at all.

```
constructor (string memory name_, string memory symbol_) {
    _name = name_;
    _symbol = symbol_;
}

```

> <https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol>

Here as well:

> <https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol>

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [March 30, 2021, 8:07am UTC](https://forum.openzeppelin.com/t/should-erc20-and-erc721-return-true-or-not/6539/4 "2021-03-30T08:07:00Z")

</div>

Hi @maxareo,

I assume this is to avoid clashes with the getter functions for `name` and `symbol` and the private state variables `_name` and `_symbol`

---

<div class="post-metadata">

**Author:** ![maxareo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/maxareo/32/11606_2.png) [@maxareo](https://forum.openzeppelin.com/u/maxareo)\
**Post date:** [March 30, 2021, 12:53pm UTC](https://forum.openzeppelin.com/t/should-erc20-and-erc721-return-true-or-not/6539/5 "2021-03-30T12:53:49Z")

</div>

I see. That makes sense. There is a legitimate reason beyond a naming convention. Thanks.
