Skip to content

Commit

Permalink
updated reference to set token URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHomanics committed Jan 18, 2024
1 parent 498917a commit 734f9cc
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 11 deletions.
5 changes: 2 additions & 3 deletions packages/foundry/contracts/RepTokensInstance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import {ReputationTokensStandalone} from "@atxdao/contracts/reputation/Reputatio
contract RepTokensInstance is ReputationTokensStandalone {
constructor(
address ownerNominee,
address[] memory admins,
string memory baseURI
) ReputationTokensStandalone(ownerNominee, admins, baseURI) {}
address[] memory admins
) ReputationTokensStandalone(ownerNominee, admins) {}

function imatest() external pure returns (uint256) {
return 5;
Expand Down
15 changes: 14 additions & 1 deletion packages/foundry/script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract DeployScript is ScaffoldETHDeploy {
error InvalidPrivateKey(string);

uint256 maxMintAmount = 100;
string baseURI =
string BASE_URI =
"ipfs://bafybeiaz55w6kf7ar2g5vzikfbft2qoexknstfouu524l7q3mliutns2u4/";

function run() external {
Expand Down Expand Up @@ -44,6 +44,11 @@ contract DeployScript is ScaffoldETHDeploy {
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
);

instance.grantRole(
instance.TOKEN_URI_SETTER_ROLE(),
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
);

instance.grantRole(
instance.MINTER_ROLE(),
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
Expand All @@ -64,6 +69,11 @@ contract DeployScript is ScaffoldETHDeploy {
0x62286D694F89a1B12c0214bfcD567bb6c2951491
);

instance.grantRole(
instance.TOKEN_URI_SETTER_ROLE(),
0x62286D694F89a1B12c0214bfcD567bb6c2951491
);

instance.grantRole(
instance.MINTER_ROLE(),
0x62286D694F89a1B12c0214bfcD567bb6c2951491
Expand All @@ -74,6 +84,9 @@ contract DeployScript is ScaffoldETHDeploy {
0x62286D694F89a1B12c0214bfcD567bb6c2951491
);

instance.setTokenURI(0, string.concat(BASE_URI, "0"));
instance.setTokenURI(1, string.concat(BASE_URI, "1"));

TokensPropertiesStorage.TokenProperties
memory tokenProperties = TokensPropertiesStorage.TokenProperties(
true,
Expand Down
40 changes: 33 additions & 7 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";
const deployedContracts = {
31337: {
ReputationTokensStandalone: {
address: "0x70e0bA845a1A0F2DA3359C97E0285013525FFC49",
address: "0x21dF544947ba3E8b3c32561399E88B52Dc8b2823",
abi: [
{
type: "constructor",
Expand All @@ -22,11 +22,6 @@ const deployedContracts = {
type: "address[]",
internalType: "address[]",
},
{
name: "baseUri",
type: "string",
internalType: "string",
},
],
stateMutability: "nonpayable",
},
Expand Down Expand Up @@ -108,6 +103,19 @@ const deployedContracts = {
],
stateMutability: "view",
},
{
type: "function",
name: "TOKEN_URI_SETTER_ROLE",
inputs: [],
outputs: [
{
name: "",
type: "bytes32",
internalType: "bytes32",
},
],
stateMutability: "view",
},
{
type: "function",
name: "acceptOwnership",
Expand Down Expand Up @@ -812,6 +820,24 @@ const deployedContracts = {
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setTokenURI",
inputs: [
{
name: "tokenId",
type: "uint256",
internalType: "uint256",
},
{
name: "tokenURI",
type: "string",
internalType: "string",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "supportsInterface",
Expand Down Expand Up @@ -1490,7 +1516,7 @@ const deployedContracts = {
],
},
Hats: {
address: "0xb7278A61aa25c888815aFC32Ad3cC52fF24fE575",
address: "0x46b142DD1E924FAb83eCc3c08e4D46E82f005e0E",
abi: [
{
type: "constructor",
Expand Down

0 comments on commit 734f9cc

Please sign in to comment.