You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
We want to allow smart contracts to be lenders for a loan. Right now each lender must sign their own loan offering. Because smart contracts cannot make signatures, smart contracts can't be lenders right now.
We need to separate lender into two fields: lender and signer. If nonzero then the signer will be the one that has the signature checked. We also need to implement an interface for smart contracts to approve loans if they are the lender.
This is a very similar problem to the one 0x is trying to solve with allowing smart contracts to be makers for an order. I've been talking to Will and Amir about the best ways to implement this.
The text was updated successfully, but these errors were encountered:
Add address signer to loan offering message format
If signer is zero, then just the lender is just the signer. If signer is nonzero, then that address must be used to do the ECDSA signature for the loan offering.
We also will add a standard interface that contracts can implement to approve of loans being made on their behalf by a signer. The interface will be as follows:
// Interface a contract would need to implement to verify an off-chain order
contract LoanOfferingVerifier {
function verifyLoanOffering(
address[8] addresses, // Add one address for signer field
uint[9] values256,
uint32[3] values32,
bytes32 shortId
// Signature unnecessary as it is checked by short sell contract
) returns (bool _isValid) { // However the contract wants to verify the order }
...
contract ShortSell {
function short(...) {
...
require(
loanOffering.signer == address(0)
|| LoanOfferingVerifier(loanOffering.maker).verifyLoanOffering(// args)
);
...
We want to allow smart contracts to be lenders for a loan. Right now each lender must sign their own loan offering. Because smart contracts cannot make signatures, smart contracts can't be lenders right now.
We need to separate lender into two fields: lender and signer. If nonzero then the signer will be the one that has the signature checked. We also need to implement an interface for smart contracts to approve loans if they are the lender.
This is a very similar problem to the one 0x is trying to solve with allowing smart contracts to be makers for an order. I've been talking to Will and Amir about the best ways to implement this.
The text was updated successfully, but these errors were encountered: