Guys, i want to store the addresses of any account that interact with a function on my smart contracts.

What is the best way to do so ?
If I create an array, then whenever i want to add new address to array , i will first have to check whether it already exists or not.

Also, arrays will cost more gas ?

Apr 4, 2022, 11:07 AM
Could just use a mapping like:

mapping(address => bool) hasInteracted;
Apr 4, 2022, 1:26 PM

© 2024 Draquery.com All rights reserved.