Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Тестовое задание компании Bidask Protocol. Позиция - Blockchain Developer (EVM, Solidity)

Notifications You must be signed in to change notification settings

drillcoder/bidask-protocol-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task

You need to implement a single contract that executes an offchain-signed EIP-712 order to exchange ERC721 (tokenId) for an ERC20 payment.

Requirements:

  • fill atomically executes two transfers: IERC721 and ERC20 transfers in opposite directions.
  • EIP-712 order.maker signature with EOA and ERC-1271 support
  • cancel(nonce) makes the nonce unusable
  • Use foundry

Interface

struct Order {
    address maker;
    address taker;
    address nft;
    uint256 tokenId;
    address paymentToken;
    uint256 amount;
    uint256 minReceive;
    uint256 nonce;
    uint256 deadline;
}

struct Permit {
    uint256 value;
    uint256 deadline;
    uint8 v;
    bytes32 r;
    bytes32 s;
}

function fill(
    Order calldata order,
    bytes calldata makerSignature,
    Permit calldata permitData,
    address recipient
) external;

function cancel(uint256 nonce) external;

event OrderFilled(
    bytes32 orderHash,
    address maker,
    address taker,
    address nft,
    uint256 tokenId,
    address paymentToken,
    uint256 netReceived,
    address recipient
);

event OrderCanceled(address maker, uint256 nonce);

About

Тестовое задание компании Bidask Protocol. Позиция - Blockchain Developer (EVM, Solidity)

Resources

Stars

Watchers

Forks