-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fullfillment erroring with: Error in fullilment: Error: The fulfiller does not have the balances needed to fulfill. * added missing files * order succesfully fulfilled * dont need to be storing fulfilments * input chain, tokenid and order path into cli instead of hardcoded * added different offerer and fulfiller wallets, still erroring * order failing on InvalidRestrictedOrder * added get order hash at the end of createListing" * order succesfully fulfilled * added missing files * changed private key names to offerer and buyer * updated the example.env * .dist, types and .nvmrc * fix package.json * ts formatting --------- Co-authored-by: Patrick Gallagher <[email protected]>
- Loading branch information
1 parent
45f4007
commit 760b523
Showing
12 changed files
with
1,034 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,33 @@ | ||
ARB_MAINNET_RPC= | ||
ARB_MAINNET_PK= | ||
ARB_SEPOLIA_RPC= | ||
ARB_SEPOLIA_PK= | ||
ARB_SEPOLIA_OFFERER_PK= | ||
ARB_SEPOLIA_BUYER_PK= | ||
# put the public address of your defaultKey here if you're using the cast wallet | ||
DEFAULT_KEY_PUBLIC_ADDRESS= | ||
|
||
ARB_ETHERSCAN_API_KEY=P6DZ75FA2M4WPHNXTIBGKJX4STQP8CGU4G | ||
|
||
ARB_SEPOLIA_RPC= | ||
ARB_SEPOLIA_PK= | ||
ARB_ETHERSCAN_API_KEY= | ||
DEFAULT_KEY_PUBLIC_ADDRESS= | ||
|
||
# run `anvil` and copy a private key from anvil terminal | ||
ANVIL_ONE=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | ||
ANVIL_RPC=http://127.0.0.1:8545 | ||
|
||
FOUNDRY_PROFILE=debug | ||
|
||
VAULT712_SEPOLIA_ADDRESS=0x05AC7e3ac152012B980407dEff2655c209667E4c | ||
VAULT712_MAINNET_ADDRESS=0x0005AFE00fF7E7FF83667bFe4F2996720BAf0B36 | ||
VAULT721_SEPOLIA_ADDRESS=0x05AC7e3ac152012B980407dEff2655c209667E4c | ||
VAULT721_MAINNET_ADDRESS=0x0005AFE00fF7E7FF83667bFe4F2996720BAf0B36 | ||
VAULT721_ANVIL_ADDRESS= | ||
|
||
OPENSEA_API_KEY= | ||
|
||
SIP15_ZONE_ANVIL_ADDRESS= | ||
SIP15_ZONE_ANVIL_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3 | ||
SIP15_ZONE_SEPOLIA_ADDRESS=0xD658CB9C7626e147c4bd8B8Ef401f1Fb42cA7695 | ||
SIP15_ZONE_MAINNET_ADDRESS= | ||
|
||
VAULT712_MAINNET_ADAPTER_ADDRESS= | ||
VAULT721_MAINNET_ADAPTER_ADDRESS= | ||
VAULT721_SEPOLIA_ADAPTER_ADDRESS=0xc5736e1F01FB4f013C152B8315019CA20d30FC50 | ||
VAULT721_ANVIL_ADAPTER_ADDRESS= | ||
VAULT721_ANVIL_ADAPTER_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 | ||
|
||
ENCODING_HELPER= | ||
ENCODING_HELPER_MAINNET= | ||
ENCODING_HELPER_ANVIL= | ||
ENCODING_HELPER_SEPOLIA= | ||
ENCODING_HELPER_SEPOLIA=0x672d358f171ae309dc43fc7b5ff3065e8248efe1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,7 @@ docs/ | |
lib/ | ||
|
||
# Typescript | ||
types | ||
types | ||
dist | ||
|
||
.nvmrc |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"parameters": { | ||
"offerer": "0x941E92c9Eff78a2b7217057752cf938040a59aE9", | ||
"zone": "0xcafc335d2f5bd0e929b4edbf526eb74fa4c49924", | ||
"zoneHash": "0x7f1aff2effced629bfcae4e0a3f749094b2af49ee70357d6bca4e8a2d36eea57", | ||
"startTime": 1718408958, | ||
"endTime": "1718495358", | ||
"orderType": 2, | ||
"offer": [ | ||
{ | ||
"itemType": 2, | ||
"token": "0x05AC7e3ac152012B980407dEff2655c209667E4c", | ||
"identifierOrCriteria": "128", | ||
"startAmount": "1", | ||
"endAmount": "1" | ||
} | ||
], | ||
"consideration": [ | ||
{ | ||
"itemType": 1, | ||
"token": "0x8c12A21C8D62d794f78E02aE9e377Abee4750E87", | ||
"identifierOrCriteria": "0", | ||
"startAmount": "1000000", | ||
"endAmount": "1000000", | ||
"recipient": "0x941E92c9Eff78a2b7217057752cf938040a59aE9" | ||
} | ||
], | ||
"totalOriginalConsiderationItems": 1, | ||
"salt": "0x000000000000000000000000000000000000000000000000cb3ba97239090623", | ||
"conduitKey": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"counter": "0" | ||
}, | ||
"signature": "0xf76030ec389f1f116d3297f58b586092568403b856a56f8696da82d4e088197f858bcc8142a387a3911355bee84751dc009e365484a94e5c7977a16ace75d270" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { Web3Environment, ERC20ABI } from "./utils/constants"; | ||
import { convertBigIntsToStrings, getExtraData } from "./utils/helpers"; | ||
import { OrderWithCounter } from "@opensea/seaport-js/src/types"; | ||
import { ethers } from "ethers"; | ||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
const args = process.argv.slice(2); | ||
const chain = args[0]; | ||
const jsonPath = args[1]; | ||
|
||
const fulfillSIP15Order = async (chain: string, pathToOrder: string) => { | ||
const web3Env = new Web3Environment("fulfiller", chain); | ||
const seaport = web3Env.seaport; | ||
const wallet = web3Env.wallet; | ||
|
||
const _path = path.join(pathToOrder); | ||
const orderWithCounter = JSON.parse( | ||
fs.readFileSync(_path, "utf-8") | ||
) as OrderWithCounter; | ||
|
||
const erc20 = new ethers.Contract( | ||
orderWithCounter.parameters.consideration[0].token, | ||
ERC20ABI.abi, | ||
wallet | ||
); | ||
const extraData = await getExtraData( | ||
web3Env, | ||
orderWithCounter.parameters.offer[0].identifierOrCriteria | ||
); | ||
|
||
try { | ||
const conduitAddress = (await seaport.contract.information()) | ||
.conduitController; | ||
const seaportAddress = await seaport.contract.getAddress(); | ||
|
||
await erc20.approve(seaportAddress, ethers.MaxUint256); | ||
await erc20.approve(conduitAddress, ethers.MaxUint256); | ||
|
||
const { executeAllActions } = await seaport.fulfillOrder({ | ||
order: orderWithCounter, | ||
unitsToFill: 1, | ||
extraData: extraData, | ||
exactApproval: true, | ||
}); | ||
|
||
const fulfillment = await executeAllActions(); | ||
|
||
console.log("Successfully fulfilled a listing:", fulfillment.to); | ||
} catch (error) { | ||
console.error("Error in fulfillment:", error); | ||
} | ||
}; | ||
|
||
// Check if the module is the main entry point | ||
if (require.main === module) { | ||
// If yes, run the createOffer function | ||
fulfillSIP15Order(chain, jsonPath).catch((error) => { | ||
console.error("Error in fulfillSIP15ZoneOrder:", error); | ||
}); | ||
} | ||
|
||
export default fulfillSIP15Order; |
Oops, something went wrong.