Skip to content

[WIP] ERC20 assets #7321

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

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
376d184
generate entrypoint functions
kumaryash90 Jun 11, 2025
2253ce5
Merge branch 'main' into yash/ocr-contracts-integration
MananTank Jun 23, 2025
6b816fb
Fix lint errors
MananTank Jun 23, 2025
7266b31
update package.json
MananTank Jun 23, 2025
47c87ea
remove export *
MananTank Jun 23, 2025
82cc116
remove export *
MananTank Jun 23, 2025
f44e15c
Merge branch 'main' into yash/ocr-contracts-integration
MananTank Jun 30, 2025
873e46d
base mainnet entrypoint
kumaryash90 Jun 30, 2025
b716941
fix entrypoint addr
kumaryash90 Jul 1, 2025
0d71393
fix lint
MananTank Jul 1, 2025
3b59656
Merge branch 'main' into yash/ocr-contracts-integration
MananTank Jul 7, 2025
6752878
Update contracts. New pool config encoder. Salt mixing
jakeloo Jul 10, 2025
2c8b80e
Fix build
MananTank Jul 10, 2025
3ea3f24
Merge branch 'main' into yash/ocr-contracts-integration
MananTank Jul 10, 2025
89e63f9
Update contracts. Add RewardLocker. Simplify assets
jakeloo Jul 15, 2025
9ed4e64
Update ABI and deployment
jakeloo Jul 15, 2025
6500b3d
Fix knip lint
MananTank Jul 15, 2025
cad9f80
fix build
MananTank Jul 15, 2025
f38c5f9
Merge branch 'main' into yash/ocr-contracts-integration
MananTank Jul 15, 2025
795ecd7
export getReward, run format
MananTank Jul 15, 2025
e1f1530
Update addresses
jakeloo Jul 16, 2025
09ca5c6
Update contract
jakeloo Jul 17, 2025
7e319a7
Merge branch 'main' into yash/ocr-contracts-integration
MananTank Jul 17, 2025
8dc959c
Update entrypoint contract
jakeloo Jul 18, 2025
9729174
pnpm run fix
MananTank Jul 22, 2025
583af3f
Merge branch 'main' into yash/ocr-contracts-integration
MananTank Jul 22, 2025
26f96d8
assets -> tokens. update contracts, remove unused
jakeloo Jul 23, 2025
705aa97
pnpm run fix
MananTank Jul 23, 2025
9f40f3e
Fix knip lint
MananTank Jul 23, 2025
ec263f6
Fix /tokens exports
MananTank Jul 23, 2025
4cb1582
export claimReward
MananTank Jul 23, 2025
5287079
delete /extensions/assets
MananTank Jul 23, 2025
fca8689
token salt guard
jakeloo Jul 23, 2025
1ef831a
Update ABIs and Interfaces
jakeloo Jul 26, 2025
b15abc7
Fix format
jakeloo Jul 26, 2025
e91dc3b
biome fix
jakeloo Jul 26, 2025
9989b9d
getEntrypointERC20 -> getDeployedEntrypointERC20
jakeloo Jul 26, 2025
6f42264
Update ABI and contract address
jakeloo Jul 26, 2025
cf65f4f
Merge branch 'main' into yash/ocr-contracts-integration
MananTank Jul 29, 2025
1dba7fd
reduce diff
MananTank Jul 29, 2025
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
5 changes: 5 additions & 0 deletions .changeset/young-carrots-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

