@artblocks/contracts 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2_Web3Call.sol/BytecodeStorageReaderContractV2_Web3Call.json +201 -0
- package/artifacts/contracts/BytecodeStorageReaders/UniversalBytecodeStorageReader.sol/UniversalBytecodeStorageReader.json +2 -2
- package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +42 -53
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +2 -2
- package/artifacts/contracts/generator/GenArt721GeneratorV0.sol/GenArt721GeneratorV0.json +2 -2
- package/artifacts/contracts/interfaces/v0.8.x/IDelegateRegistry.sol/IDelegateRegistry.json +820 -0
- package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +13 -0
- package/artifacts/contracts/interfaces/v0.8.x/IPMPAugmentHook.sol/IPMPAugmentHook.json +83 -0
- package/artifacts/contracts/interfaces/v0.8.x/IPMPConfigureHook.sol/IPMPConfigureHook.json +80 -0
- package/artifacts/contracts/interfaces/v0.8.x/IPMPV0.sol/IPMPV0.json +402 -0
- package/artifacts/contracts/interfaces/v0.8.x/IUniversalBytecodeStorageReader.sol/IUniversalBytecodeStorageReader.json +13 -0
- package/artifacts/contracts/interfaces/v0.8.x/IWeb3Call.sol/IWeb3Call.json +47 -0
- package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegateRegistry.sol/DelegateRegistry.json +846 -0
- package/artifacts/contracts/libs/integration-refs/delegation-registry/libraries/RegistryHashes.sol/RegistryHashes.json +10 -0
- package/artifacts/contracts/libs/integration-refs/delegation-registry/libraries/RegistryOps.sol/RegistryOps.json +10 -0
- package/artifacts/contracts/libs/integration-refs/delegation-registry/libraries/RegistryStorage.sol/RegistryStorage.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol/DependencyRegistryStorageLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/ImmutableStringArray.sol/ImmutableStringArray.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/V3FlexLib.sol/V3FlexLib.json +2 -2
- package/artifacts/contracts/mock/ImmutableStringArrayMock.sol/ImmutableStringArrayMock.json +69 -0
- package/artifacts/contracts/mock/MockPMPAugmentHook.sol/MockPMPAugmentHook.json +214 -0
- package/artifacts/contracts/mock/MockPMPConfigureHook.sol/MockPMPConfigureHook.json +236 -0
- package/artifacts/contracts/web3call/PMPV0.sol/PMPV0.json +629 -0
- package/artifacts/contracts/web3call/Web3Call.sol/Web3Call.json +66 -0
- package/artifacts/contracts/web3call/augment-hooks/AbstractPMPAugmentHook.sol/AbstractPMPAugmentHook.json +83 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectBaseGasFee.sol/InjectBaseGasFee.json +83 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol/IUniswapV2Pair.json +60 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol/InjectChromieSquiggleFloorPrice.json +107 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectIsNounsDaoMember.sol/InjectIsNounsDaoMember.json +96 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol/InjectIsProjectFullyMinted.json +83 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectPolyptychTokenHash.sol/InjectPolyptychTokenHash.json +141 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol/InjectTokenHashSeed.json +99 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwner.sol/InjectTokenOwner.json +99 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol/InjectTokenOwnerEthBalance.json +83 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectUSDCTotalSupply.sol/InjectUSDCTotalSupply.json +107 -0
- package/artifacts/contracts/web3call/configure-hooks/abstractPMPConfigureHook.sol/AbstractPMPConfigureHook.json +80 -0
- package/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2_Web3Call.sol +128 -0
- package/contracts/DependencyRegistryV0.sol +67 -28
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +7 -1
- package/contracts/generator/GenArt721GeneratorV0.sol +77 -8
- package/contracts/interfaces/v0.8.x/IDelegateRegistry.sol +318 -0
- package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +2 -0
- package/contracts/interfaces/v0.8.x/IPMPAugmentHook.sol +31 -0
- package/contracts/interfaces/v0.8.x/IPMPConfigureHook.sol +25 -0
- package/contracts/interfaces/v0.8.x/IPMPV0.sol +224 -0
- package/contracts/interfaces/v0.8.x/IUniversalBytecodeStorageReader.sol +5 -0
- package/contracts/interfaces/v0.8.x/IWeb3Call.sol +28 -0
- package/contracts/libs/integration-refs/delegation-registry/DelegateRegistry.sol +753 -0
- package/contracts/libs/integration-refs/delegation-registry/libraries/RegistryHashes.sol +359 -0
- package/contracts/libs/integration-refs/delegation-registry/libraries/RegistryOps.sol +31 -0
- package/contracts/libs/integration-refs/delegation-registry/libraries/RegistryStorage.sol +87 -0
- package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +3 -0
- package/contracts/libs/v0.8.x/ImmutableStringArray.sol +301 -0
- package/contracts/libs/v0.8.x/V3FlexLib.sol +7 -1
- package/contracts/mock/ImmutableStringArrayMock.sol +47 -0
- package/contracts/mock/MockPMPAugmentHook.sol +170 -0
- package/contracts/mock/MockPMPConfigureHook.sol +78 -0
- package/contracts/web3call/PMPV0.sol +1126 -0
- package/contracts/web3call/Web3Call.sol +25 -0
- package/contracts/web3call/augment-hooks/AbstractPMPAugmentHook.sol +46 -0
- package/contracts/web3call/augment-hooks/InjectBaseGasFee.sol +57 -0
- package/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol +103 -0
- package/contracts/web3call/augment-hooks/InjectIsNounsDaoMember.sol +66 -0
- package/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol +73 -0
- package/contracts/web3call/augment-hooks/InjectPolyptychTokenHash.sol +88 -0
- package/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol +62 -0
- package/contracts/web3call/augment-hooks/InjectTokenOwner.sol +60 -0
- package/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol +61 -0
- package/contracts/web3call/augment-hooks/InjectUSDCTotalSupply.sol +69 -0
- package/contracts/web3call/configure-hooks/abstractPMPConfigureHook.sol +41 -0
- package/package.json +5 -5
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
pragma solidity ^0.8.0;
|
|
5
|
+
|
|
6
|
+
import {AbstractPMPAugmentHook} from "./AbstractPMPAugmentHook.sol";
|
|
7
|
+
|
|
8
|
+
import {IWeb3Call} from "../../interfaces/v0.8.x/IWeb3Call.sol";
|
|
9
|
+
import {IERC20} from "@openzeppelin-5.0/contracts/interfaces/IERC20.sol";
|
|
10
|
+
import {Strings} from "@openzeppelin-5.0/contracts/utils/Strings.sol";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @title InjectUSDCTotalSupply
|
|
14
|
+
* @author Art Blocks Inc.
|
|
15
|
+
* @notice This hook appends the total supply of USDC, in wei, to a tokens PMPs.
|
|
16
|
+
*/
|
|
17
|
+
contract InjectUSDCTotalSupply is AbstractPMPAugmentHook {
|
|
18
|
+
using Strings for uint256;
|
|
19
|
+
|
|
20
|
+
address public immutable usdcAddress;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @notice Constructor.
|
|
24
|
+
* @param _usdcAddress The address of the USDC contract.
|
|
25
|
+
* For mainnet, this is 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
|
|
26
|
+
*/
|
|
27
|
+
constructor(address _usdcAddress) {
|
|
28
|
+
usdcAddress = _usdcAddress;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @notice Augment the token parameters for a given token.
|
|
33
|
+
* Appends the token owner's ETH balance into a tokens PMPs.
|
|
34
|
+
* @dev This hook is called when a token's PMPs are read.
|
|
35
|
+
* @dev This must return all desired tokenParams, not just additional data.
|
|
36
|
+
* @param tokenParams The token parameters for the queried token.
|
|
37
|
+
* @return augmentedTokenParams The augmented token parameters.
|
|
38
|
+
*/
|
|
39
|
+
function onTokenPMPReadAugmentation(
|
|
40
|
+
address /* coreContract */,
|
|
41
|
+
uint256 /* tokenId */,
|
|
42
|
+
IWeb3Call.TokenParam[] calldata tokenParams
|
|
43
|
+
)
|
|
44
|
+
external
|
|
45
|
+
view
|
|
46
|
+
override
|
|
47
|
+
returns (IWeb3Call.TokenParam[] memory augmentedTokenParams)
|
|
48
|
+
{
|
|
49
|
+
// create a new tokenParam array with one extra element
|
|
50
|
+
uint256 originalLength = tokenParams.length;
|
|
51
|
+
uint256 newLength = originalLength + 1;
|
|
52
|
+
augmentedTokenParams = new IWeb3Call.TokenParam[](newLength);
|
|
53
|
+
|
|
54
|
+
// copy the original tokenParams into the new array
|
|
55
|
+
for (uint256 i = 0; i < originalLength; i++) {
|
|
56
|
+
augmentedTokenParams[i] = tokenParams[i];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// get + inject the total supply of USDC
|
|
60
|
+
uint256 totalSupplyUSDC = IERC20(usdcAddress).totalSupply();
|
|
61
|
+
augmentedTokenParams[originalLength] = IWeb3Call.TokenParam({
|
|
62
|
+
key: "totalSupplyUSDC",
|
|
63
|
+
value: totalSupplyUSDC.toString()
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// return the augmented tokenParams
|
|
67
|
+
return augmentedTokenParams;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
pragma solidity ^0.8.0;
|
|
5
|
+
|
|
6
|
+
import {IPMPConfigureHook} from "../../interfaces/v0.8.x/IPMPConfigureHook.sol";
|
|
7
|
+
import {IWeb3Call} from "../../interfaces/v0.8.x/IWeb3Call.sol";
|
|
8
|
+
import {IPMPV0} from "../../interfaces/v0.8.x/IPMPV0.sol";
|
|
9
|
+
|
|
10
|
+
import {ERC165} from "@openzeppelin-5.0/contracts/utils/introspection/ERC165.sol";
|
|
11
|
+
import {IERC165} from "@openzeppelin-5.0/contracts/interfaces/IERC165.sol";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @title Abstract Web3Call contract
|
|
15
|
+
* @author Art Blocks Inc.
|
|
16
|
+
* @notice This abstract can be inherited by any contract that wants to implement the Web3Call interface.
|
|
17
|
+
* It indicates support for the IWeb3Call interface via ERC165 interface detection, and ensures that all
|
|
18
|
+
* child contracts implement the required IWeb3Call functions.
|
|
19
|
+
*/
|
|
20
|
+
abstract contract AbstractPMPConfigureHook is IPMPConfigureHook, ERC165 {
|
|
21
|
+
/**
|
|
22
|
+
* @notice Execution logic to be executed when a token's PMP is configured.
|
|
23
|
+
* @dev This hook is executed after the PMP is configured.
|
|
24
|
+
* @param coreContract The address of the core contract that was configured.
|
|
25
|
+
* @param tokenId The tokenId of the token that was configured.
|
|
26
|
+
* @param pmpInput The PMP input that was used to successfully configure the token.
|
|
27
|
+
*/
|
|
28
|
+
function onTokenPMPConfigure(
|
|
29
|
+
address coreContract,
|
|
30
|
+
uint256 tokenId,
|
|
31
|
+
IPMPV0.PMPInput calldata pmpInput
|
|
32
|
+
) external virtual;
|
|
33
|
+
|
|
34
|
+
function supportsInterface(
|
|
35
|
+
bytes4 interfaceId
|
|
36
|
+
) public view override(ERC165, IERC165) returns (bool) {
|
|
37
|
+
return
|
|
38
|
+
interfaceId == type(IPMPConfigureHook).interfaceId ||
|
|
39
|
+
super.supportsInterface(interfaceId);
|
|
40
|
+
}
|
|
41
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artblocks/contracts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Smart contracts used by Art Blocks",
|
|
5
5
|
"files": [
|
|
6
6
|
"/contracts/**/*.sol",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"@types/mocha": "^10.0.8",
|
|
101
101
|
"@types/prompt": "^1.1.8",
|
|
102
102
|
"@typescript-eslint/eslint-plugin": "^7.13.0",
|
|
103
|
-
"@typescript-eslint/parser": "^
|
|
103
|
+
"@typescript-eslint/parser": "^8.17.0",
|
|
104
104
|
"aws-sdk-client-mock": "^4.0.1",
|
|
105
105
|
"chai": "^4.3.10",
|
|
106
106
|
"coveralls": "^3.1.1",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"husky": "^9.0.11",
|
|
117
117
|
"istanbul-combine": "^0.3.0",
|
|
118
118
|
"keccak256": "^1.0.6",
|
|
119
|
-
"merkletreejs": "^0.
|
|
119
|
+
"merkletreejs": "^0.4.1",
|
|
120
120
|
"prettier": "^3.3.2",
|
|
121
121
|
"prettier-plugin-solidity": "^1.3.1",
|
|
122
122
|
"prompt": "^1.3.0",
|
|
@@ -137,10 +137,10 @@
|
|
|
137
137
|
"@openzeppelin-4.7/contracts": "npm:@openzeppelin/contracts@4.7.1",
|
|
138
138
|
"@openzeppelin-4.8/contracts-upgradeable": "npm:@openzeppelin/contracts-upgradeable@4.8.0",
|
|
139
139
|
"@openzeppelin-5.0/contracts": "npm:@openzeppelin/contracts@5.0.1",
|
|
140
|
-
"@urql/exchange-retry": "^1.
|
|
140
|
+
"@urql/exchange-retry": "^1.3.0",
|
|
141
141
|
"graphql": "^16.8.2",
|
|
142
142
|
"scripty.sol": "2.1.1",
|
|
143
143
|
"solady": "^0.0.181",
|
|
144
|
-
"urql": "^4.
|
|
144
|
+
"urql": "^4.2.1"
|
|
145
145
|
}
|
|
146
146
|
}
|