@keep-network/tbtc-v2 0.1.1-dev.30 → 0.1.1-dev.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -131,8 +131,8 @@
131
131
  "type": "event"
132
132
  }
133
133
  ],
134
- "bytecode": "0x611d9561003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100925760003560e01c8063403994031161006557806340399403146101195780635452278714610139578063c945968614610159578063e6d20d451461018b57600080fd5b806305cf9ce3146100975780632123f1c4146100b95780632a6f2ad8146100d95780633f31f49f146100f9575b600080fd5b8180156100a357600080fd5b506100b76100b23660046118d8565b6101ab565b005b8180156100c557600080fd5b506100b76100d436600461192b565b6104b8565b8180156100e557600080fd5b506100b76100f436600461194d565b6104f3565b81801561010557600080fd5b506100b76101143660046119e2565b610763565b81801561012557600080fd5b506100b761013436600461192b565b610954565b81801561014557600080fd5b506100b761015436600461192b565b6109ee565b81801561016557600080fd5b50610179610174366004611a87565b610a9c565b60405190815260200160405180910390f35b81801561019757600080fd5b506100b76101a636600461192b565b610c72565b60008383836040516020016101c293929190611b0a565b60408051601f198184030181529181528151602092830120600081815260048901909352912060028101549192509063ffffffff166102485760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520646f6573206e6f74206578697374000060448201526064015b60405180910390fd5b6002810154640100000000900460ff16156102b75760405162461bcd60e51b815260206004820152602960248201527f4672617564206368616c6c656e67652068617320616c7265616479206265656e604482015268081c995cdbdb1d995960ba1b606482015260840161023f565b600280870154908201546102d1919063ffffffff16611b32565b4210156103465760405162461bcd60e51b815260206004820152603260248201527f4672617564206368616c6c656e67652064656665617420706572696f6420646960448201527f64206e6f742074696d65206f7574207965740000000000000000000000000000606482015260840161023f565b60028101805464ff0000000019166401000000001790558054600182015460405173ffffffffffffffffffffffffffffffffffffffff90921691620186a091906000818181858888f193505050503d80600081146103c0576040519150601f19603f3d011682016040523d82523d6000602084013e6103c5565b606091505b5050506000610455610411600088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293925050610d0c9050565b604080516020601f8a0181900481028201810190925288815261045091908a8a808385018382808284376000920191909152509293925050610d0c9050565b610d14565b9050600061046282610dbf565b604080516bffffffffffffffffffffffff1983168152602081018890529192507f635230b60143449f10a365568e2bd95e3e8aaed03855631722941c2bad634b7791015b60405180910390a15050505050505050565b8082556040518181527fdf25ccd778c4ac0298894525a8bd99ba018936d0c6ea0b6fc212507531c0adb7906020015b60405180910390a15050565b856003015434101561056d5760405162461bcd60e51b815260206004820152602660248201527f54686520616d6f756e74206f6620455448206465706f7369746564206973207460448201527f6f6f206c6f770000000000000000000000000000000000000000000000000000606482015260840161023f565b6105c585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508692506105b99150506060850160408601611b4a565b84356020860135610de6565b6106115760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726520766572696669636174696f6e206661696c7572650000604482015260640161023f565b600085858460405160200161062893929190611b0a565b60408051601f198184030181529181528151602092830120600081815260048b01909352912060028101549192509063ffffffff16156106aa5760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520616c7265616479206578697374730000604482015260640161023f565b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317815534600182015560028101805464ffffffffff191663ffffffff42161790557ff4aa58d09ba5de017eac597806dfcfc2cad287816cb1eb7729a032c82680c94d85856107236060870160408801611b4a565b604080516bffffffffffffffffffffffff19909416845260208085019390935260ff9091169083015285356060830152850135608082015260a0016104a6565b60006107a484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ef692505050565b905060008686836040516020016107bd93929190611b0a565b60408051601f198184030181528282528051602091820120600081815260048d0190925291902060028101805464ff00000000191664010000000017905560018101549193509173ffffffffffffffffffffffffffffffffffffffff861691620186a091600060405180830381858888f193505050503d806000811461085f576040519150601f19603f3d011682016040523d82523d6000602084013e610864565b606091505b50505060006108ef6108b060008b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293925050610d0c9050565b604080516020601f8d018190048102820181019092528b815261045091908d8d808385018382808284376000920191909152509293925050610d0c9050565b905060006108fc82610dbf565b604080516bffffffffffffffffffffffff1983168152602081018890529192507f6ff720470ffad78f316655e2c7fc77a76763c13de0e19ee52149916ba7e44d3b910160405180910390a15050505050505050505050565b600081116109b75760405162461bcd60e51b815260206004820152602a60248201527f4672617564206368616c6c656e6765206465666561742074696d656f7574206d6044820152690757374206265203e20360b41b606482015260840161023f565b600282018190556040518181527f1e833ee8be2754de7dae1749a8438b691fda5b0695db2b2b8311b23270406d5a906020016104e7565b6064811115610a655760405162461bcd60e51b815260206004820152602f60248201527f4672617564206e6f74696669657220726577617264206d756c7469706c69657260448201527f206d757374206265203c3d203130300000000000000000000000000000000000606482015260840161023f565b600182018190556040518181527feddb2abfc2e3aa166fbafa0dbaa077f0ec7663ddc8a535253bb35ed4ab70c877906020016104e7565b600080610ade85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ef692505050565b90506000878783604051602001610af793929190611b0a565b60408051601f198184030181529181528151602092830120600081815260048d01909352912060028101549192509063ffffffff16610b785760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520646f6573206e6f742065786973740000604482015260640161023f565b6002810154640100000000900460ff1615610be75760405162461bcd60e51b815260206004820152602960248201527f4672617564206368616c6c656e67652068617320616c7265616479206265656e604482015268081c995cdbdb1d995960ba1b606482015260840161023f565b610bf18787610fb5565b63ffffffff16600114610c465760405162461bcd60e51b815260206004820152601260248201527f57726f6e67207369676861736820747970650000000000000000000000000000604482015260640161023f565b84610c5a57610c558787611036565b610c64565b610c64878761127a565b9a9950505050505050505050565b60008111610cd55760405162461bcd60e51b815260206004820152602a60248201527f4672617564206368616c6c656e6765206465706f73697420616d6f756e74206d6044820152690757374206265203e20360b41b606482015260840161023f565b600382018190556040518181527fac6cc6a5e862456c7f1a3827f078d9a355cb82eef2353c4167e872673b48570c906020016104e7565b016020015190565b60606000610d23600284611b6d565b610d4e57507f0200000000000000000000000000000000000000000000000000000000000000610d71565b507f03000000000000000000000000000000000000000000000000000000000000005b6040517fff0000000000000000000000000000000000000000000000000000000000000082166020820152602181018590526041016040516020818303038152906040529150505b92915050565b60006020600083516020850160025afa50602060006020600060035afa5050600c51919050565b60008551604014610e5f5760405162461bcd60e51b815260206004820152602760248201527f526571756972657320756e636f6d7072657373656420756e707265666978656460448201527f207075626b657900000000000000000000000000000000000000000000000000606482015260840161023f565b6000610e6a87611370565b604080516000808252602082018084528a905260ff89169282019290925260608101879052608081018690529192509060019060a0016020604051602081039080840390855afa158015610ec2573d6000803e3d6000fd5b5050604051601f19015173ffffffffffffffffffffffffffffffffffffffff90811693169290921498975050505050505050565b600060028083604051610f099190611b8f565b602060405180830381855afa158015610f26573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610f499190611bca565b604051602001610f5b91815260200190565b60408051601f1981840301815290829052610f7591611b8f565b602060405180830381855afa158015610f92573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610db99190611bca565b600080610ffc600485858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506113f59050565b9050600061100982611422565b9050600881811b63ff00ff001662ff00ff9183901c9190911617601081811b91901c175b95945050505050565b600080600061107f600486868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506114a79050565b90925090506000611091836005611b32565b905060005b828110156112705760006110e38389898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116259050565b9050600061112a848a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116709050565b915050801561124f576000611178858b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116b79050565b905060006111e86111c2878d8d8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116cd9050565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b9050818160405160200161122b92919091825260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6040516020818303038152906040528051906020012060001c985050505050611270565b6112598285611b32565b93505050808061126890611be3565b915050611096565b5050505092915050565b6000806112c1604485858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116b79050565b9050600061130c6111c2604487878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116cd9050565b9050818160405160200161134f92919091825260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b60408051601f19818403018152919052805160209091012095945050505050565b600081516040146113e95760405162461bcd60e51b815260206004820152602d60248201527f5075626b6579206d7573742062652036342d62797465207261772c20756e636f60448201527f6d70726573736564206b65792e00000000000000000000000000000000000000606482015260840161023f565b50805160209091012090565b6060600061140d8385516116e490919063ffffffff16565b905061141a848285611740565b949350505050565b60008060005b83518110156114a05761143c816001611b32565b84516114489190611bfe565b611453906008611c15565b61145e906002611d18565b84828151811061147057611470611d24565b0160200151611482919060f81c611c15565b61148c9083611b32565b91508061149881611be3565b915050611428565b5092915050565b60008060006114b6858561180a565b905060ff81166114e85760008585815181106114d4576114d4611d24565b016020015190935060f81c915061161e9050565b836114f4826001611d3a565b60ff166115019190611b32565b85511015611518576000196000925092505061161e565b60008160ff166002141561155d5761155261153e611537876001611b32565b88906116b7565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611614565b8160ff16600414156115875761157a6111c2611537876001611b32565b63ffffffff169050611614565b8160ff1660081415611614576116076115a4611537876001611b32565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b60008060006116348585611670565b909250905060001982141561164f5760001992505050610db9565b8061165b836025611b32565b6116659190611b32565b61102d906004611b32565b60008061167e836025611b32565b8451101561169357506000199050600061161e565b6000806116aa866116a5876024611b32565b6114a7565b9097909650945050505050565b60006116c68383016020015190565b9392505050565b60006116c66116dd836020611b32565b84906116b7565b6000828211156117365760405162461bcd60e51b815260206004820152601d60248201527f556e646572666c6f7720647572696e67207375627472616374696f6e2e000000604482015260640161023f565b6116c68284611bfe565b60608161175c57506040805160208101909152600081526116c6565b60006117688385611b32565b9050838111801561177a575080855110155b6117c65760405162461bcd60e51b815260206004820152601360248201527f536c696365206f7574206f6620626f756e647300000000000000000000000000604482015260640161023f565b604051915082604083010160405282825283850182038460208701018481015b808210156117ff578151838301526020820191506117e6565b505050509392505050565b600082828151811061181e5761181e611d24565b60209101015160f81c60ff141561183757506008610db9565b82828151811061184957611849611d24565b60209101015160f81c60fe141561186257506004610db9565b82828151811061187457611874611d24565b60209101015160f81c60fd141561188d57506002610db9565b50600092915050565b60008083601f8401126118a857600080fd5b50813567ffffffffffffffff8111156118c057600080fd5b60208301915083602082850101111561161e57600080fd5b600080600080606085870312156118ee57600080fd5b84359350602085013567ffffffffffffffff81111561190c57600080fd5b61191887828801611896565b9598909750949560400135949350505050565b6000806040838503121561193e57600080fd5b50508035926020909101359150565b60008060008060008086880360e081121561196757600080fd5b87359650602088013567ffffffffffffffff81111561198557600080fd5b6119918a828b01611896565b90975095505060408801356bffffffffffffffffffffffff19811681146119b757600080fd5b93506060888101359350607f19820112156119d157600080fd5b506080870190509295509295509295565b600080600080600080608087890312156119fb57600080fd5b86359550602087013567ffffffffffffffff80821115611a1a57600080fd5b611a268a838b01611896565b90975095506040890135915080821115611a3f57600080fd5b50611a4c89828a01611896565b909450925050606087013573ffffffffffffffffffffffffffffffffffffffff81168114611a7957600080fd5b809150509295509295509295565b60008060008060008060808789031215611aa057600080fd5b86359550602087013567ffffffffffffffff80821115611abf57600080fd5b611acb8a838b01611896565b90975095506040890135915080821115611ae457600080fd5b50611af189828a01611896565b90945092505060608701358015158114611a7957600080fd5b82848237909101908152602001919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b4557611b45611b1c565b500190565b600060208284031215611b5c57600080fd5b813560ff811681146116c657600080fd5b600082611b8a57634e487b7160e01b600052601260045260246000fd5b500690565b6000825160005b81811015611bb05760208186018101518583015201611b96565b81811115611bbf576000828501525b509190910192915050565b600060208284031215611bdc57600080fd5b5051919050565b6000600019821415611bf757611bf7611b1c565b5060010190565b600082821015611c1057611c10611b1c565b500390565b6000816000190483118215151615611c2f57611c2f611b1c565b500290565b600181815b80851115611c6f578160001904821115611c5557611c55611b1c565b80851615611c6257918102915b93841c9390800290611c39565b509250929050565b600082611c8657506001610db9565b81611c9357506000610db9565b8160018114611ca95760028114611cb357611ccf565b6001915050610db9565b60ff841115611cc457611cc4611b1c565b50506001821b610db9565b5060208310610133831016604e8410600b8410161715611cf2575081810a610db9565b611cfc8383611c34565b8060001904821115611d1057611d10611b1c565b029392505050565b60006116c68383611c77565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff84168060ff03821115611d5757611d57611b1c565b01939250505056fea2646970667358221220683252598c0027d13ecac90c652c11af35a26c5b9dc4b702055ebda0a6162e9464736f6c63430008090033",
135
- "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100925760003560e01c8063403994031161006557806340399403146101195780635452278714610139578063c945968614610159578063e6d20d451461018b57600080fd5b806305cf9ce3146100975780632123f1c4146100b95780632a6f2ad8146100d95780633f31f49f146100f9575b600080fd5b8180156100a357600080fd5b506100b76100b23660046118d8565b6101ab565b005b8180156100c557600080fd5b506100b76100d436600461192b565b6104b8565b8180156100e557600080fd5b506100b76100f436600461194d565b6104f3565b81801561010557600080fd5b506100b76101143660046119e2565b610763565b81801561012557600080fd5b506100b761013436600461192b565b610954565b81801561014557600080fd5b506100b761015436600461192b565b6109ee565b81801561016557600080fd5b50610179610174366004611a87565b610a9c565b60405190815260200160405180910390f35b81801561019757600080fd5b506100b76101a636600461192b565b610c72565b60008383836040516020016101c293929190611b0a565b60408051601f198184030181529181528151602092830120600081815260048901909352912060028101549192509063ffffffff166102485760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520646f6573206e6f74206578697374000060448201526064015b60405180910390fd5b6002810154640100000000900460ff16156102b75760405162461bcd60e51b815260206004820152602960248201527f4672617564206368616c6c656e67652068617320616c7265616479206265656e604482015268081c995cdbdb1d995960ba1b606482015260840161023f565b600280870154908201546102d1919063ffffffff16611b32565b4210156103465760405162461bcd60e51b815260206004820152603260248201527f4672617564206368616c6c656e67652064656665617420706572696f6420646960448201527f64206e6f742074696d65206f7574207965740000000000000000000000000000606482015260840161023f565b60028101805464ff0000000019166401000000001790558054600182015460405173ffffffffffffffffffffffffffffffffffffffff90921691620186a091906000818181858888f193505050503d80600081146103c0576040519150601f19603f3d011682016040523d82523d6000602084013e6103c5565b606091505b5050506000610455610411600088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293925050610d0c9050565b604080516020601f8a0181900481028201810190925288815261045091908a8a808385018382808284376000920191909152509293925050610d0c9050565b610d14565b9050600061046282610dbf565b604080516bffffffffffffffffffffffff1983168152602081018890529192507f635230b60143449f10a365568e2bd95e3e8aaed03855631722941c2bad634b7791015b60405180910390a15050505050505050565b8082556040518181527fdf25ccd778c4ac0298894525a8bd99ba018936d0c6ea0b6fc212507531c0adb7906020015b60405180910390a15050565b856003015434101561056d5760405162461bcd60e51b815260206004820152602660248201527f54686520616d6f756e74206f6620455448206465706f7369746564206973207460448201527f6f6f206c6f770000000000000000000000000000000000000000000000000000606482015260840161023f565b6105c585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508692506105b99150506060850160408601611b4a565b84356020860135610de6565b6106115760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726520766572696669636174696f6e206661696c7572650000604482015260640161023f565b600085858460405160200161062893929190611b0a565b60408051601f198184030181529181528151602092830120600081815260048b01909352912060028101549192509063ffffffff16156106aa5760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520616c7265616479206578697374730000604482015260640161023f565b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317815534600182015560028101805464ffffffffff191663ffffffff42161790557ff4aa58d09ba5de017eac597806dfcfc2cad287816cb1eb7729a032c82680c94d85856107236060870160408801611b4a565b604080516bffffffffffffffffffffffff19909416845260208085019390935260ff9091169083015285356060830152850135608082015260a0016104a6565b60006107a484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ef692505050565b905060008686836040516020016107bd93929190611b0a565b60408051601f198184030181528282528051602091820120600081815260048d0190925291902060028101805464ff00000000191664010000000017905560018101549193509173ffffffffffffffffffffffffffffffffffffffff861691620186a091600060405180830381858888f193505050503d806000811461085f576040519150601f19603f3d011682016040523d82523d6000602084013e610864565b606091505b50505060006108ef6108b060008b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293925050610d0c9050565b604080516020601f8d018190048102820181019092528b815261045091908d8d808385018382808284376000920191909152509293925050610d0c9050565b905060006108fc82610dbf565b604080516bffffffffffffffffffffffff1983168152602081018890529192507f6ff720470ffad78f316655e2c7fc77a76763c13de0e19ee52149916ba7e44d3b910160405180910390a15050505050505050505050565b600081116109b75760405162461bcd60e51b815260206004820152602a60248201527f4672617564206368616c6c656e6765206465666561742074696d656f7574206d6044820152690757374206265203e20360b41b606482015260840161023f565b600282018190556040518181527f1e833ee8be2754de7dae1749a8438b691fda5b0695db2b2b8311b23270406d5a906020016104e7565b6064811115610a655760405162461bcd60e51b815260206004820152602f60248201527f4672617564206e6f74696669657220726577617264206d756c7469706c69657260448201527f206d757374206265203c3d203130300000000000000000000000000000000000606482015260840161023f565b600182018190556040518181527feddb2abfc2e3aa166fbafa0dbaa077f0ec7663ddc8a535253bb35ed4ab70c877906020016104e7565b600080610ade85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ef692505050565b90506000878783604051602001610af793929190611b0a565b60408051601f198184030181529181528151602092830120600081815260048d01909352912060028101549192509063ffffffff16610b785760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520646f6573206e6f742065786973740000604482015260640161023f565b6002810154640100000000900460ff1615610be75760405162461bcd60e51b815260206004820152602960248201527f4672617564206368616c6c656e67652068617320616c7265616479206265656e604482015268081c995cdbdb1d995960ba1b606482015260840161023f565b610bf18787610fb5565b63ffffffff16600114610c465760405162461bcd60e51b815260206004820152601260248201527f57726f6e67207369676861736820747970650000000000000000000000000000604482015260640161023f565b84610c5a57610c558787611036565b610c64565b610c64878761127a565b9a9950505050505050505050565b60008111610cd55760405162461bcd60e51b815260206004820152602a60248201527f4672617564206368616c6c656e6765206465706f73697420616d6f756e74206d6044820152690757374206265203e20360b41b606482015260840161023f565b600382018190556040518181527fac6cc6a5e862456c7f1a3827f078d9a355cb82eef2353c4167e872673b48570c906020016104e7565b016020015190565b60606000610d23600284611b6d565b610d4e57507f0200000000000000000000000000000000000000000000000000000000000000610d71565b507f03000000000000000000000000000000000000000000000000000000000000005b6040517fff0000000000000000000000000000000000000000000000000000000000000082166020820152602181018590526041016040516020818303038152906040529150505b92915050565b60006020600083516020850160025afa50602060006020600060035afa5050600c51919050565b60008551604014610e5f5760405162461bcd60e51b815260206004820152602760248201527f526571756972657320756e636f6d7072657373656420756e707265666978656460448201527f207075626b657900000000000000000000000000000000000000000000000000606482015260840161023f565b6000610e6a87611370565b604080516000808252602082018084528a905260ff89169282019290925260608101879052608081018690529192509060019060a0016020604051602081039080840390855afa158015610ec2573d6000803e3d6000fd5b5050604051601f19015173ffffffffffffffffffffffffffffffffffffffff90811693169290921498975050505050505050565b600060028083604051610f099190611b8f565b602060405180830381855afa158015610f26573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610f499190611bca565b604051602001610f5b91815260200190565b60408051601f1981840301815290829052610f7591611b8f565b602060405180830381855afa158015610f92573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610db99190611bca565b600080610ffc600485858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506113f59050565b9050600061100982611422565b9050600881811b63ff00ff001662ff00ff9183901c9190911617601081811b91901c175b95945050505050565b600080600061107f600486868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506114a79050565b90925090506000611091836005611b32565b905060005b828110156112705760006110e38389898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116259050565b9050600061112a848a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116709050565b915050801561124f576000611178858b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116b79050565b905060006111e86111c2878d8d8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116cd9050565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b9050818160405160200161122b92919091825260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6040516020818303038152906040528051906020012060001c985050505050611270565b6112598285611b32565b93505050808061126890611be3565b915050611096565b5050505092915050565b6000806112c1604485858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116b79050565b9050600061130c6111c2604487878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506116cd9050565b9050818160405160200161134f92919091825260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b60408051601f19818403018152919052805160209091012095945050505050565b600081516040146113e95760405162461bcd60e51b815260206004820152602d60248201527f5075626b6579206d7573742062652036342d62797465207261772c20756e636f60448201527f6d70726573736564206b65792e00000000000000000000000000000000000000606482015260840161023f565b50805160209091012090565b6060600061140d8385516116e490919063ffffffff16565b905061141a848285611740565b949350505050565b60008060005b83518110156114a05761143c816001611b32565b84516114489190611bfe565b611453906008611c15565b61145e906002611d18565b84828151811061147057611470611d24565b0160200151611482919060f81c611c15565b61148c9083611b32565b91508061149881611be3565b915050611428565b5092915050565b60008060006114b6858561180a565b905060ff81166114e85760008585815181106114d4576114d4611d24565b016020015190935060f81c915061161e9050565b836114f4826001611d3a565b60ff166115019190611b32565b85511015611518576000196000925092505061161e565b60008160ff166002141561155d5761155261153e611537876001611b32565b88906116b7565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611614565b8160ff16600414156115875761157a6111c2611537876001611b32565b63ffffffff169050611614565b8160ff1660081415611614576116076115a4611537876001611b32565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b60008060006116348585611670565b909250905060001982141561164f5760001992505050610db9565b8061165b836025611b32565b6116659190611b32565b61102d906004611b32565b60008061167e836025611b32565b8451101561169357506000199050600061161e565b6000806116aa866116a5876024611b32565b6114a7565b9097909650945050505050565b60006116c68383016020015190565b9392505050565b60006116c66116dd836020611b32565b84906116b7565b6000828211156117365760405162461bcd60e51b815260206004820152601d60248201527f556e646572666c6f7720647572696e67207375627472616374696f6e2e000000604482015260640161023f565b6116c68284611bfe565b60608161175c57506040805160208101909152600081526116c6565b60006117688385611b32565b9050838111801561177a575080855110155b6117c65760405162461bcd60e51b815260206004820152601360248201527f536c696365206f7574206f6620626f756e647300000000000000000000000000604482015260640161023f565b604051915082604083010160405282825283850182038460208701018481015b808210156117ff578151838301526020820191506117e6565b505050509392505050565b600082828151811061181e5761181e611d24565b60209101015160f81c60ff141561183757506008610db9565b82828151811061184957611849611d24565b60209101015160f81c60fe141561186257506004610db9565b82828151811061187457611874611d24565b60209101015160f81c60fd141561188d57506002610db9565b50600092915050565b60008083601f8401126118a857600080fd5b50813567ffffffffffffffff8111156118c057600080fd5b60208301915083602082850101111561161e57600080fd5b600080600080606085870312156118ee57600080fd5b84359350602085013567ffffffffffffffff81111561190c57600080fd5b61191887828801611896565b9598909750949560400135949350505050565b6000806040838503121561193e57600080fd5b50508035926020909101359150565b60008060008060008086880360e081121561196757600080fd5b87359650602088013567ffffffffffffffff81111561198557600080fd5b6119918a828b01611896565b90975095505060408801356bffffffffffffffffffffffff19811681146119b757600080fd5b93506060888101359350607f19820112156119d157600080fd5b506080870190509295509295509295565b600080600080600080608087890312156119fb57600080fd5b86359550602087013567ffffffffffffffff80821115611a1a57600080fd5b611a268a838b01611896565b90975095506040890135915080821115611a3f57600080fd5b50611a4c89828a01611896565b909450925050606087013573ffffffffffffffffffffffffffffffffffffffff81168114611a7957600080fd5b809150509295509295509295565b60008060008060008060808789031215611aa057600080fd5b86359550602087013567ffffffffffffffff80821115611abf57600080fd5b611acb8a838b01611896565b90975095506040890135915080821115611ae457600080fd5b50611af189828a01611896565b90945092505060608701358015158114611a7957600080fd5b82848237909101908152602001919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b4557611b45611b1c565b500190565b600060208284031215611b5c57600080fd5b813560ff811681146116c657600080fd5b600082611b8a57634e487b7160e01b600052601260045260246000fd5b500690565b6000825160005b81811015611bb05760208186018101518583015201611b96565b81811115611bbf576000828501525b509190910192915050565b600060208284031215611bdc57600080fd5b5051919050565b6000600019821415611bf757611bf7611b1c565b5060010190565b600082821015611c1057611c10611b1c565b500390565b6000816000190483118215151615611c2f57611c2f611b1c565b500290565b600181815b80851115611c6f578160001904821115611c5557611c55611b1c565b80851615611c6257918102915b93841c9390800290611c39565b509250929050565b600082611c8657506001610db9565b81611c9357506000610db9565b8160018114611ca95760028114611cb357611ccf565b6001915050610db9565b60ff841115611cc457611cc4611b1c565b50506001821b610db9565b5060208310610133831016604e8410600b8410161715611cf2575081810a610db9565b611cfc8383611c34565b8060001904821115611d1057611d10611b1c565b029392505050565b60006116c68383611c77565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff84168060ff03821115611d5757611d57611b1c565b01939250505056fea2646970667358221220683252598c0027d13ecac90c652c11af35a26c5b9dc4b702055ebda0a6162e9464736f6c63430008090033",
134
+ "bytecode": "0x611aad61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100925760003560e01c8063545227871161006557806354522787146101195780639a08b74014610139578063c945968614610159578063e6d20d451461018b57600080fd5b80632123f1c41461009757806321e76ee8146100b95780633f31f49f146100d957806340399403146100f9575b600080fd5b8180156100a357600080fd5b506100b76100b23660046116bd565b6101ab565b005b8180156100c557600080fd5b506100b76100d4366004611721565b6101e6565b8180156100e557600080fd5b506100b76100f4366004611774565b6104f3565b81801561010557600080fd5b506100b76101143660046116bd565b6106e4565b81801561012557600080fd5b506100b76101343660046116bd565b61077e565b81801561014557600080fd5b506100b7610154366004611819565b61082c565b81801561016557600080fd5b506101796101743660046118ae565b610a9c565b60405190815260200160405180910390f35b81801561019757600080fd5b506100b76101a63660046116bd565b610c72565b8082556040518181527fdf25ccd778c4ac0298894525a8bd99ba018936d0c6ea0b6fc212507531c0adb7906020015b60405180910390a15050565b60008383836040516020016101fd93929190611931565b60408051601f198184030181529181528151602092830120600081815260048901909352912060028101549192509063ffffffff166102835760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520646f6573206e6f74206578697374000060448201526064015b60405180910390fd5b6002810154640100000000900460ff16156102f25760405162461bcd60e51b815260206004820152602960248201527f4672617564206368616c6c656e67652068617320616c7265616479206265656e604482015268081c995cdbdb1d995960ba1b606482015260840161027a565b6002808701549082015461030c919063ffffffff16611959565b4210156103815760405162461bcd60e51b815260206004820152603260248201527f4672617564206368616c6c656e67652064656665617420706572696f6420646960448201527f64206e6f742074696d65206f7574207965740000000000000000000000000000606482015260840161027a565b60028101805464ff0000000019166401000000001790558054600182015460405173ffffffffffffffffffffffffffffffffffffffff90921691620186a091906000818181858888f193505050503d80600081146103fb576040519150601f19603f3d011682016040523d82523d6000602084013e610400565b606091505b505050600061049061044c600088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293925050610d0c9050565b604080516020601f8a0181900481028201810190925288815261048b91908a8a808385018382808284376000920191909152509293925050610d0c9050565b610d14565b9050600061049d82610dbf565b604080516bffffffffffffffffffffffff1983168152602081018890529192507f635230b60143449f10a365568e2bd95e3e8aaed03855631722941c2bad634b7791015b60405180910390a15050505050505050565b600061053484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610de692505050565b9050600086868360405160200161054d93929190611931565b60408051601f198184030181528282528051602091820120600081815260048d0190925291902060028101805464ff00000000191664010000000017905560018101549193509173ffffffffffffffffffffffffffffffffffffffff861691620186a091600060405180830381858888f193505050503d80600081146105ef576040519150601f19603f3d011682016040523d82523d6000602084013e6105f4565b606091505b505050600061067f61064060008b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293925050610d0c9050565b604080516020601f8d018190048102820181019092528b815261048b91908d8d808385018382808284376000920191909152509293925050610d0c9050565b9050600061068c82610dbf565b604080516bffffffffffffffffffffffff1983168152602081018890529192507f6ff720470ffad78f316655e2c7fc77a76763c13de0e19ee52149916ba7e44d3b910160405180910390a15050505050505050505050565b600081116107475760405162461bcd60e51b815260206004820152602a60248201527f4672617564206368616c6c656e6765206465666561742074696d656f7574206d6044820152690757374206265203e20360b41b606482015260840161027a565b600282018190556040518181527f1e833ee8be2754de7dae1749a8438b691fda5b0695db2b2b8311b23270406d5a906020016101da565b60648111156107f55760405162461bcd60e51b815260206004820152602f60248201527f4672617564206e6f74696669657220726577617264206d756c7469706c69657260448201527f206d757374206265203c3d203130300000000000000000000000000000000000606482015260840161027a565b600182018190556040518181527feddb2abfc2e3aa166fbafa0dbaa077f0ec7663ddc8a535253bb35ed4ab70c877906020016101da565b85600301543410156108a65760405162461bcd60e51b815260206004820152602660248201527f54686520616d6f756e74206f6620455448206465706f7369746564206973207460448201527f6f6f206c6f770000000000000000000000000000000000000000000000000000606482015260840161027a565b6108fe85858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508692506108f29150506060850160408601611971565b84356020860135610ea5565b61094a5760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726520766572696669636174696f6e206661696c7572650000604482015260640161027a565b600085858460405160200161096193929190611931565b60408051601f198184030181529181528151602092830120600081815260048b01909352912060028101549192509063ffffffff16156109e35760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520616c7265616479206578697374730000604482015260640161027a565b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317815534600182015560028101805464ffffffffff191663ffffffff42161790557ff4aa58d09ba5de017eac597806dfcfc2cad287816cb1eb7729a032c82680c94d8585610a5c6060870160408801611971565b604080516bffffffffffffffffffffffff19909416845260208085019390935260ff9091169083015285356060830152850135608082015260a0016104e1565b600080610ade85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610de692505050565b90506000878783604051602001610af793929190611931565b60408051601f198184030181529181528151602092830120600081815260048d01909352912060028101549192509063ffffffff16610b785760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520646f6573206e6f742065786973740000604482015260640161027a565b6002810154640100000000900460ff1615610be75760405162461bcd60e51b815260206004820152602960248201527f4672617564206368616c6c656e67652068617320616c7265616479206265656e604482015268081c995cdbdb1d995960ba1b606482015260840161027a565b610bf18787610fb5565b63ffffffff16600114610c465760405162461bcd60e51b815260206004820152601260248201527f57726f6e67207369676861736820747970650000000000000000000000000000604482015260640161027a565b84610c5a57610c558787611035565b610c64565b610c648787611279565b9a9950505050505050505050565b60008111610cd55760405162461bcd60e51b815260206004820152602a60248201527f4672617564206368616c6c656e6765206465706f73697420616d6f756e74206d6044820152690757374206265203e20360b41b606482015260840161027a565b600382018190556040518181527fac6cc6a5e862456c7f1a3827f078d9a355cb82eef2353c4167e872673b48570c906020016101da565b016020015190565b60606000610d23600284611994565b610d4e57507f0200000000000000000000000000000000000000000000000000000000000000610d71565b507f03000000000000000000000000000000000000000000000000000000000000005b6040517fff0000000000000000000000000000000000000000000000000000000000000082166020820152602181018590526041016040516020818303038152906040529150505b92915050565b60006020600083516020850160025afa50602060006020600060035afa5050600c51919050565b600060028083604051610df991906119b6565b602060405180830381855afa158015610e16573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610e3991906119f1565b604051602001610e4b91815260200190565b60408051601f1981840301815290829052610e65916119b6565b602060405180830381855afa158015610e82573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610db991906119f1565b60008551604014610f1e5760405162461bcd60e51b815260206004820152602760248201527f526571756972657320756e636f6d7072657373656420756e707265666978656460448201527f207075626b657900000000000000000000000000000000000000000000000000606482015260840161027a565b6000610f298761136f565b604080516000808252602082018084528a905260ff89169282019290925260608101879052608081018690529192509060019060a0016020604051602081039080840390855afa158015610f81573d6000803e3d6000fd5b5050604051601f19015173ffffffffffffffffffffffffffffffffffffffff90811693169290921498975050505050505050565b600080611005610fc6600485611a0a565b85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506113f49050565b905060e081901c60d882901c63ff00ff001662ff00ff60e884901c1617601081811b91901c175b95945050505050565b600080600061107e600486868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929392505061140a9050565b90925090506000611090836005611959565b905060005b8281101561126f5760006110e28389898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506115889050565b90506000611129848a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506115d39050565b915050801561124e576000611177858b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506113f49050565b905060006111e76111c1878d8d8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929392505061161a9050565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b9050818160405160200161122a92919091825260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6040516020818303038152906040528051906020012060001c98505050505061126f565b6112588285611959565b93505050808061126790611a21565b915050611095565b5050505092915050565b6000806112c0604485858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506113f49050565b9050600061130b6111c1604487878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929392505061161a9050565b9050818160405160200161134e92919091825260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b60408051601f19818403018152919052805160209091012095945050505050565b600081516040146113e85760405162461bcd60e51b815260206004820152602d60248201527f5075626b6579206d7573742062652036342d62797465207261772c20756e636f60448201527f6d70726573736564206b65792e00000000000000000000000000000000000000606482015260840161027a565b50805160209091012090565b60006114038383016020015190565b9392505050565b60008060006114198585611631565b905060ff811661144b57600085858151811061143757611437611a3c565b016020015190935060f81c91506115819050565b83611457826001611a52565b60ff166114649190611959565b8551101561147b5760001960009250925050611581565b60008160ff16600214156114c0576114b56114a161149a876001611959565b88906113f4565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611577565b8160ff16600414156114ea576114dd6111c161149a876001611959565b63ffffffff169050611577565b8160ff16600814156115775761156a61150761149a876001611959565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b600080600061159785856115d3565b90925090506000198214156115b25760001992505050610db9565b806115be836025611959565b6115c89190611959565b61102c906004611959565b6000806115e1836025611959565b845110156115f6575060001990506000611581565b60008061160d86611608876024611959565b61140a565b9097909650945050505050565b600061140361162a836020611959565b84906113f4565b600082828151811061164557611645611a3c565b60209101015160f81c60ff141561165e57506008610db9565b82828151811061167057611670611a3c565b60209101015160f81c60fe141561168957506004610db9565b82828151811061169b5761169b611a3c565b60209101015160f81c60fd14156116b457506002610db9565b50600092915050565b600080604083850312156116d057600080fd5b50508035926020909101359150565b60008083601f8401126116f157600080fd5b50813567ffffffffffffffff81111561170957600080fd5b60208301915083602082850101111561158157600080fd5b6000806000806060858703121561173757600080fd5b84359350602085013567ffffffffffffffff81111561175557600080fd5b611761878288016116df565b9598909750949560400135949350505050565b6000806000806000806080878903121561178d57600080fd5b86359550602087013567ffffffffffffffff808211156117ac57600080fd5b6117b88a838b016116df565b909750955060408901359150808211156117d157600080fd5b506117de89828a016116df565b909450925050606087013573ffffffffffffffffffffffffffffffffffffffff8116811461180b57600080fd5b809150509295509295509295565b60008060008060008086880360e081121561183357600080fd5b87359650602088013567ffffffffffffffff81111561185157600080fd5b61185d8a828b016116df565b90975095505060408801356bffffffffffffffffffffffff198116811461188357600080fd5b93506060888101359350607f198201121561189d57600080fd5b506080870190509295509295509295565b600080600080600080608087890312156118c757600080fd5b86359550602087013567ffffffffffffffff808211156118e657600080fd5b6118f28a838b016116df565b9097509550604089013591508082111561190b57600080fd5b5061191889828a016116df565b9094509250506060870135801515811461180b57600080fd5b82848237909101908152602001919050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561196c5761196c611943565b500190565b60006020828403121561198357600080fd5b813560ff8116811461140357600080fd5b6000826119b157634e487b7160e01b600052601260045260246000fd5b500690565b6000825160005b818110156119d757602081860181015185830152016119bd565b818111156119e6576000828501525b509190910192915050565b600060208284031215611a0357600080fd5b5051919050565b600082821015611a1c57611a1c611943565b500390565b6000600019821415611a3557611a35611943565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff84168060ff03821115611a6f57611a6f611943565b01939250505056fea26469706673582212201b8f084575ec98c25e842f2cb4d026008b246c6fc61d9f1c733d7a3178f13d6f64736f6c63430008090033",
135
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100925760003560e01c8063545227871161006557806354522787146101195780639a08b74014610139578063c945968614610159578063e6d20d451461018b57600080fd5b80632123f1c41461009757806321e76ee8146100b95780633f31f49f146100d957806340399403146100f9575b600080fd5b8180156100a357600080fd5b506100b76100b23660046116bd565b6101ab565b005b8180156100c557600080fd5b506100b76100d4366004611721565b6101e6565b8180156100e557600080fd5b506100b76100f4366004611774565b6104f3565b81801561010557600080fd5b506100b76101143660046116bd565b6106e4565b81801561012557600080fd5b506100b76101343660046116bd565b61077e565b81801561014557600080fd5b506100b7610154366004611819565b61082c565b81801561016557600080fd5b506101796101743660046118ae565b610a9c565b60405190815260200160405180910390f35b81801561019757600080fd5b506100b76101a63660046116bd565b610c72565b8082556040518181527fdf25ccd778c4ac0298894525a8bd99ba018936d0c6ea0b6fc212507531c0adb7906020015b60405180910390a15050565b60008383836040516020016101fd93929190611931565b60408051601f198184030181529181528151602092830120600081815260048901909352912060028101549192509063ffffffff166102835760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520646f6573206e6f74206578697374000060448201526064015b60405180910390fd5b6002810154640100000000900460ff16156102f25760405162461bcd60e51b815260206004820152602960248201527f4672617564206368616c6c656e67652068617320616c7265616479206265656e604482015268081c995cdbdb1d995960ba1b606482015260840161027a565b6002808701549082015461030c919063ffffffff16611959565b4210156103815760405162461bcd60e51b815260206004820152603260248201527f4672617564206368616c6c656e67652064656665617420706572696f6420646960448201527f64206e6f742074696d65206f7574207965740000000000000000000000000000606482015260840161027a565b60028101805464ff0000000019166401000000001790558054600182015460405173ffffffffffffffffffffffffffffffffffffffff90921691620186a091906000818181858888f193505050503d80600081146103fb576040519150601f19603f3d011682016040523d82523d6000602084013e610400565b606091505b505050600061049061044c600088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293925050610d0c9050565b604080516020601f8a0181900481028201810190925288815261048b91908a8a808385018382808284376000920191909152509293925050610d0c9050565b610d14565b9050600061049d82610dbf565b604080516bffffffffffffffffffffffff1983168152602081018890529192507f635230b60143449f10a365568e2bd95e3e8aaed03855631722941c2bad634b7791015b60405180910390a15050505050505050565b600061053484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610de692505050565b9050600086868360405160200161054d93929190611931565b60408051601f198184030181528282528051602091820120600081815260048d0190925291902060028101805464ff00000000191664010000000017905560018101549193509173ffffffffffffffffffffffffffffffffffffffff861691620186a091600060405180830381858888f193505050503d80600081146105ef576040519150601f19603f3d011682016040523d82523d6000602084013e6105f4565b606091505b505050600061067f61064060008b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293925050610d0c9050565b604080516020601f8d018190048102820181019092528b815261048b91908d8d808385018382808284376000920191909152509293925050610d0c9050565b9050600061068c82610dbf565b604080516bffffffffffffffffffffffff1983168152602081018890529192507f6ff720470ffad78f316655e2c7fc77a76763c13de0e19ee52149916ba7e44d3b910160405180910390a15050505050505050505050565b600081116107475760405162461bcd60e51b815260206004820152602a60248201527f4672617564206368616c6c656e6765206465666561742074696d656f7574206d6044820152690757374206265203e20360b41b606482015260840161027a565b600282018190556040518181527f1e833ee8be2754de7dae1749a8438b691fda5b0695db2b2b8311b23270406d5a906020016101da565b60648111156107f55760405162461bcd60e51b815260206004820152602f60248201527f4672617564206e6f74696669657220726577617264206d756c7469706c69657260448201527f206d757374206265203c3d203130300000000000000000000000000000000000606482015260840161027a565b600182018190556040518181527feddb2abfc2e3aa166fbafa0dbaa077f0ec7663ddc8a535253bb35ed4ab70c877906020016101da565b85600301543410156108a65760405162461bcd60e51b815260206004820152602660248201527f54686520616d6f756e74206f6620455448206465706f7369746564206973207460448201527f6f6f206c6f770000000000000000000000000000000000000000000000000000606482015260840161027a565b6108fe85858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508692506108f29150506060850160408601611971565b84356020860135610ea5565b61094a5760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726520766572696669636174696f6e206661696c7572650000604482015260640161027a565b600085858460405160200161096193929190611931565b60408051601f198184030181529181528151602092830120600081815260048b01909352912060028101549192509063ffffffff16156109e35760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520616c7265616479206578697374730000604482015260640161027a565b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317815534600182015560028101805464ffffffffff191663ffffffff42161790557ff4aa58d09ba5de017eac597806dfcfc2cad287816cb1eb7729a032c82680c94d8585610a5c6060870160408801611971565b604080516bffffffffffffffffffffffff19909416845260208085019390935260ff9091169083015285356060830152850135608082015260a0016104e1565b600080610ade85858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610de692505050565b90506000878783604051602001610af793929190611931565b60408051601f198184030181529181528151602092830120600081815260048d01909352912060028101549192509063ffffffff16610b785760405162461bcd60e51b815260206004820152601e60248201527f4672617564206368616c6c656e676520646f6573206e6f742065786973740000604482015260640161027a565b6002810154640100000000900460ff1615610be75760405162461bcd60e51b815260206004820152602960248201527f4672617564206368616c6c656e67652068617320616c7265616479206265656e604482015268081c995cdbdb1d995960ba1b606482015260840161027a565b610bf18787610fb5565b63ffffffff16600114610c465760405162461bcd60e51b815260206004820152601260248201527f57726f6e67207369676861736820747970650000000000000000000000000000604482015260640161027a565b84610c5a57610c558787611035565b610c64565b610c648787611279565b9a9950505050505050505050565b60008111610cd55760405162461bcd60e51b815260206004820152602a60248201527f4672617564206368616c6c656e6765206465706f73697420616d6f756e74206d6044820152690757374206265203e20360b41b606482015260840161027a565b600382018190556040518181527fac6cc6a5e862456c7f1a3827f078d9a355cb82eef2353c4167e872673b48570c906020016101da565b016020015190565b60606000610d23600284611994565b610d4e57507f0200000000000000000000000000000000000000000000000000000000000000610d71565b507f03000000000000000000000000000000000000000000000000000000000000005b6040517fff0000000000000000000000000000000000000000000000000000000000000082166020820152602181018590526041016040516020818303038152906040529150505b92915050565b60006020600083516020850160025afa50602060006020600060035afa5050600c51919050565b600060028083604051610df991906119b6565b602060405180830381855afa158015610e16573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610e3991906119f1565b604051602001610e4b91815260200190565b60408051601f1981840301815290829052610e65916119b6565b602060405180830381855afa158015610e82573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610db991906119f1565b60008551604014610f1e5760405162461bcd60e51b815260206004820152602760248201527f526571756972657320756e636f6d7072657373656420756e707265666978656460448201527f207075626b657900000000000000000000000000000000000000000000000000606482015260840161027a565b6000610f298761136f565b604080516000808252602082018084528a905260ff89169282019290925260608101879052608081018690529192509060019060a0016020604051602081039080840390855afa158015610f81573d6000803e3d6000fd5b5050604051601f19015173ffffffffffffffffffffffffffffffffffffffff90811693169290921498975050505050505050565b600080611005610fc6600485611a0a565b85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506113f49050565b905060e081901c60d882901c63ff00ff001662ff00ff60e884901c1617601081811b91901c175b95945050505050565b600080600061107e600486868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929392505061140a9050565b90925090506000611090836005611959565b905060005b8281101561126f5760006110e28389898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506115889050565b90506000611129848a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506115d39050565b915050801561124e576000611177858b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506113f49050565b905060006111e76111c1878d8d8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929392505061161a9050565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b9050818160405160200161122a92919091825260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b6040516020818303038152906040528051906020012060001c98505050505061126f565b6112588285611959565b93505050808061126790611a21565b915050611095565b5050505092915050565b6000806112c0604485858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506113f49050565b9050600061130b6111c1604487878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929392505061161a9050565b9050818160405160200161134e92919091825260e01b7fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b60408051601f19818403018152919052805160209091012095945050505050565b600081516040146113e85760405162461bcd60e51b815260206004820152602d60248201527f5075626b6579206d7573742062652036342d62797465207261772c20756e636f60448201527f6d70726573736564206b65792e00000000000000000000000000000000000000606482015260840161027a565b50805160209091012090565b60006114038383016020015190565b9392505050565b60008060006114198585611631565b905060ff811661144b57600085858151811061143757611437611a3c565b016020015190935060f81c91506115819050565b83611457826001611a52565b60ff166114649190611959565b8551101561147b5760001960009250925050611581565b60008160ff16600214156114c0576114b56114a161149a876001611959565b88906113f4565b62ffff0060e882901c1660f89190911c1790565b61ffff169050611577565b8160ff16600414156114ea576114dd6111c161149a876001611959565b63ffffffff169050611577565b8160ff16600814156115775761156a61150761149a876001611959565b60c01c64ff000000ff600882811c91821665ff000000ff009390911b92831617601090811b67ffffffffffffffff1666ff00ff00ff00ff9290921667ff00ff00ff00ff009093169290921790911c65ffff0000ffff1617602081811c91901b1790565b67ffffffffffffffff1690505b60ff909116925090505b9250929050565b600080600061159785856115d3565b90925090506000198214156115b25760001992505050610db9565b806115be836025611959565b6115c89190611959565b61102c906004611959565b6000806115e1836025611959565b845110156115f6575060001990506000611581565b60008061160d86611608876024611959565b61140a565b9097909650945050505050565b600061140361162a836020611959565b84906113f4565b600082828151811061164557611645611a3c565b60209101015160f81c60ff141561165e57506008610db9565b82828151811061167057611670611a3c565b60209101015160f81c60fe141561168957506004610db9565b82828151811061169b5761169b611a3c565b60209101015160f81c60fd14156116b457506002610db9565b50600092915050565b600080604083850312156116d057600080fd5b50508035926020909101359150565b60008083601f8401126116f157600080fd5b50813567ffffffffffffffff81111561170957600080fd5b60208301915083602082850101111561158157600080fd5b6000806000806060858703121561173757600080fd5b84359350602085013567ffffffffffffffff81111561175557600080fd5b611761878288016116df565b9598909750949560400135949350505050565b6000806000806000806080878903121561178d57600080fd5b86359550602087013567ffffffffffffffff808211156117ac57600080fd5b6117b88a838b016116df565b909750955060408901359150808211156117d157600080fd5b506117de89828a016116df565b909450925050606087013573ffffffffffffffffffffffffffffffffffffffff8116811461180b57600080fd5b809150509295509295509295565b60008060008060008086880360e081121561183357600080fd5b87359650602088013567ffffffffffffffff81111561185157600080fd5b61185d8a828b016116df565b90975095505060408801356bffffffffffffffffffffffff198116811461188357600080fd5b93506060888101359350607f198201121561189d57600080fd5b506080870190509295509295509295565b600080600080600080608087890312156118c757600080fd5b86359550602087013567ffffffffffffffff808211156118e657600080fd5b6118f28a838b016116df565b9097509550604089013591508082111561190b57600080fd5b5061191889828a016116df565b9094509250506060870135801515811461180b57600080fd5b82848237909101908152602001919050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561196c5761196c611943565b500190565b60006020828403121561198357600080fd5b813560ff8116811461140357600080fd5b6000826119b157634e487b7160e01b600052601260045260246000fd5b500690565b6000825160005b818110156119d757602081860181015185830152016119bd565b818111156119e6576000828501525b509190910192915050565b600060208284031215611a0357600080fd5b5051919050565b600082821015611a1c57611a1c611943565b500390565b6000600019821415611a3557611a35611943565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff84168060ff03821115611a6f57611a6f611943565b01939250505056fea26469706673582212201b8f084575ec98c25e842f2cb4d026008b246c6fc61d9f1c733d7a3178f13d6f64736f6c63430008090033",
136
136
  "linkReferences": {},
