ERC-721とERC-1155
ざっくりいうとERC-721=NFT ERC-1155=NFTとFTの合いの子
Remixでスマコンをデプロイする
準備Remix(remix.ethereum.org)にアクセスするメタマスク等で、デプロイしたいチェーンにあらかじめ変更しておく下のコードをコピーしておく// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Gm { function gm() public pure returns (string memory) { return "gm"; } } やり方(動画)https://vimeo.com/947462483 以上!

Pill Wheelポチポチbot
まえがきFarcasterのframeは言うてもiframeなのでJavascriptで操作できる。 ポチポチゲーはbot作って自動化しないともったいない。 もちろん無効になるリスクはあるけどリターンとの兼ね合いを考えると躊躇しても意味ない気がする。 だってどうせ短命やん。 今回のターゲットは👇️ https://warpcast.com/pilll/0xeabcccf9注意点不定期にエラーが出ます。おそらくレートリミット。Farcaster側で制御してるっぽく、frame全部がしばらく死にます。 そうなったらしばらく待ってからページをリロードしてコードを実行させたらOKです。やり方調べてください。コード// ボタンのテキストが「🔄Spin -100 points」であるボタンを探す関数 function findButtonByLabel(label) { const buttons = document.querySelectorAll('button'); for (let button of buttons) { if (button.innerText.includ...
<100 subscribers
ERC-721とERC-1155
ざっくりいうとERC-721=NFT ERC-1155=NFTとFTの合いの子
Remixでスマコンをデプロイする
準備Remix(remix.ethereum.org)にアクセスするメタマスク等で、デプロイしたいチェーンにあらかじめ変更しておく下のコードをコピーしておく// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Gm { function gm() public pure returns (string memory) { return "gm"; } } やり方(動画)https://vimeo.com/947462483 以上!

Pill Wheelポチポチbot
まえがきFarcasterのframeは言うてもiframeなのでJavascriptで操作できる。 ポチポチゲーはbot作って自動化しないともったいない。 もちろん無効になるリスクはあるけどリターンとの兼ね合いを考えると躊躇しても意味ない気がする。 だってどうせ短命やん。 今回のターゲットは👇️ https://warpcast.com/pilll/0xeabcccf9注意点不定期にエラーが出ます。おそらくレートリミット。Farcaster側で制御してるっぽく、frame全部がしばらく死にます。 そうなったらしばらく待ってからページをリロードしてコードを実行させたらOKです。やり方調べてください。コード// ボタンのテキストが「🔄Spin -100 points」であるボタンを探す関数 function findButtonByLabel(label) { const buttons = document.querySelectorAll('button'); for (let button of buttons) { if (button.innerText.includ...
Share Dialog
Share Dialog


This article is how to set the proper gas fee using thirdweb.js(v3.10.10) and ethers.js(v5.7.2).
Why is this explanation needed?
Because ethers.js has getFeeData() function but it sometimes doesn’t work because the max priority fee is set 1500000000wei, 1.5Gwei.
No kidding.
Don’t use it if you don’t want any bugs.

So I was troubled but finally I got the solution for it.
I’ll share that.
This example is to transfer a token of ERC-1155 using thirdweb.js and ethers.js.
In case ERC-721, you can use contract.erc721.transfer instead of contract.erc1155.transfer.
async function transfer(contract, walletAddress, tokenId) {
const { maxFeePerGas, maxPriorityFeePerGas } = await getFeeData();
const preTx = await contract.erc1155.transfer.prepare(
walletAddress,
tokenId,
1
);
preTx.setMaxFeePerGas(
ethers.utils.parseUnits(maxFeePerGas.toFixed(9), 'gwei')
);
preTx.setMaxPriorityFeePerGas(
ethers.utils.parseUnits(maxPriorityFeePerGas.toFixed(9), 'gwei')
);
await preTx.execute();
}
The perfectly correct getFeeData() function is below.
async function getFeeData(priority = 'standard') {
const response = await axios.get(
'https://gasstation.polygon.technology/v2'
);
const data = (() => {
switch (priority) {
case 'standard':
default:
return response.data.standard;
case 'fast':
return response.data.fast;
case 'low':
return response.data.safeLow;
}
})();
return {
maxFeePerGas: data.maxFee,
maxPriorityFeePerGas: data.maxPriorityFee,
};
}
This bug is terrible but ethers.js is awesome.
thirdweb.js is also awesome.
Bridge to Web3!
This article is how to set the proper gas fee using thirdweb.js(v3.10.10) and ethers.js(v5.7.2).
Why is this explanation needed?
Because ethers.js has getFeeData() function but it sometimes doesn’t work because the max priority fee is set 1500000000wei, 1.5Gwei.
No kidding.
Don’t use it if you don’t want any bugs.

So I was troubled but finally I got the solution for it.
I’ll share that.
This example is to transfer a token of ERC-1155 using thirdweb.js and ethers.js.
In case ERC-721, you can use contract.erc721.transfer instead of contract.erc1155.transfer.
async function transfer(contract, walletAddress, tokenId) {
const { maxFeePerGas, maxPriorityFeePerGas } = await getFeeData();
const preTx = await contract.erc1155.transfer.prepare(
walletAddress,
tokenId,
1
);
preTx.setMaxFeePerGas(
ethers.utils.parseUnits(maxFeePerGas.toFixed(9), 'gwei')
);
preTx.setMaxPriorityFeePerGas(
ethers.utils.parseUnits(maxPriorityFeePerGas.toFixed(9), 'gwei')
);
await preTx.execute();
}
The perfectly correct getFeeData() function is below.
async function getFeeData(priority = 'standard') {
const response = await axios.get(
'https://gasstation.polygon.technology/v2'
);
const data = (() => {
switch (priority) {
case 'standard':
default:
return response.data.standard;
case 'fast':
return response.data.fast;
case 'low':
return response.data.safeLow;
}
})();
return {
maxFeePerGas: data.maxFee,
maxPriorityFeePerGas: data.maxPriorityFee,
};
}
This bug is terrible but ethers.js is awesome.
thirdweb.js is also awesome.
Bridge to Web3!
No comments yet