Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to OP Sepolia #38

Merged
merged 3 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@
if (errorContract instanceof Error) core.setFailed(errorContract.message)
}

const provider = new ethers.JsonRpcProvider(
'https://ethereum-sepolia.publicnode.com'
)
const provider = new ethers.JsonRpcProvider('https://sepolia.optimism.io')
const specialSigner = new ethers.Wallet(privateKey, provider)
const pattini = new ethers.Contract(contractAddress, abi, specialSigner)

Expand All @@ -62,7 +60,7 @@
const issueDescription = issue.body
const issueDescriptionSplit = issueDescription.split('\n')

for (let i = 0; i < issueDescriptionSplit.length; i++) {

Check warning on line 63 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Expected a `for-of` loop instead of a `for` loop with this simple iteration

Check warning on line 63 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected a `for-of` loop instead of a `for` loop with this simple iteration
const line = issueDescriptionSplit[i]
const [key, value] = line.split(':').map((item: string) => item.trim())
if (key === 'Amount') {
Expand All @@ -74,11 +72,12 @@

const take = await pattini.take(issueNumber, amount, recipientAddress)
const takeReceipt = await take.wait(1)
const message = `The wallet address ${recipientAddress} has been set to an issue. https://sepolia.etherscan.io/tx/${takeReceipt.hash}`
const message = `The wallet address ${recipientAddress} has been set to an issue. https://sepolia-optimism.etherscan.io/tx/${takeReceipt.hash}`
console.log(message)
} else if (action === 'pull_request') {
const pay = await pattini.pay(issueNumber, parseInt(pullRequestNumber))
const message = `The person who created the ${issueNumberDataSplit} branch has just received a reward. https://sepolia.etherscan.io/tx/${pay.hash}`
const payReceipt = await pay.wait(1)
const message = `The person who created the ${issueNumberDataSplit} branch has just received a reward. https://sepolia-optimism.etherscan.io/tx/${payReceipt.hash}`
console.log(message)
}
} catch (error) {
Expand Down
Loading