Can I use OpenZeppelin to write a peer-to-peer smart contract trading platform?

Thinking on how to get started in writing a peer-2-peer smart contract with exchange features just like paxfull.

with an Exchange Features, Trading Platform, and a wallet

1 Like

Hey, could you please explain more about your idea?
So in this contract, only Alice and Bob can trade?

1 Like

A trade between Alice and Bob,
Alice decided to sell a token from her wallet to Bob and once Alice signed the token off for sales into Bob address then the system will require bob to accept Bob by signing the transaction to deduct fiat (or any choice token) from his walllet, then and exchange occurs.

1 Like

Maybe such a function, but this code has not been audited, use at your own risk

   function transferTokenTo(address to, uint256 amount) public nonReentrant {
        _transfer(msg.sdender, address(this), amount);
        _withdrawableAmount[to] = _withdrawableAmount[to].add(amount);

    function withdraw(uint256 amount) public nonReentrant {
        require(_withdrawableAmount[msg.sender] >= amount);
        _withdrawableAmount[to] = _withdrawableAmount[to].sub(amount);
        _transfer(address(this), msg.sender, amount);
1 Like