0

Hello everyone…I am trying to build a dapp where a user can request funds or ethers from a specific address and then that address can approve that function, then the person who requested the fund will get it when it has been approved…how can I go about this in Solidity ??

New contributor
EniKay is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1 Answer 1

1

You cannot do that with only Solidity. You'd have to create a contract that records requests for a specific address. maybe something like:

struct Requests {
  uint256[] amountOfRequest;
  address[] demander;
}

mapping(address => Requests) requestsPerAddress;

function issueRequest( address _from, uint _amountRequested) external {}

function acceptRequest(uint _requestIndex) external {}

After that a solution could be to track the transactions for specific function calls or events. Openzeppelin Defender can do that for you with the Sentinel

https://docs.openzeppelin.com/defender/sentinel

and trigger a code snippet with Autotask

https://docs.openzeppelin.com/defender/autotasks

Your Answer

EniKay is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.