@keep-network/tbtc-v2 0.1.1-dev.83 → 0.1.1-dev.84
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.
- package/artifacts/Bank.json +11 -11
- package/artifacts/Bridge.json +11 -11
- package/artifacts/Deposit.json +7 -7
- package/artifacts/DepositSweep.json +7 -7
- package/artifacts/EcdsaDkgValidator.json +1 -1
- package/artifacts/EcdsaInactivity.json +1 -1
- package/artifacts/EcdsaSortitionPool.json +2 -2
- package/artifacts/Fraud.json +7 -7
- package/artifacts/KeepRegistry.json +1 -1
- package/artifacts/KeepStake.json +2 -2
- package/artifacts/KeepToken.json +2 -2
- package/artifacts/KeepTokenStaking.json +1 -1
- package/artifacts/MovingFunds.json +9 -9
- package/artifacts/NuCypherStakingEscrow.json +1 -1
- package/artifacts/NuCypherToken.json +2 -2
- package/artifacts/RandomBeaconStub.json +1 -1
- package/artifacts/Redemption.json +7 -7
- package/artifacts/ReimbursementPool.json +2 -2
- package/artifacts/Relay.json +7 -7
- package/artifacts/T.json +2 -2
- package/artifacts/TBTC.json +3 -3
- package/artifacts/TBTCToken.json +3 -3
- package/artifacts/TBTCVault.json +44 -15
- package/artifacts/TokenStaking.json +1 -1
- package/artifacts/TokenholderGovernor.json +9 -9
- package/artifacts/TokenholderTimelock.json +8 -8
- package/artifacts/VendingMachine.json +3 -3
- package/artifacts/VendingMachineKeep.json +1 -1
- package/artifacts/VendingMachineNuCypher.json +1 -1
- package/artifacts/WalletRegistry.json +5 -5
- package/artifacts/WalletRegistryGovernance.json +2 -2
- package/artifacts/Wallets.json +7 -7
- package/artifacts/solcInputs/{21fcfd91cc383ddf1b3799814408151d.json → 0f79d51f4c2e0d6bf7d919933c677b91.json} +3 -3
- package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
- package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
- package/build/contracts/bank/Bank.sol/Bank.json +2 -2
- package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.dbg.json +1 -1
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.json +2 -2
- package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/bridge/Bridge.sol/Bridge.json +2 -2
- package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
- package/build/contracts/bridge/BridgeState.sol/BridgeState.json +2 -2
- package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
- package/build/contracts/bridge/Deposit.sol/Deposit.json +2 -2
- package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
- package/build/contracts/bridge/DepositSweep.sol/DepositSweep.json +2 -2
- package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
- package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
- package/build/contracts/bridge/Fraud.sol/Fraud.json +2 -2
- package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +1 -1
- package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
- package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
- package/build/contracts/bridge/MovingFunds.sol/MovingFunds.json +2 -2
- package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/OutboundTx.json +2 -2
- package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/Redemption.json +2 -2
- package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
- package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
- package/build/contracts/bridge/Wallets.sol/Wallets.json +2 -2
- package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
- package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +1 -1
- package/build/contracts/vault/DonationVault.sol/DonationVault.json +2 -2
- package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.json +21 -3
- package/contracts/bank/Bank.sol +1 -1
- package/contracts/bank/IReceiveBalanceApproval.sol +2 -2
- package/contracts/vault/TBTCVault.sol +47 -9
- package/export.json +19 -1
- package/package.json +1 -1
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
136
|
"internalType": "bytes",
|
|
137
|
-
"name": "",
|
|
137
|
+
"name": "extraData",
|
|
138
138
|
"type": "bytes"
|
|
139
139
|
}
|
|
140
140
|
],
|
|
@@ -273,10 +273,28 @@
|
|
|
273
273
|
"outputs": [],
|
|
274
274
|
"stateMutability": "nonpayable",
|
|
275
275
|
"type": "function"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"inputs": [
|
|
279
|
+
{
|
|
280
|
+
"internalType": "uint256",
|
|
281
|
+
"name": "amount",
|
|
282
|
+
"type": "uint256"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"internalType": "bytes",
|
|
286
|
+
"name": "redemptionData",
|
|
287
|
+
"type": "bytes"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"name": "unmintAndRedeem",
|
|
291
|
+
"outputs": [],
|
|
292
|
+
"stateMutability": "nonpayable",
|
|
293
|
+
"type": "function"
|
|
276
294
|
}
|
|
277
295
|
],
|
|
278
|
-
"bytecode": "
|
|
279
|
-
"deployedBytecode": "
|
|
296
|
+
"bytecode": "0x60806040523480156200001157600080fd5b506040516200133c3803806200133c8339810160408190526200003491620001b4565b6001600160a01b038216620000905760405162461bcd60e51b815260206004820181905260248201527f42616e6b2063616e206e6f7420626520746865207a65726f206164647265737360448201526064015b60405180910390fd5b6001600160a01b038116620000f75760405162461bcd60e51b815260206004820152602660248201527f5442544320746f6b656e2063616e206e6f7420626520746865207a65726f206160448201526564647265737360d01b606482015260840162000087565b603280546001600160a01b038085166001600160a01b031992831617909255603380549284169290911691909117905562000132336200013a565b5050620001f3565b600080546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80910160405180910390a15050565b6001600160a01b0381168114620001b157600080fd5b50565b60008060408385031215620001c857600080fd5b8251620001d5816200019b565b6020840151909250620001e8816200019b565b809150509250929050565b61113980620002036000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806376cdb03b11610081578063d38bfff41161005b578063d38bfff4146101a2578063e5d3d714146101b5578063fc4e51f6146101c857600080fd5b806376cdb03b146101695780638f4ffcb11461017c578063a0712d681461018f57600080fd5b806353dce4df116100b257806353dce4df146101145780635aa6e6751461012757806364e779b11461015657600080fd5b80631171bda9146100d9578063461c6373146100ee578063475d057014610101575b600080fd5b6100ec6100e7366004610d17565b6101db565b005b6100ec6100fc366004610da4565b6102c6565b6100ec61010f366004610e52565b6103d9565b6100ec610122366004610ea2565b610586565b60005461013a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100ec610164366004610eee565b610597565b60325461013a906001600160a01b031681565b6100ec61018a366004610f07565b6105a4565b6100ec61019d366004610eee565b610679565b6100ec6101b0366004610f7a565b6107cd565b60335461013a906001600160a01b031681565b6100ec6101d6366004610f9e565b6108ac565b6000546001600160a01b0316331461023a5760405162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520676f7665726e616e63650000000060448201526064015b60405180910390fd5b6033546040517f1171bda90000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015284811660248301526044820184905290911690631171bda990606401600060405180830381600087803b1580156102a957600080fd5b505af11580156102bd573d6000803e3d6000fd5b50505050505050565b6032546001600160a01b031633146103205760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610231565b8261036d5760405162461bcd60e51b815260206004820152601760248201527f4e6f206465706f7369746f7273207370656369666965640000000000000000006044820152606401610231565b60005b838110156103d2576103c085858381811061038d5761038d610ff4565b90506020020160208101906103a29190610f7a565b8484848181106103b4576103b4610ff4565b90506020020135610990565b806103ca8161100a565b915050610370565b5050505050565b6032546001600160a01b031633146104335760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610231565b6032546040516370a0823160e01b81526001600160a01b038681166004830152859216906370a082319060240160206040518083038186803b15801561047857600080fd5b505afa15801561048c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b09190611033565b10156105095760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610231565b6105138484610990565b603254604051631f1b6d2760e21b81526001600160a01b0386811660048301523060248301526044820186905290911690637c6db49c906064015b600060405180830381600087803b15801561056857600080fd5b505af115801561057c573d6000803e3d6000fd5b5050505050505050565b61059233848484610a25565b505050565b6105a13382610b8e565b50565b6033546001600160a01b038481169116146106015760405162461bcd60e51b815260206004820152601160248201527f546f6b656e206973206e6f7420544254430000000000000000000000000000006044820152606401610231565b336001600160a01b038416146106595760405162461bcd60e51b815260206004820152601860248201527f4f6e6c7920544254432063616c6c657220616c6c6f77656400000000000000006044820152606401610231565b8061066d576106688585610b8e565b6103d2565b6103d285858484610a25565b6032546040516370a0823160e01b815233600482018190529183916001600160a01b03909116906370a082319060240160206040518083038186803b1580156106c157600080fd5b505afa1580156106d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f99190611033565b10156107525760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610231565b61075c8183610990565b603254604051631f1b6d2760e21b81526001600160a01b0383811660048301523060248301526044820185905290911690637c6db49c906064015b600060405180830381600087803b1580156107b157600080fd5b505af11580156107c5573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146108275760405162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520676f7665726e616e6365000000006044820152606401610231565b6001600160a01b0381166108a35760405162461bcd60e51b815260206004820152602260248201527f4e657720676f7665726e616e636520697320746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610231565b6105a181610c89565b6000546001600160a01b031633146109065760405162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520676f7665726e616e6365000000006044820152606401610231565b6033546040517ffc4e51f60000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063fc4e51f6906109579088908890889088908890600401611075565b600060405180830381600087803b15801561097157600080fd5b505af1158015610985573d6000803e3d6000fd5b505050505050505050565b816001600160a01b03167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe826040516109cb91815260200190565b60405180910390a26033546040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015260248201849052909116906340c10f1990604401610797565b836001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b884604051610a6091815260200190565b60405180910390a260335460405163079cc67960e41b81526001600160a01b03868116600483015260248201869052909116906379cc679090604401600060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b5050603254604080517fe78cea9200000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169350634a38757e9250839163e78cea9291600480820192602092909190829003018186803b158015610b3457600080fd5b505afa158015610b48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6c91906110b3565b8585856040518563ffffffff1660e01b815260040161054e94939291906110d0565b816001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b882604051610bc991815260200190565b60405180910390a260335460405163079cc67960e41b81526001600160a01b03848116600483015260248201849052909116906379cc679090604401600060405180830381600087803b158015610c1f57600080fd5b505af1158015610c33573d6000803e3d6000fd5b50506032546040517f56a6d9ef0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301526024820186905290911692506356a6d9ef9150604401610797565b600080546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80910160405180910390a15050565b6001600160a01b03811681146105a157600080fd5b600080600060608486031215610d2c57600080fd5b8335610d3781610d02565b92506020840135610d4781610d02565b929592945050506040919091013590565b60008083601f840112610d6a57600080fd5b50813567ffffffffffffffff811115610d8257600080fd5b6020830191508360208260051b8501011115610d9d57600080fd5b9250929050565b60008060008060408587031215610dba57600080fd5b843567ffffffffffffffff80821115610dd257600080fd5b610dde88838901610d58565b90965094506020870135915080821115610df757600080fd5b50610e0487828801610d58565b95989497509550505050565b60008083601f840112610e2257600080fd5b50813567ffffffffffffffff811115610e3a57600080fd5b602083019150836020828501011115610d9d57600080fd5b60008060008060608587031215610e6857600080fd5b8435610e7381610d02565b935060208501359250604085013567ffffffffffffffff811115610e9657600080fd5b610e0487828801610e10565b600080600060408486031215610eb757600080fd5b83359250602084013567ffffffffffffffff811115610ed557600080fd5b610ee186828701610e10565b9497909650939450505050565b600060208284031215610f0057600080fd5b5035919050565b600080600080600060808688031215610f1f57600080fd5b8535610f2a81610d02565b9450602086013593506040860135610f4181610d02565b9250606086013567ffffffffffffffff811115610f5d57600080fd5b610f6988828901610e10565b969995985093965092949392505050565b600060208284031215610f8c57600080fd5b8135610f9781610d02565b9392505050565b600080600080600060808688031215610fb657600080fd5b8535610fc181610d02565b94506020860135610fd181610d02565b935060408601359250606086013567ffffffffffffffff811115610f5d57600080fd5b634e487b7160e01b600052603260045260246000fd5b600060001982141561102c57634e487b7160e01b600052601160045260246000fd5b5060010190565b60006020828403121561104557600080fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006001600160a01b038088168352808716602084015250846040830152608060608301526110a860808301848661104c565b979650505050505050565b6000602082840312156110c557600080fd5b8151610f9781610d02565b6001600160a01b03851681528360208201526060604082015260006110f960608301848661104c565b969550505050505056fea2646970667358221220d2cfb91930afdd275bc94b23bee0885041e8e6f33971c1a8d00e04c1b5b1ccf064736f6c63430008090033",
|
|
297
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806376cdb03b11610081578063d38bfff41161005b578063d38bfff4146101a2578063e5d3d714146101b5578063fc4e51f6146101c857600080fd5b806376cdb03b146101695780638f4ffcb11461017c578063a0712d681461018f57600080fd5b806353dce4df116100b257806353dce4df146101145780635aa6e6751461012757806364e779b11461015657600080fd5b80631171bda9146100d9578063461c6373146100ee578063475d057014610101575b600080fd5b6100ec6100e7366004610d17565b6101db565b005b6100ec6100fc366004610da4565b6102c6565b6100ec61010f366004610e52565b6103d9565b6100ec610122366004610ea2565b610586565b60005461013a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100ec610164366004610eee565b610597565b60325461013a906001600160a01b031681565b6100ec61018a366004610f07565b6105a4565b6100ec61019d366004610eee565b610679565b6100ec6101b0366004610f7a565b6107cd565b60335461013a906001600160a01b031681565b6100ec6101d6366004610f9e565b6108ac565b6000546001600160a01b0316331461023a5760405162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520676f7665726e616e63650000000060448201526064015b60405180910390fd5b6033546040517f1171bda90000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015284811660248301526044820184905290911690631171bda990606401600060405180830381600087803b1580156102a957600080fd5b505af11580156102bd573d6000803e3d6000fd5b50505050505050565b6032546001600160a01b031633146103205760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610231565b8261036d5760405162461bcd60e51b815260206004820152601760248201527f4e6f206465706f7369746f7273207370656369666965640000000000000000006044820152606401610231565b60005b838110156103d2576103c085858381811061038d5761038d610ff4565b90506020020160208101906103a29190610f7a565b8484848181106103b4576103b4610ff4565b90506020020135610990565b806103ca8161100a565b915050610370565b5050505050565b6032546001600160a01b031633146104335760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610231565b6032546040516370a0823160e01b81526001600160a01b038681166004830152859216906370a082319060240160206040518083038186803b15801561047857600080fd5b505afa15801561048c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b09190611033565b10156105095760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610231565b6105138484610990565b603254604051631f1b6d2760e21b81526001600160a01b0386811660048301523060248301526044820186905290911690637c6db49c906064015b600060405180830381600087803b15801561056857600080fd5b505af115801561057c573d6000803e3d6000fd5b5050505050505050565b61059233848484610a25565b505050565b6105a13382610b8e565b50565b6033546001600160a01b038481169116146106015760405162461bcd60e51b815260206004820152601160248201527f546f6b656e206973206e6f7420544254430000000000000000000000000000006044820152606401610231565b336001600160a01b038416146106595760405162461bcd60e51b815260206004820152601860248201527f4f6e6c7920544254432063616c6c657220616c6c6f77656400000000000000006044820152606401610231565b8061066d576106688585610b8e565b6103d2565b6103d285858484610a25565b6032546040516370a0823160e01b815233600482018190529183916001600160a01b03909116906370a082319060240160206040518083038186803b1580156106c157600080fd5b505afa1580156106d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f99190611033565b10156107525760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610231565b61075c8183610990565b603254604051631f1b6d2760e21b81526001600160a01b0383811660048301523060248301526044820185905290911690637c6db49c906064015b600060405180830381600087803b1580156107b157600080fd5b505af11580156107c5573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146108275760405162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520676f7665726e616e6365000000006044820152606401610231565b6001600160a01b0381166108a35760405162461bcd60e51b815260206004820152602260248201527f4e657720676f7665726e616e636520697320746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610231565b6105a181610c89565b6000546001600160a01b031633146109065760405162461bcd60e51b815260206004820152601c60248201527f43616c6c6572206973206e6f742074686520676f7665726e616e6365000000006044820152606401610231565b6033546040517ffc4e51f60000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063fc4e51f6906109579088908890889088908890600401611075565b600060405180830381600087803b15801561097157600080fd5b505af1158015610985573d6000803e3d6000fd5b505050505050505050565b816001600160a01b03167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe826040516109cb91815260200190565b60405180910390a26033546040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015260248201849052909116906340c10f1990604401610797565b836001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b884604051610a6091815260200190565b60405180910390a260335460405163079cc67960e41b81526001600160a01b03868116600483015260248201869052909116906379cc679090604401600060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b5050603254604080517fe78cea9200000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169350634a38757e9250839163e78cea9291600480820192602092909190829003018186803b158015610b3457600080fd5b505afa158015610b48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6c91906110b3565b8585856040518563ffffffff1660e01b815260040161054e94939291906110d0565b816001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b882604051610bc991815260200190565b60405180910390a260335460405163079cc67960e41b81526001600160a01b03848116600483015260248201849052909116906379cc679090604401600060405180830381600087803b158015610c1f57600080fd5b505af1158015610c33573d6000803e3d6000fd5b50506032546040517f56a6d9ef0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301526024820186905290911692506356a6d9ef9150604401610797565b600080546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80910160405180910390a15050565b6001600160a01b03811681146105a157600080fd5b600080600060608486031215610d2c57600080fd5b8335610d3781610d02565b92506020840135610d4781610d02565b929592945050506040919091013590565b60008083601f840112610d6a57600080fd5b50813567ffffffffffffffff811115610d8257600080fd5b6020830191508360208260051b8501011115610d9d57600080fd5b9250929050565b60008060008060408587031215610dba57600080fd5b843567ffffffffffffffff80821115610dd257600080fd5b610dde88838901610d58565b90965094506020870135915080821115610df757600080fd5b50610e0487828801610d58565b95989497509550505050565b60008083601f840112610e2257600080fd5b50813567ffffffffffffffff811115610e3a57600080fd5b602083019150836020828501011115610d9d57600080fd5b60008060008060608587031215610e6857600080fd5b8435610e7381610d02565b935060208501359250604085013567ffffffffffffffff811115610e9657600080fd5b610e0487828801610e10565b600080600060408486031215610eb757600080fd5b83359250602084013567ffffffffffffffff811115610ed557600080fd5b610ee186828701610e10565b9497909650939450505050565b600060208284031215610f0057600080fd5b5035919050565b600080600080600060808688031215610f1f57600080fd5b8535610f2a81610d02565b9450602086013593506040860135610f4181610d02565b9250606086013567ffffffffffffffff811115610f5d57600080fd5b610f6988828901610e10565b969995985093965092949392505050565b600060208284031215610f8c57600080fd5b8135610f9781610d02565b9392505050565b600080600080600060808688031215610fb657600080fd5b8535610fc181610d02565b94506020860135610fd181610d02565b935060408601359250606086013567ffffffffffffffff811115610f5d57600080fd5b634e487b7160e01b600052603260045260246000fd5b600060001982141561102c57634e487b7160e01b600052601160045260246000fd5b5060010190565b60006020828403121561104557600080fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006001600160a01b038088168352808716602084015250846040830152608060608301526110a860808301848661104c565b979650505050505050565b6000602082840312156110c557600080fd5b8151610f9781610d02565b6001600160a01b03851681528360208201526060604082015260006110f960608301848661104c565b969550505050505056fea2646970667358221220d2cfb91930afdd275bc94b23bee0885041e8e6f33971c1a8d00e04c1b5b1ccf064736f6c63430008090033",
|
|
280
298
|
"linkReferences": {},
|
|
281
299
|
"deployedLinkReferences": {}
|
|
282
300
|
}
|
package/contracts/bank/Bank.sol
CHANGED
|
@@ -141,7 +141,7 @@ contract Bank is Ownable {
|
|
|
141
141
|
function approveBalanceAndCall(
|
|
142
142
|
address spender,
|
|
143
143
|
uint256 amount,
|
|
144
|
-
bytes
|
|
144
|
+
bytes calldata extraData
|
|
145
145
|
) external {
|
|
146
146
|
_approveBalance(msg.sender, spender, amount);
|
|
147
147
|
IReceiveBalanceApproval(spender).receiveBalanceApproval(
|
|
@@ -30,7 +30,7 @@ interface IReceiveBalanceApproval {
|
|
|
30
30
|
/// @param amount The amount of the Bank balance approved by the owner
|
|
31
31
|
/// to be used by the contract.
|
|
32
32
|
/// @param extraData The `extraData` passed to `Bank.approveBalanceAndCall`.
|
|
33
|
-
|
|
33
|
+
/// @dev The implementation must ensure this function can only be called
|
|
34
34
|
/// by the Bank. The Bank does _not_ guarantee that the `amount`
|
|
35
35
|
/// approved by the `owner` currently exists on their balance. That is,
|
|
36
36
|
/// the `owner` could approve more balance than they currently have.
|
|
@@ -40,6 +40,6 @@ interface IReceiveBalanceApproval {
|
|
|
40
40
|
function receiveBalanceApproval(
|
|
41
41
|
address owner,
|
|
42
42
|
uint256 amount,
|
|
43
|
-
bytes
|
|
43
|
+
bytes calldata extraData
|
|
44
44
|
) external;
|
|
45
45
|
}
|
|
@@ -110,7 +110,7 @@ contract TBTCVault is IVault, Governable {
|
|
|
110
110
|
function receiveBalanceApproval(
|
|
111
111
|
address owner,
|
|
112
112
|
uint256 amount,
|
|
113
|
-
bytes
|
|
113
|
+
bytes calldata
|
|
114
114
|
) external override onlyBank {
|
|
115
115
|
require(
|
|
116
116
|
bank.balanceOf(owner) >= amount,
|
|
@@ -136,7 +136,7 @@ contract TBTCVault is IVault, Governable {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
/// @notice Burns `amount` of TBTC from the caller's
|
|
139
|
+
/// @notice Burns `amount` of TBTC from the caller's balance and transfers
|
|
140
140
|
/// `amount` back to the caller's balance in the Bank.
|
|
141
141
|
/// @dev Caller must have at least `amount` of TBTC approved to
|
|
142
142
|
/// TBTC Vault.
|
|
@@ -145,23 +145,51 @@ contract TBTCVault is IVault, Governable {
|
|
|
145
145
|
_unmint(msg.sender, amount);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
/// @notice Burns `amount` of TBTC from the caller's
|
|
149
|
-
/// `amount`
|
|
150
|
-
///
|
|
151
|
-
///
|
|
152
|
-
///
|
|
148
|
+
/// @notice Burns `amount` of TBTC from the caller's balance and transfers
|
|
149
|
+
/// `amount` of Bank balance to the Bridge requesting redemption
|
|
150
|
+
/// based on the provided `redemptionData`.
|
|
151
|
+
/// @dev Caller must have at least `amount` of TBTC approved to
|
|
152
|
+
/// TBTC Vault.
|
|
153
|
+
/// @param amount Amount of TBTC to unmint and request to redeem in Bridge.
|
|
154
|
+
/// @param redemptionData Redemption data in a format expected from
|
|
155
|
+
/// `redemptionData` parameter of Bridge's `receiveBalanceApproval`
|
|
156
|
+
/// function.
|
|
157
|
+
function unmintAndRedeem(uint256 amount, bytes calldata redemptionData)
|
|
158
|
+
external
|
|
159
|
+
{
|
|
160
|
+
_unmintAndRedeem(msg.sender, amount, redemptionData);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/// @notice Burns `amount` of TBTC from the caller's balance. If `extraData`
|
|
164
|
+
/// is empty, transfers `amount` back to the caller's balance in the
|
|
165
|
+
/// Bank. If `extraData` is not empty, requests redemption in the
|
|
166
|
+
/// Bridge using the `extraData` as a `redemptionData` parameter to
|
|
167
|
+
/// Bridge's `receiveBalanceApproval` function.
|
|
168
|
+
/// @dev This function is doing the same as `unmint` or `unmintAndRedeem`
|
|
169
|
+
/// (depending on `extraData` parameter) but it allows to execute
|
|
170
|
+
/// unminting without a separate approval transaction. The function can
|
|
171
|
+
/// be called only via `approveAndCall` of TBTC token.
|
|
153
172
|
/// @param from TBTC token holder executing unminting.
|
|
154
173
|
/// @param amount Amount of TBTC to unmint.
|
|
155
174
|
/// @param token TBTC token address.
|
|
175
|
+
/// @param extraData Redemption data in a format expected from
|
|
176
|
+
/// `redemptionData` parameter of Bridge's `receiveBalanceApproval`
|
|
177
|
+
/// function. If empty, `receiveApproval` is not requesting a
|
|
178
|
+
/// redemption of Bank balance but is instead performing just TBTC
|
|
179
|
+
/// unminting to a Bank balance.
|
|
156
180
|
function receiveApproval(
|
|
157
181
|
address from,
|
|
158
182
|
uint256 amount,
|
|
159
183
|
address token,
|
|
160
|
-
bytes calldata
|
|
184
|
+
bytes calldata extraData
|
|
161
185
|
) external {
|
|
162
186
|
require(token == address(tbtcToken), "Token is not TBTC");
|
|
163
187
|
require(msg.sender == token, "Only TBTC caller allowed");
|
|
164
|
-
|
|
188
|
+
if (extraData.length == 0) {
|
|
189
|
+
_unmint(from, amount);
|
|
190
|
+
} else {
|
|
191
|
+
_unmintAndRedeem(from, amount, extraData);
|
|
192
|
+
}
|
|
165
193
|
}
|
|
166
194
|
|
|
167
195
|
// slither-disable-next-line calls-loop
|
|
@@ -175,4 +203,14 @@ contract TBTCVault is IVault, Governable {
|
|
|
175
203
|
tbtcToken.burnFrom(unminter, amount);
|
|
176
204
|
bank.transferBalance(unminter, amount);
|
|
177
205
|
}
|
|
206
|
+
|
|
207
|
+
function _unmintAndRedeem(
|
|
208
|
+
address redeemer,
|
|
209
|
+
uint256 amount,
|
|
210
|
+
bytes calldata redemptionData
|
|
211
|
+
) internal {
|
|
212
|
+
emit Unminted(redeemer, amount);
|
|
213
|
+
tbtcToken.burnFrom(redeemer, amount);
|
|
214
|
+
bank.approveBalanceAndCall(bank.bridge(), amount, redemptionData);
|
|
215
|
+
}
|
|
178
216
|
}
|
package/export.json
CHANGED
|
@@ -16941,7 +16941,7 @@
|
|
|
16941
16941
|
},
|
|
16942
16942
|
{
|
|
16943
16943
|
"internalType": "bytes",
|
|
16944
|
-
"name": "",
|
|
16944
|
+
"name": "extraData",
|
|
16945
16945
|
"type": "bytes"
|
|
16946
16946
|
}
|
|
16947
16947
|
],
|
|
@@ -17080,6 +17080,24 @@
|
|
|
17080
17080
|
"outputs": [],
|
|
17081
17081
|
"stateMutability": "nonpayable",
|
|
17082
17082
|
"type": "function"
|
|
17083
|
+
},
|
|
17084
|
+
{
|
|
17085
|
+
"inputs": [
|
|
17086
|
+
{
|
|
17087
|
+
"internalType": "uint256",
|
|
17088
|
+
"name": "amount",
|
|
17089
|
+
"type": "uint256"
|
|
17090
|
+
},
|
|
17091
|
+
{
|
|
17092
|
+
"internalType": "bytes",
|
|
17093
|
+
"name": "redemptionData",
|
|
17094
|
+
"type": "bytes"
|
|
17095
|
+
}
|
|
17096
|
+
],
|
|
17097
|
+
"name": "unmintAndRedeem",
|
|
17098
|
+
"outputs": [],
|
|
17099
|
+
"stateMutability": "nonpayable",
|
|
17100
|
+
"type": "function"
|
|
17083
17101
|
}
|
|
17084
17102
|
]
|
|
17085
17103
|
}
|