ERC20 assets
86 changes: 26 additions & 60 deletions packages/thirdweb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,70 +143,36 @@
"import": "./dist/esm/exports/engine.js",
"default": "./dist/cjs/exports/engine.js"
},
"./assets": {
"types": "./dist/types/exports/assets.d.ts",
"import": "./dist/esm/exports/assets.js",
"default": "./dist/cjs/exports/assets.js"
},
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"adapters/*": [
"./dist/types/exports/adapters/*.d.ts"
],
"auth": [
"./dist/types/exports/auth.d.ts"
],
"chains": [
"./dist/types/exports/chains.d.ts"
],
"contract": [
"./dist/types/exports/contract.d.ts"
],
"deploys": [
"./dist/types/exports/deploys.d.ts"
],
"event": [
"./dist/types/exports/event.d.ts"
],
"extensions/*": [
"./dist/types/exports/extensions/*.d.ts"
],
"pay": [
"./dist/types/exports/pay.d.ts"
],
"react": [
"./dist/types/exports/react.d.ts"
],
"react-native": [
"./dist/types/exports/react.native.d.ts"
],
"rpc": [
"./dist/types/exports/rpc.d.ts"
],
"storage": [
"./dist/types/exports/storage.d.ts"
],
"transaction": [
"./dist/types/exports/transaction.d.ts"
],
"utils": [
"./dist/types/exports/utils.d.ts"
],
"wallets": [
"./dist/types/exports/wallets.d.ts"
],
"wallets/*": [
"./dist/types/exports/wallets/*.d.ts"
],
"modules": [
"./dist/types/exports/modules.d.ts"
],
"social": [
"./dist/types/exports/social.d.ts"
],
"ai": [
"./dist/types/exports/ai.d.ts"
],
"bridge": [
"./dist/types/exports/bridge.d.ts"
]
"adapters/*": ["./dist/types/exports/adapters/*.d.ts"],
"auth": ["./dist/types/exports/auth.d.ts"],
"chains": ["./dist/types/exports/chains.d.ts"],
"contract": ["./dist/types/exports/contract.d.ts"],
"deploys": ["./dist/types/exports/deploys.d.ts"],
"event": ["./dist/types/exports/event.d.ts"],
"extensions/*": ["./dist/types/exports/extensions/*.d.ts"],
"pay": ["./dist/types/exports/pay.d.ts"],
"react": ["./dist/types/exports/react.d.ts"],
"react-native": ["./dist/types/exports/react.native.d.ts"],
"rpc": ["./dist/types/exports/rpc.d.ts"],
"storage": ["./dist/types/exports/storage.d.ts"],
"transaction": ["./dist/types/exports/transaction.d.ts"],
"utils": ["./dist/types/exports/utils.d.ts"],
"wallets": ["./dist/types/exports/wallets.d.ts"],
"wallets/*": ["./dist/types/exports/wallets/*.d.ts"],
"modules": ["./dist/types/exports/modules.d.ts"],
"social": ["./dist/types/exports/social.d.ts"],
"ai": ["./dist/types/exports/ai.d.ts"],
"bridge": ["./dist/types/exports/bridge.d.ts"],
"assets": ["./dist/types/exports/assets.d.ts"]
}
},
"browser": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
"function initialize(address _owner, address _router, address _rewardLocker)",
"function setRouter(address router)",
"function getRouter() external view returns (address router)",
"function setRewardLocker(address rewardLocker)",
"function getRewardLocker() external view returns (address rewardLocker)",
"function addImplementation((bytes32 contractId, address implementation, uint8 implementationType, uint8 createHook, bytes createHookData) config, bool isDefault)",
"function getImplementation(bytes32 contractId) external view returns ((bytes32 contractId, address implementation, uint8 implementationType, uint8 createHook, bytes createHookData))",
"function createAsset(address creator, (uint256 amount, address referrer, bytes32 salt, bytes data, bytes hookData) createParams) external returns (address asset)",
"function createAssetById(bytes32 contractId, address creator, (uint256 amount, address referrer, bytes32 salt, bytes data, bytes hookData) params) public returns (address asset)",
"function createAssetByImplementationConfig((bytes32 contractId, address implementation, uint8 implementationType, uint8 createHook, bytes createHookData) config, address creator, (uint256 amount, address referrer, bytes32 salt, bytes data, bytes hookData) params) external returns (address asset)",
"function buyAsset(address asset, (address recipient, address referrer, address tokenIn, uint256 amountIn, uint256 minAmountOut, uint256 deadline, bytes data) params) external payable returns (uint256 amountIn, uint256 amountOut)",
"function sellAsset(address asset, (address recipient, address tokenOut, uint256 amountIn, uint256 minAmountOut, uint256 deadline, bytes data) params) external returns (uint256 amountIn, uint256 amountOut)",
"function listAsset(address asset, (address tokenIn, uint256 price, uint256 duration, bytes data) params) external",
"function distributeAsset(address asset, (uint256 amount, address recipient)[] contents) external payable",
"event ImplementationAdded(bytes32 contractId, address indexed implementation, uint8 implementationType, uint8 createHook, bytes32 createHookData)",
"event RouterUpdated(address indexed router)",
"event RewardLockerUpdated(address indexed locker)",
"event AssetCreated(bytes32 contractId, address indexed creator, address indexed asset, address referrer, bytes aux)",
"event AssetDistributed(address asset, uint256 recipientCount, uint256 totalAmount)",
"error InvalidValue()",
"error InvalidContractId()",
"error ValueTransferFailed()",
"error ArrayLengthMismatch()",
"error AssetNotRegistered()",
"error InvalidCreator()",
"error InvalidInitializer()",
"error InvalidImplementation()",
"error InvalidDeploymentArgs()",
"error InvalidCreateHook()",
"error CreateHookFailed()",
"error CreateHookReverted(string reason)",
"error ImplementationAlreadyExists()"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
"function deployInfraProxyDeterministic(address implementation, bytes data, bytes32 salt, bytes extraData) public returns (address deployedProxy)",
"event AssetInfraDeployed(address indexed implementation, address indexed proxy, bytes32 inputSalt, bytes data, bytes extraData)",
"error ProxyDeploymentFailed()"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"function initialize(string _name, string _symbol, string _contractURI, uint256 _maxSupply, address _owner) external"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"function initialize(address _owner, address _feeRecipient, uint96 _defaultFee) external"
]
3 changes: 3 additions & 0 deletions packages/thirdweb/scripts/generate/abis/assets/Router.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"function initialize(address _owner) external"
]
Loading
Loading