Has anyone successfully bought from OpenSea utilizing the smart contracts directly?
I am attempting this and have found that:
If you create an order and try to alter any parameter, like so:
let { order, orderHash, value } = await createOrder( seller, zone, offer, consideration, 0 // FULL_OPEN );
const basicOrderParameters = getBasicOrderParameters( 0, // EthForERC721 order ); basicOrderParameters.salt = randomHex(),
The smart contract call to fulfillBasicOrder will revert during the execution of _assertValidSignature(), at the following line:
pop(
staticcall(
gas(),
Ecrecover_precompile, // Call ecrecover precompile.
wordBeforeSignaturePtr, // Use data memory location.
Ecrecover_args_size, // Size of digest, v, r, and s.
0, // Write result to scratch space.
OneWord // Provide size of returned result.
)
)
Therefore, any differing parameter such as startTime or endTime or even salt will generate a different signature -> might be considered an invalid signature, reverting the transaction.
The only ones who can hold the salt for each transaction can be OpenSea, as it is calculated in the backend. timeStart or timeEnd for each order could potentially be an issue as well, but probably scrapeable from external APIs.
This leads to the idea that it might not be possible to reverse an order without access to all parameters used in its creation, such as salt.
On the other hand, this answer says that:
You need to pull the order structure and signature from the Opensea API, and then just send that order with the buyer's signature (that you have to prompt) in order to fulfill an order. The process:
Getting the order structure (without the original salt and using arbitrary time) is pretty easy, so why is the transaction always reverting?
EDIT: I don't think the salt, or time is a problem. From the docs:
Calling one of two "standard" functions, fulfillOrder and fulfillAdvancedOrder, where a second implied order will be constructed with the caller as the offerer, the consideration of the fulfilled order as the offer, and the offer of the fulfilled order as the consideration
This means that orderHashes are necessarily different. One order will have Offer A and Consideration B, and the other order will have Offer B and Consideration A (switching some paramters), which will necessarily generate a different hash and signature for each.
Therefore the salt and time in the signature should not be causing this issue. What could possibly be causing the reversals?