# Airdrop - but with an amount set from a database

**URL:** <https://forum.openzeppelin.com/t/airdrop-but-with-an-amount-set-from-a-database/26973>\
**Category:** Smart Contracts\
**Tags:** erc20\
**Created:** [March 29, 2022, 3:10pm UTC](https://forum.openzeppelin.com/t/airdrop-but-with-an-amount-set-from-a-database/26973 "2022-03-29T15:10:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheDev](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@TheDev](https://forum.openzeppelin.com/u/TheDev)\
**Post date:** [March 29, 2022, 3:10pm UTC](https://forum.openzeppelin.com/t/airdrop-but-with-an-amount-set-from-a-database/26973/1 "2022-03-29T15:10:54Z")

</div>

Hi All,

I am looking for some help with a question about writing a smart contract function.

If I create a basic withdraw function, anyone would be able to call this - so how could I go about allowing users to call this function from within the dapp and having the smart contract only allow calls from within the dapp, which would allow users to withdraw a set amount from the contract and the set amount being set in a database

---

<div class="post-metadata">

**Author:** ![Peter\_Roy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/peter_roy/32/10769_2.png) [@Peter\_Roy](https://forum.openzeppelin.com/u/Peter_Roy)\
**Post date:** [March 30, 2022, 12:48am UTC](https://forum.openzeppelin.com/t/airdrop-but-with-an-amount-set-from-a-database/26973/2 "2022-03-30T00:48:55Z")

</div>

Hello friend

I will help you

Hit me up on Telegram @PeterRoyHere