137
137
  "deployedLinkReferences": {}
138
138
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/5c1940e1952bbf0794a8df67d0f763e2.json"
3
+ "buildInfo": "../../../build-info/4f3252cf5c5b3ab5098f03748fc2a9f6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/5c1940e1952bbf0794a8df67d0f763e2.json"
3
+ "buildInfo": "../../../build-info/4f3252cf5c5b3ab5098f03748fc2a9f6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/5c1940e1952bbf0794a8df67d0f763e2.json"
3
+ "buildInfo": "../../../build-info/4f3252cf5c5b3ab5098f03748fc2a9f6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/5c1940e1952bbf0794a8df67d0f763e2.json"
3
+ "buildInfo": "../../../build-info/4f3252cf5c5b3ab5098f03748fc2a9f6.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/5c1940e1952bbf0794a8df67d0f763e2.json"
3
+ "buildInfo": "../../../build-info/4f3252cf5c5b3ab5098f03748fc2a9f6.json"
4
4
  }
@@ -1200,6 +1200,183 @@ contract Bridge is Ownable, EcdsaWalletOwner {
1200
1200
  return (depositTxFee, depositTxFeeRemainder);
1201
1201
  }
1202
1202
 
1203
+ /// @notice Submits a fraud challenge indicating that a UTXO being under
1204
+ /// wallet control was unlocked by the wallet but was not used
1205
+ /// according to the protocol rules. That means the wallet signed
1206
+ /// a transaction input pointing to that UTXO and there is a unique
1207
+ /// sighash and signature pair associated with that input. This
1208
+ /// function uses those parameters to create a fraud accusation that
1209
+ /// proves a given transaction input unlocking the given UTXO was
1210
+ /// actually signed by the wallet. This function cannot determine
1211
+ /// whether the transaction was actually broadcast and the input was
1212
+ /// consumed in a fraudulent way so it just opens a challenge period
1213
+ /// during which the wallet can defeat the challenge by submitting
1214
+ /// proof of a transaction that consumes the given input according
1215
+ /// to protocol rules. To prevent spurious allegations, the caller
1216
+ /// must deposit ETH that is returned back upon justified fraud
1217
+ /// challenge or confiscated otherwise.
1218
+ ///@param walletPublicKey The public key of the wallet in the uncompressed
1219
+ /// and unprefixed format (64 bytes)
1220
+ /// @param sighash The hash that was used to produce the ECDSA signature
1221
+ /// that is the subject of the fraud claim. This hash is constructed
1222
+ /// by applying double SHA-256 over a serialized subset of the
1223
+ /// transaction. The exact subset used as hash preimage depends on
1224
+ /// the transaction input the signature is produced for. See BIP-143
1225
+ /// for reference
1226
+ /// @param signature Bitcoin signature in the R/S/V format
1227
+ /// @dev Requirements:
1228
+ /// - Wallet behind `walletPubKey` must be in `Live` or `MovingFunds`
1229
+ /// state
1230
+ /// - The challenger must send appropriate amount of ETH used as
1231
+ /// fraud challenge deposit
1232
+ /// - The signature (represented by r, s and v) must be generated by
1233
+ /// the wallet behind `walletPubKey` during signing of `sighash`
1234
+ /// - Wallet can be challenged for the given signature only once
1235
+ function submitFraudChallenge(
1236
+ bytes calldata walletPublicKey,
1237
+ bytes32 sighash,
1238
+ BitcoinTx.RSVSignature calldata signature
1239
+ ) external payable {
1240
+ bytes memory compressedWalletPublicKey = EcdsaLib.compressPublicKey(
1241
+ walletPublicKey.slice32(0),
1242
+ walletPublicKey.slice32(32)
1243
+ );
1244
+ bytes20 walletPubKeyHash = compressedWalletPublicKey.hash160View();
1245
+
1246
+ Wallets.Wallet storage wallet = wallets.registeredWallets[
1247
+ walletPubKeyHash
1248
+ ];
1249
+
1250
+ require(
1251
+ wallet.state == Wallets.WalletState.Live ||
1252
+ wallet.state == Wallets.WalletState.MovingFunds,
1253
+ "Wallet is neither in Live nor MovingFunds state"
1254
+ );
1255
+
1256
+ frauds.submitChallenge(
1257
+ walletPublicKey,
1258
+ walletPubKeyHash,
1259
+ sighash,
1260
+ signature
1261
+ );
1262
+ }
1263
+
1264
+ /// @notice Allows to defeat a pending fraud challenge against a wallet if
1265
+ /// the transaction that spends the UTXO follows the protocol rules.
1266
+ /// In order to defeat the challenge the same `walletPublicKey` and
1267
+ /// signature (represented by `r`, `s` and `v`) must be provided as
1268
+ /// were used to calculate the sighash during input signing.
1269
+ /// The fraud challenge defeat attempt will only succeed if the
1270
+ /// inputs in the preimage are considered honestly spent by the
1271
+ /// wallet. Therefore the transaction spending the UTXO must be
1272
+ /// proven in the Bridge before a challenge defeat is called.
1273
+ /// If successfully defeated, the fraud challenge is marked as
1274
+ /// resolved and the amount of ether deposited by the challenger is
1275
+ /// sent to the treasury.
1276
+ /// @param walletPublicKey The public key of the wallet in the uncompressed
1277
+ /// and unprefixed format (64 bytes)
1278
+ /// @param preimage The preimage which produces sighash used to generate the
1279
+ /// ECDSA signature that is the subject of the fraud claim. It is a
1280
+ /// serialized subset of the transaction. The exact subset used as
1281
+ /// the preimage depends on the transaction input the signature is
1282
+ /// produced for. See BIP-143 for reference
1283
+ /// @param witness Flag indicating whether the preimage was produced for a
1284
+ /// witness input. True for witness, false for non-witness input
1285
+ /// @dev Requirements:
1286
+ /// - `walletPublicKey` and `sighash` calculated as `hash256(preimage)`
1287
+ /// must identify an open fraud challenge
1288
+ /// - the preimage must be a valid preimage of a transaction generated
1289
+ /// according to the protocol rules and already proved in the Bridge
1290
+ /// - before a defeat attempt is made the transaction that spends the
1291
+ /// given UTXO must be proven in the Bridge
1292
+ function defeatFraudChallenge(
1293
+ bytes calldata walletPublicKey,
1294
+ bytes calldata preimage,
1295
+ bool witness
1296
+ ) external {
1297
+ uint256 utxoKey = frauds.unwrapChallenge(
1298
+ walletPublicKey,
1299
+ preimage,
1300
+ witness
1301
+ );
1302
+
1303
+ // Check that the UTXO key identifies a correctly spent UTXO.
1304
+ require(
1305
+ deposits[utxoKey].sweptAt > 0 || spentMainUTXOs[utxoKey],
1306
+ "Spent UTXO not found among correctly spent UTXOs"
1307
+ );
1308
+
1309
+ frauds.defeatChallenge(walletPublicKey, preimage, treasury);
1310
+ }
1311
+
1312
+ /// @notice Notifies about defeat timeout for the given fraud challenge.
1313
+ /// Can be called only if there was a fraud challenge identified by
1314
+ /// the provided `walletPublicKey` and `sighash` and it was not
1315
+ /// defeated on time. The amount of time that needs to pass after
1316
+ /// a fraud challenge is reported is indicated by the
1317
+ /// `challengeDefeatTimeout`. After a successful fraud challenge
1318
+ /// defeat timeout notification the fraud challenge is marked as
1319
+ /// resolved, the stake of each operator is slashed, the ether
1320
+ /// deposited is returned to the challenger and the challenger is
1321
+ /// rewarded.
1322
+ /// @param walletPublicKey The public key of the wallet in the uncompressed
1323
+ /// and unprefixed format (64 bytes)
1324
+ /// @param sighash The hash that was used to produce the ECDSA signature
1325
+ /// that is the subject of the fraud claim. This hash is constructed
1326
+ /// by applying double SHA-256 over a serialized subset of the
1327
+ /// transaction. The exact subset used as hash preimage depends on
1328
+ /// the transaction input the signature is produced for. See BIP-143
1329
+ /// for reference
1330
+ /// @dev Requirements:
1331
+ /// - `walletPublicKey`and `sighash` must identify an open fraud
1332
+ /// challenge
1333
+ /// - the amount of time indicated by `challengeDefeatTimeout` must
1334
+ /// pass after the challenge was reported
1335
+ function notifyFraudChallengeDefeatTimeout(
1336
+ bytes calldata walletPublicKey,
1337
+ bytes32 sighash
1338
+ ) external {
1339
+ frauds.notifyChallengeDefeatTimeout(walletPublicKey, sighash);
1340
+ }
1341
+
1342
+ /// @notice Returns parameters used by the `Frauds` library.
1343
+ /// @return slashingAmount Value of the slashing amount
1344
+ /// @return notifierRewardMultiplier Value of the notifier reward multiplier
1345
+ /// @return challengeDefeatTimeout Value of the challenge defeat timeout
1346
+ /// @return challengeDepositAmount Value of the challenge deposit amount
1347
+ function getFraudParameters()
1348
+ external
1349
+ view
1350
+ returns (
1351
+ uint256 slashingAmount,
1352
+ uint256 notifierRewardMultiplier,
1353
+ uint256 challengeDefeatTimeout,
1354
+ uint256 challengeDepositAmount
1355
+ )
1356
+ {
1357
+ slashingAmount = frauds.slashingAmount;
1358
+ notifierRewardMultiplier = frauds.notifierRewardMultiplier;
1359
+ challengeDefeatTimeout = frauds.challengeDefeatTimeout;
1360
+ challengeDepositAmount = frauds.challengeDepositAmount;
1361
+
1362
+ return (
1363
+ slashingAmount,
1364
+ notifierRewardMultiplier,
1365
+ challengeDefeatTimeout,
1366
+ challengeDepositAmount
1367
+ );
1368
+ }
1369
+
1370
+ /// @notice Returns the fraud challenge identified by the given key built
1371
+ /// as keccak256(walletPublicKey|sighash).
1372
+ function fraudChallenges(uint256 challengeKey)
1373
+ external
1374
+ view
1375
+ returns (Frauds.FraudChallenge memory)
1376
+ {
1377
+ return frauds.challenges[challengeKey];
1378
+ }
1379
+
1203
1380
  /// @notice Requests redemption of the given amount from the specified
