import { BigNumber } from "bignumber.js" ; import { CollateralizeScenario , } from "../runners/" ; import * as Units from "../../../test_utils/units" ; const defaultArgs = { collateralTokenAllowance : Units . ether ( 50000 ) , collateralTokenBalance : Units . ether ( 50000 ) , from : ( kernel , attacker ) => kernel , succeeds : true , termsContract : ( collateralizedContract , attacker ) => collateralizedContract , } ; export const SUCCESSFUL_COLLATERALIZATION_SCENARIOS = [ { description : "Collateralize 0.005 REP with 20 day grace period" , ... defaultArgs , agreementId : web3 . sha3 ( "Arbitrary 32 byte id for REP collateralization test" ) , expectedCollateralAmount : Units . ether ( 0.005 ) , expectedCollateralToken : "REP" , expectedGracePeriodInDays : new BigNumber ( 20 ) , collateralTokenIndexInRegistry : new BigNumber ( 0 ) , termsContractParameters : "0x00000000000000000000000000000000000000000000000011c37937e0800014" , } , { description : "Collateralize 1 ZRX with 0 day grace period" , ... defaultArgs , agreementId : web3 . sha3 ( "Arbitrary 32 byte id for ZRX collateralization test" ) , expectedCollateralAmount : Units . ether ( 1 ) , expectedCollateralToken : "ZRX" , expectedGracePeriodInDays : new BigNumber ( 1 ) , collateralTokenIndexInRegistry : new BigNumber ( 2 ) , termsContractParameters : "0x00000000000000000000000000000000000000200000000de0b6b3a764000001" , } , { description : "Collateralize 40312 MKR with 7 day grace period" , ... defaultArgs , agreementId : web3 . sha3 ( "Arbitrary 32 byte id for MKR collateralization test" ) , expectedCollateralAmount : Units . ether ( 40312 ) , expectedCollateralToken : "MKR" , expectedGracePeriodInDays : new BigNumber ( 7 ) , collateralTokenIndexInRegistry : new BigNumber ( 1 ) , termsContractParameters : "0x00000000000000000000000000000000000000100008895161d1decae0000007" , } , ] ;