generated from ZumZoom/solidity-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from 1inch/audits/SC-1216-N02
N02 Add security contact
- Loading branch information
Showing
25 changed files
with
43 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import { IBaseEscrow } from "./interfaces/IBaseEscrow.sol"; | |
/** | ||
* @title Base abstract Escrow contract for cross-chain atomic swap. | ||
* @dev {IBaseEscrow-withdraw}, {IBaseEscrow-cancel} and _validateImmutables functions must be implemented in the derived contracts. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
abstract contract BaseEscrow is IBaseEscrow { | ||
using AddressLib for Address; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ import { MerkleStorageInvalidator } from "./MerkleStorageInvalidator.sol"; | |
* @title Abstract contract for escrow factory | ||
* @notice Contract to create escrow contracts for cross-chain atomic swap. | ||
* @dev Immutable variables must be set in the constructor of the derived contracts. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
abstract contract BaseEscrowFactory is IEscrowFactory, ResolverValidationExtension, MerkleStorageInvalidator { | ||
using AddressLib for Address; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ import { BaseEscrow } from "./BaseEscrow.sol"; | |
/** | ||
* @title Abstract Escrow contract for cross-chain atomic swap. | ||
* @dev {IBaseEscrow-withdraw} and {IBaseEscrow-cancel} functions must be implemented in the derived contracts. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
abstract contract Escrow is BaseEscrow, IEscrow { | ||
using ImmutablesLib for Immutables; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ import { Escrow } from "./Escrow.sol"; | |
* @notice Contract to initially lock funds and then unlock them with verification of the secret presented. | ||
* @dev Funds are locked in at the time of contract deployment. For this taker calls the `EscrowFactory.createDstEscrow` function. | ||
* To perform any action, the caller must provide the same Immutables values used to deploy the clone contract. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract EscrowDst is Escrow, IEscrowDst { | ||
using SafeERC20 for IERC20; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ import { MerkleStorageInvalidator } from "./MerkleStorageInvalidator.sol"; | |
/** | ||
* @title Escrow Factory contract | ||
* @notice Contract to create escrow contracts for cross-chain atomic swap. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract EscrowFactory is BaseEscrowFactory { | ||
constructor( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ import { Escrow } from "./Escrow.sol"; | |
* @dev Funds are locked in at the time of contract deployment. For this Limit Order Protocol | ||
* calls the `EscrowFactory.postInteraction` function. | ||
* To perform any action, the caller must provide the same Immutables values used to deploy the clone contract. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract EscrowSrc is Escrow, IEscrowSrc { | ||
using AddressLib for Address; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import { SRC_IMMUTABLES_LENGTH } from "./EscrowFactoryContext.sol"; // solhint-d | |
/** | ||
* @title Merkle Storage Invalidator contract | ||
* @notice Contract to invalidate hashed secrets from an order that supports multiple fills. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract MerkleStorageInvalidator is IMerkleStorageInvalidator, ITakerInteraction { | ||
using MerkleProof for bytes32[]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import { Timelocks } from "../libraries/TimelocksLib.sol"; | |
/** | ||
* @title Base Escrow interface for cross-chain atomic swap. | ||
* @notice Interface implies locking funds initially and then unlocking them with verification of the secret presented. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface IBaseEscrow { | ||
struct Immutables { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { IBaseEscrow } from "./IBaseEscrow.sol"; | |
/** | ||
* @title Escrow interface for cross-chain atomic swap. | ||
* @notice Interface implies locking funds initially and then unlocking them with verification of the secret presented. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface IEscrow is IBaseEscrow { | ||
/// @notice Returns the bytecode hash of the proxy contract. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { IEscrow } from "./IEscrow.sol"; | |
/** | ||
* @title Destination Escrow interface for cross-chain atomic swap. | ||
* @notice Interface implies withdrawing funds initially and then unlocking them with verification of the secret presented. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface IEscrowDst is IEscrow { | ||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ import { IBaseEscrow } from "./IBaseEscrow.sol"; | |
/** | ||
* @title Escrow Factory interface for cross-chain atomic swap. | ||
* @notice Interface to deploy escrow contracts for the destination chain and to get the deterministic address of escrow on both chains. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface IEscrowFactory { | ||
struct ExtraDataArgs { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { IEscrow } from "./IEscrow.sol"; | |
/** | ||
* @title Source Escrow interface for cross-chain atomic swap. | ||
* @notice Interface implies locking funds initially and then unlocking them with verification of the secret presented. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface IEscrowSrc is IEscrow { | ||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ pragma solidity 0.8.23; | |
/** | ||
* @title Merkle Storage Invalidator interface | ||
* @notice Interface to invalidate hashed secrets from an order that supports multiple fills. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface IMerkleStorageInvalidator { | ||
struct LastValidated { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import { IBaseEscrow } from "../interfaces/IBaseEscrow.sol"; | |
|
||
/** | ||
* @title Interface for the sample implementation of a Resolver contract for cross-chain swap. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
interface IResolverExample { | ||
error InvalidLength(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import { IBaseEscrow } from "../interfaces/IBaseEscrow.sol"; | |
|
||
/** | ||
* @title Library for escrow immutables. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
library ImmutablesLib { | ||
uint256 internal constant ESCROW_IMMUTABLES_SIZE = 0x100; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.20; | |
|
||
/** | ||
* @title Library to compute the hash of the proxy bytecode. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
library ProxyHashLib { | ||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ pragma solidity ^0.8.20; | |
* publicWithdrawal: Period when anyone with a secret can withdraw tokens for maker (destination chain). | ||
* cancellation: Period when escrow can only be cancelled by the taker. | ||
* publicCancellation: Period when escrow can be cancelled by anyone. | ||
* | ||
* @custom:security-contact [email protected] | ||
*/ | ||
type Timelocks is uint256; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,9 @@ import { Timelocks } from "../libraries/TimelocksLib.sol"; | |
* @title Sample implementation of a Resolver contract for cross-chain swap. | ||
* @dev It is important when deploying an escrow on the source chain to send the safety deposit and deploy the escrow in the same | ||
* transaction, since the address of the escrow depends on the block.timestamp. | ||
* You can find sample code for this in the {ResolverExample-deploySrc}. | ||
* You can find sample code for this in the {ResolverExample-deploySrc}. | ||
* | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract ResolverExample is IResolverExample, Ownable { | ||
IEscrowFactory private immutable _FACTORY; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ pragma solidity 0.8.23; | |
import { Escrow, EscrowDst } from "../EscrowDst.sol"; | ||
import { EscrowZkSync } from "./EscrowZkSync.sol"; | ||
|
||
/// @custom:security-contact [email protected] | ||
contract EscrowDstZkSync is EscrowDst, EscrowZkSync { | ||
constructor(uint32 rescueDelay) EscrowDst(rescueDelay) EscrowZkSync() {} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ import { ZkSyncLib } from "./ZkSyncLib.sol"; | |
/** | ||
* @title Escrow Factory contract | ||
* @notice Contract to create escrow contracts for cross-chain atomic swap. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
contract EscrowFactoryZkSync is BaseEscrowFactory { | ||
using ImmutablesLib for IBaseEscrow.Immutables; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ pragma solidity 0.8.23; | |
import { Escrow, EscrowSrc } from "../EscrowSrc.sol"; | ||
import { EscrowZkSync } from "./EscrowZkSync.sol"; | ||
|
||
/// @custom:security-contact [email protected] | ||
contract EscrowSrcZkSync is EscrowSrc, EscrowZkSync { | ||
constructor(uint32 rescueDelay) EscrowSrc(rescueDelay) EscrowZkSync() {} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { BaseEscrow } from "../BaseEscrow.sol"; | |
import { ImmutablesLib } from "../libraries/ImmutablesLib.sol"; | ||
import { ZkSyncLib } from "./ZkSyncLib.sol"; | ||
|
||
/// @custom:security-contact [email protected] | ||
abstract contract EscrowZkSync is BaseEscrow { | ||
using ImmutablesLib for Immutables; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
pragma solidity 0.8.23; | ||
|
||
/// @custom:security-contact [email protected] | ||
contract MinimalProxyZkSync { | ||
address private immutable _IMPLEMENTATION; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.20; | |
|
||
/** | ||
* @title Library for ZkSync contracts. | ||
* @custom:security-contact [email protected] | ||
*/ | ||
library ZkSyncLib { | ||
// keccak256("zksyncCreate2") | ||
|