1204
1381
  /// wallet to the redeemer Bitcoin output script.
1205
1382
  /// @param walletPubKeyHash The 20-byte wallet public key hash (computed
@@ -1469,187 +1646,6 @@ contract Bridge is Ownable, EcdsaWalletOwner {
1469
1646
  bank.transferBalance(treasury, outputsInfo.totalTreasuryFee);
1470
1647
  }
1471
1648
 
1472
- /// @notice Submits a fraud challenge indicating that a UTXO being under
1473
- /// wallet control was unlocked by the wallet but was not used
1474
- /// according to the protocol rules. That means the wallet signed
1475
- /// a transaction input pointing to that UTXO and there is a unique
1476
- /// sighash and signature pair associated with that input. This
1477
- /// function uses those parameters to create a fraud accusation that
1478
- /// proves a given transaction input unlocking the given UTXO was
1479
- /// actually signed by the wallet. This function cannot determine
1480
- /// whether the transaction was actually broadcast and the input was
1481
- /// consumed in a fraudulent way so it just opens a challenge period
1482
- /// during which the wallet can defeat the challenge by submitting
1483
- /// proof of a transaction that consumes the given input according
1484
- /// to protocol rules. To prevent spurious allegations, the caller
1485
- /// must deposit ETH that is returned back upon justified fraud
1486
- /// challenge or confiscated otherwise.
1487
- /// @param walletPublicKey The public key of the wallet in the uncompressed
1488
- /// and unprefixed format (64 bytes)
1489
- /// @param sighash The hash that was used to produce the ECDSA signature
1490
- /// that is the subject of the fraud claim. This hash is constructed
1491
- /// by applying double SHA-256 over a serialized subset of the
1492
- /// transaction. The exact subset used as hash preimage depends on
1493
- /// the transaction input the signature is produced for. See BIP-143
1494
- /// for reference
1495
- /// @param signature Bitcoin signature in the R/S/V format
1496
- /// @dev Requirements:
1497
- /// - Wallet behind `walletPubKey` must be in `Live` or `MovingFunds`
1498
- /// state
1499
- /// - The challenger must send appropriate amount of ETH used as
1500
- /// fraud challenge deposit
1501
- /// - The signature (represented by r, s and v) must be generated by
1502
- /// the wallet behind `walletPubKey` during signing of `sighash`
1503
- /// - Wallet can be challenged for the given signature only once
1504
- /// TODO: Consider using wallet public key in the X/Y form to avoid slicing.
1505
- function submitFraudChallenge(
1506
- bytes calldata walletPublicKey,
1507
- bytes32 sighash,
1508
- BitcoinTx.RSVSignature calldata signature
1509
- ) external payable {
1510
- bytes memory compressedWalletPublicKey = EcdsaLib.compressPublicKey(
1511
- walletPublicKey.slice32(0),
1512
- walletPublicKey.slice32(32)
1513
- );
1514
- bytes20 walletPubKeyHash = compressedWalletPublicKey.hash160View();
1515
-
1516
- Wallets.Wallet storage wallet = wallets.registeredWallets[
1517
- walletPubKeyHash
1518
- ];
1519
-
1520
- require(
1521
- wallet.state == Wallets.WalletState.Live ||
1522
- wallet.state == Wallets.WalletState.MovingFunds,
1523
- "Wallet is neither in Live nor MovingFunds state"
1524
- );
1525
-
1526
- frauds.submitFraudChallenge(
1527
- walletPublicKey,
1528
- walletPubKeyHash,
1529
- sighash,
1530
- signature
1531
- );
1532
- }
1533
-
1534
- /// @notice Allows to defeat a pending fraud challenge against a wallet if
1535
- /// the transaction that spends the UTXO follows the protocol rules.
1536
- /// In order to defeat the challenge the same `walletPublicKey` and
1537
- /// signature (represented by `r`, `s` and `v`) must be provided as
1538
- /// were used in the fraud challenge. Additionally a preimage must
1539
- /// be provided which was used to calculate the sighash during input
1540
- /// signing. The fraud challenge defeat attempt will only succeed if
1541
- /// the inputs in the preimage are considered honestly spent by the
1542
- /// wallet. Therefore the transaction spending the UTXO must be
1543
- /// proven in the Bridge before a challenge defeat is called.
1544
- /// If successfully defeated, the fraud challenge is marked as
1545
- /// resolved and the amount of ether deposited by the challenger is
1546
- /// sent to the treasury.
1547
- /// @param walletPublicKey The public key of the wallet in the uncompressed
1548
- /// and unprefixed format (64 bytes)
1549
- /// @param preimage The preimage which produces sighash used to generate the
1550
- /// ECDSA signature that is the subject of the fraud claim. It is a
1551
- /// serialized subset of the transaction. The exact subset used as
1552
- /// the preimage depends on the transaction input the signature is
1553
- /// produced for. See BIP-143 for reference
1554
- /// @param witness Flag indicating whether the preimage was produced for a
1555
- /// witness input. True for witness, false for non-witness input
1556
- /// @dev Requirements:
1557
- /// - `walletPublicKey` and `sighash` calculated as `hash256(preimage)`
1558
- /// must identify an open fraud challenge
1559
- /// - the preimage must be a valid preimage of a transaction generated
1560
- /// according to the protocol rules and already proved in the Bridge
1561
- /// - before a defeat attempt is made the transaction that spends the
1562
- /// given UTXO must be proven in the Bridge
1563
- /// TODO: Consider using wallet public key in the X/Y form to avoid slicing.
1564
- function defeatFraudChallenge(
1565
- bytes calldata walletPublicKey,
1566
- bytes calldata preimage,
1567
- bool witness
1568
- ) external {
1569
- uint256 utxoKey = frauds.unwrapChallenge(
1570
- walletPublicKey,
1571
- preimage,
1572
- witness
1573
- );
1574
-
1575
- // Check that the UTXO key identifies a correctly spent UTXO.
1576
- require(
1577
- deposits[utxoKey].sweptAt > 0 || spentMainUTXOs[utxoKey],
1578
- "Spent UTXO not found among correctly spent UTXOs"
1579
- );
1580
-
1581
- frauds.defeatChallenge(walletPublicKey, preimage, treasury);
1582
- }
1583
-
1584
- /// @notice Notifies about defeat timeout for the given fraud challenge.
1585
- /// Can be called only if there was a fraud challenge identified by
1586
- /// the provided `walletPublicKey` and `sighash` and it was not
1587
- /// defeated on time. The amount of time that needs to pass after
1588
- /// a fraud challenge is reported is indicated by the
1589
- /// `challengeDefeatTimeout`. After a successful fraud challenge
1590
- /// defeat timeout notification the fraud challenge is marked as
1591
- /// resolved, the stake of each operator is slashed, the ether
1592
- /// deposited is returned to the challenger and the challenger is
1593
- /// rewarded.
1594
- /// @param walletPublicKey The public key of the wallet in the uncompressed
1595
- /// and unprefixed format (64 bytes)
1596
- /// @param sighash The hash that was used to produce the ECDSA signature
1597
- /// that is the subject of the fraud claim. This hash is constructed
1598
- /// by applying double SHA-256 over a serialized subset of the
1599
- /// transaction. The exact subset used as hash preimage depends on
1600
- /// the transaction input the signature is produced for. See BIP-143
1601
- /// for reference
1602
- /// @dev Requirements:
1603
- /// - `walletPublicKey`and `sighash` must identify an open fraud
1604
- /// challenge
1605
- /// - the amount of time indicated by `challengeDefeatTimeout` must
1606
- /// pass after the challenge was reported
1607
- /// TODO: Consider using wallet public key in the X/Y form to avoid slicing.
1608
- function notifyFraudChallengeDefeatTimeout(
1609
- bytes calldata walletPublicKey,
1610
- bytes32 sighash
1611
- ) external {
1612
- frauds.notifyFraudChallengeDefeatTimeout(walletPublicKey, sighash);
1613
- }
1614
-
1615
- /// @notice Returns parameters used by the `Frauds` library.
1616
- /// @return slashingAmount Value of the slashing amount
1617
- /// @return notifierRewardMultiplier Value of the notifier reward multiplier
1618
- /// @return challengeDefeatTimeout Value of the challenge defeat timeout
1619
- /// @return challengeDepositAmount Value of the challenge deposit amount
1620
- function getFraudParameters()
1621
- external
1622
- view
1623
- returns (
1624
- uint256 slashingAmount,
1625
- uint256 notifierRewardMultiplier,
1626
- uint256 challengeDefeatTimeout,
1627
- uint256 challengeDepositAmount
1628
- )
1629
- {
1630
- slashingAmount = frauds.slashingAmount;
1631
- notifierRewardMultiplier = frauds.notifierRewardMultiplier;
1632
- challengeDefeatTimeout = frauds.challengeDefeatTimeout;
1633
- challengeDepositAmount = frauds.challengeDepositAmount;
1634
-
1635
- return (
1636
- slashingAmount,
1637
- notifierRewardMultiplier,
1638
- challengeDefeatTimeout,
1639
- challengeDepositAmount
1640
- );
1641
- }
1642
-
1643
- /// @notice Returns the fraud challenge identified by the given key built
1644
- /// as keccak256(walletPublicKey|sighash|v|r|s).
1645
- function fraudChallenges(uint256 challengeKey)
1646
- external
1647
- view
1648
- returns (Frauds.FraudChallenge memory)
1649
- {
1650
- return frauds.challenges[challengeKey];
1651
- }
1652
-
1653
1649
  /// @notice Validates whether the redemption Bitcoin transaction input
