Verifies POST bodies from Paycrest’s sender webhooks using the X-Paycrest-Signature header (HMAC-SHA256, hex digest).
- Node.js (
crypto:createHmac,timingSafeEqual)
| // SPDX-License-Identifier: MIT | |
| interface IERC20 { | |
| function balanceOf(address owner) external view returns (uint); | |
| function transfer(address to, uint value) external returns (bool); | |
| function transferFrom(address from, address to, uint value) external returns (bool); | |
| } | |
| abstract contract Context { | |
| function _msgSender() internal view virtual returns (address) { |
| /** | |
| *Submitted for verification at BscScan.com on 2021-07-21 | |
| */ | |
| /** | |
| *Submitted for verification at BscScan.com on 2021-06-10 | |
| */ | |
| /** | |
| *Submitted for verification at BscScan.com on 2021-06-07 |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.6.0; | |
| import { CBORChainlink } from "./vendor/CBORChainlink.sol"; | |
| import { BufferChainlink } from "./vendor/BufferChainlink.sol"; | |
| /** | |
| * @title Library for common Chainlink functions | |
| * @dev Uses imported CBOR library for encoding to buffer | |
| */ |
| pragma solidity ^0.6.12; | |
| import "./ChainlinkClient.sol"; | |
| interface IERC20 { | |
| function balanceOf(address owner) external view returns (uint); | |
| function approve(address spender, uint value) external returns (bool); | |
| function transfer(address to, uint value) external returns (bool); | |
| function transferFrom(address from, address to, uint value) external returns (bool); | |
| } |
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.9; | |
| interface interEnum { | |
| enum SIDE { | |
| buy, | |
| sell | |
| } | |
| } |