Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfoobar authored Aug 25, 2024
2 parents 92e4ebf + ce89e65 commit 900c85e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
16 changes: 13 additions & 3 deletions Makefile

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
|Fantom|[0x00000000000000447e69651d841bd8d104bed493](https://ftmscan.com/address/0x00000000000000447e69651d841bd8d104bed493)|
|Arbitrum|[0x00000000000000447e69651d841bd8d104bed493](https://arbiscan.io/address/0x00000000000000447e69651d841bd8d104bed493)|
|Arbitrum (Nova)|[0x00000000000000447e69651d841bd8d104bed493](https://nova.arbiscan.io/address/0x00000000000000447e69651d841bd8d104bed493)|
|Ronin|[0x00000000000000447e69651d841bd8d104bed493](https://app.roninchain.com/address/0x00000000000000447e69651d841bd8d104bed493)|

|Testnet Chain|Address|
|---|---|
|Ethereum (Goerli)|[0x00000000000000447e69651d841bd8d104bed493](https://goerli.etherscan.io/address/0x00000000000000447e69651d841bd8d104bed493)|
|Arbitrum (Sepolia)|[0x00000000000000447e69651d841bd8d104bed493](https://sepolia-explorer.arbitrum.io/address/0x00000000000000447e69651d841bD8D104Bed493)|
|Ethereum (Sepolia)|[0x00000000000000447e69651d841bd8d104bed493](https://sepolia.etherscan.io/address/0x00000000000000447e69651d841bd8d104bed493)|
|Ethereum (Holesky)|[0x00000000000000447e69651d841bd8d104bed493](https://holesky.etherscan.io/address/0x00000000000000447e69651d841bd8d104bed493)|
|Ronin (Saigon)|[0x00000000000000447e69651d841bd8d104bed493](https://saigon-app.roninchain.com/address/0x00000000000000447e69651d841bd8d104bed493)|


If you'd like to get the DelegateRegistry on another EVM chain, anyone in the community can deploy to the same address! Simply run the script in [Deploy.s.sol](script/Deploy.s.sol) with the specified salt. The CREATE2 factory must be deployed at `0x0000000000FFe8B47B3e2130213B802212439497`, but this factory exists on 19 separate chains so shouldn't be an issue. If you've run a community deployment, open a PR adding the link to the above table.
Expand Down Expand Up @@ -89,6 +93,8 @@ function getDelegatesForToken(address vault, address contract_, uint256 tokenId)
function checkDelegateForAll(address delegate, address vault) external view returns (bool);
function checkDelegateForContract(address delegate, address vault, address contract_) external view returns (bool);
function checkDelegateForERC721(address delegate, address vault, address contract_, uint256 tokenId) external view returns (bool);
function checkDelegateForERC20(address to, address from, address contract_, bytes32 rights) external view returns (uint256);
function checkDelegateForERC1155(address to, address from, address contract_, uint256 tokenId, bytes32 rights) external view returns (uint256);
```

As an NFT creator, the important ones to pay attention to are `getDelegationsByDelegate()`, which you can use on the website frontend to enumerate which vaults a specific hotwallet is delegated to act on behalf of, and `checkDelegateForERC721()`, which can be called in your smart contract to ensure a hotwallet is acting on behalf of the proper vaults.
5 changes: 5 additions & 0 deletions funding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"opRetro": {
"projectId": "0xeb3b33f6fac2c3a5da6a6c81cfafd2574da9a61b891ced67c513cf23a33bd06e"
}
}
1 change: 0 additions & 1 deletion src/DelegateRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ contract DelegateRegistry is IDelegateRegistry {
/**
* ----------- EXTERNAL STORAGE ACCESS -----------
*/

function readSlot(bytes32 location) external view returns (bytes32 contents) {
assembly {
contents := sload(location)
Expand Down
1 change: 0 additions & 1 deletion src/examples/IPLicenseCheck.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {IDelegateRegistry} from "src/IDelegateRegistry.sol";
* @notice A contract for checking whether a wallet has been granted IP licenses for an NFT. It supports both NFT vault -> IP license and NFT vault -> IP
* licensor -> IP license workflows.
*/

contract IPLicenseCheck {
IDelegateRegistry public immutable delegateRegistry;

Expand Down
7 changes: 0 additions & 7 deletions test/RegistryUnitTests.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ contract RegistryUnitTests is Test {
/**
* ----------- multicall -----------
*/

function testMulticall(
address vault,
address delegate,
Expand Down Expand Up @@ -158,7 +157,6 @@ contract RegistryUnitTests is Test {
/**
* ----------- delegate methods -----------
*/

event DelegateAll(address indexed vault, address indexed delegate, bytes32 rights, bool enable);

function testDelegateAll(address vault, address delegate, bytes32 rights, bool enable, uint256 n) public {
Expand Down Expand Up @@ -371,7 +369,6 @@ contract RegistryUnitTests is Test {
/**
* ----------- consumables -----------
*/

function testCheckDelegateForAll(address vault, bytes32 rights, bool enable, address delegate, address contract_, uint256 tokenId, uint256 amount, bytes32 fRights) public {
vm.assume(vault > address(1));
// new registry
Expand Down Expand Up @@ -645,7 +642,6 @@ contract RegistryUnitTests is Test {
/**
* ----------- TODO: Enumerations -----------
*/

function testGetValidDelegationsFromHashesEquivalence(address from, bytes32 rights, address to, uint256 amount, uint256 tokenId, address contract_, bool[5] calldata enables)
public
{
Expand Down Expand Up @@ -735,7 +731,6 @@ contract RegistryUnitTests is Test {
/**
* ----------- storage access -----------
*/

function testReadSlot(bytes32 slot, bytes32 data) public {
registry = new Registry();
vm.store(address(registry), slot, data);
Expand All @@ -759,7 +754,6 @@ contract RegistryUnitTests is Test {
/**
* ----------- ERC165 -----------
*/

function testSupportsInterface(bytes32 notInterface) public {
bytes4 formattedNotInterface = bytes4(notInterface);
vm.assume(formattedNotInterface != type(IRegistry).interfaceId);
Expand All @@ -772,7 +766,6 @@ contract RegistryUnitTests is Test {
/**
* ----------- Internal helper functions -----------
*/

function testPushDelegationHashes(uint256 seed, uint256 n) public {
vm.assume(n < 100);
address[] memory fromAddresses = new address[](n);
Expand Down

0 comments on commit 900c85e

Please sign in to comment.