1654
1650
  /// vector contains a single input referring to the wallet's main
1655
1651
  /// UTXO. Reverts in case the validation fails.
@@ -40,7 +40,7 @@ library Frauds {
40
40
  /// needs to deposit.
41
41
  uint256 challengeDepositAmount;
42
42
  /// Collection of all submitted fraud challenges indexed by challenge
43
- /// key built as keccak256(walletPublicKey|sighash|v|r|s).
43
+ /// key built as keccak256(walletPublicKey|sighash).
44
44
  mapping(uint256 => FraudChallenge) challenges;
45
45
  }
46
46
 
@@ -116,7 +116,7 @@ library Frauds {
116
116
  /// - The signature (represented by r, s and v) must be generated by
117
117
  /// the wallet behind `walletPubKey` during signing of `sighash`
118
118
  /// - Wallet can be challenged for the given signature only once
119
- function submitFraudChallenge(
119
+ function submitChallenge(
120
120
  Data storage self,
121
121
  bytes calldata walletPublicKey,
122
122
  bytes20 walletPubKeyHash,
@@ -285,7 +285,7 @@ library Frauds {
285
285
  /// challenge
286
286
  /// - the amount of time indicated by `challengeDefeatTimeout` must pass
287
287
  /// after the challenge was reported
288
- function notifyFraudChallengeDefeatTimeout(
288
+ function notifyChallengeDefeatTimeout(
289
289
  Data storage self,
290
290
  bytes calldata walletPublicKey,
291
291
  bytes32 sighash
@@ -522,10 +522,8 @@ library Frauds {
522
522
  pure
523
523
  returns (uint32 sighashType)
524
524
  {
525
- // TODO: Consider using `bytes4` instead allocating `bytes` if it's
526
- // cheaper.
527
- bytes memory sighashTypeBytes = preimage.lastBytes(4);
528
- uint32 sighashTypeLE = uint32(sighashTypeBytes.bytesToUint());
525
+ bytes4 sighashTypeBytes = preimage.slice4(preimage.length - 4);
526
+ uint32 sighashTypeLE = uint32(sighashTypeBytes);
529
527
  return sighashTypeLE.reverseUint32();
530
528
  }
531
529
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keep-network/tbtc-v2",
3
- "version": "0.1.1-dev.30+main.39f30cb989225fbf518a49216572ca39a8d5f85e",
3
+ "version": "0.1.1-dev.31+main.749b9391b64c3a3fcc1eb2a1412a5f5620189e34",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "artifacts/",