Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 10 additions & 3 deletions pkgs/contract/contracts/thankstoken/IThanksToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,22 @@ interface IThanksToken is IERC20 {
* @param relatedRoles Array of roles related to the sender
* @return success Whether the operation was successful
*/
function mint(address to, uint256 amount, RelatedRole[] memory relatedRoles) external returns (bool);
function mint(
address to,
uint256 amount,
RelatedRole[] memory relatedRoles
) external returns (bool);

/**
* @notice Calculates the total amount that can be minted by an address
* @param owner The address to check mintable amount for
* @param relatedRoles Array of roles related to the owner
* @return amount The mintable amount
*/
function mintableAmount(address owner, RelatedRole[] memory relatedRoles) external view returns (uint256);
function mintableAmount(
address owner,
RelatedRole[] memory relatedRoles
) external view returns (uint256);

/**
* @notice Returns the total amount an address has minted
Expand Down Expand Up @@ -61,5 +68,5 @@ interface IThanksToken is IERC20 {
* @param to The recipient of the minted tokens
* @param amount The amount of tokens minted
*/
event TokensMinted(address indexed to, uint256 amount);
event TokenMinted(address indexed from, address indexed to, uint256 amount);
}
17 changes: 13 additions & 4 deletions pkgs/contract/contracts/thankstoken/ThanksToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ contract ThanksToken is Clone, ERC20("", ""), IThanksToken {
return IHatsFractionTokenModule(_getArgAddress(140)); // 12 + 128
}

function HATS_TIME_FRAME_MODULE() public pure returns (IHatsTimeFrameModule) {
function HATS_TIME_FRAME_MODULE()
public
pure
returns (IHatsTimeFrameModule)
{
return IHatsTimeFrameModule(_getArgAddress(172)); // 12 + 160
}

Expand All @@ -61,7 +65,9 @@ contract ThanksToken is Clone, ERC20("", ""), IThanksToken {
}

// Helper function to read dynamic strings from clone args
function _getArgString(uint256 argIndex) internal pure returns (string memory) {
function _getArgString(
uint256 argIndex
) internal pure returns (string memory) {
// Calculate offset to the string offset pointer
// Name is at offset 32 (after workspaceOwner), Symbol at offset 64
uint256 stringPointerOffset = 32 + (argIndex * 32);
Expand Down Expand Up @@ -93,7 +99,10 @@ contract ThanksToken is Clone, ERC20("", ""), IThanksToken {

// Owner modifier
modifier onlyOwner() {
require(msg.sender == WORKSPACE_OWNER(), "Ownable: caller is not the owner");
require(
msg.sender == WORKSPACE_OWNER(),
"Ownable: caller is not the owner"
);
_;
}

Expand Down Expand Up @@ -124,7 +133,7 @@ contract ThanksToken is Clone, ERC20("", ""), IThanksToken {
_isParticipant[to] = true;
}

emit TokensMinted(to, amount);
emit TokenMinted(msg.sender, to, amount);

return true;
}
Expand Down
95 changes: 86 additions & 9 deletions pkgs/subgraph/abis/BigBang.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,30 @@
"name": "hatterHatId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "memberHatId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "operatorHatId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "creatorHatId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "minterHatId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
Expand All @@ -118,11 +142,23 @@
"name": "hatsHatCreatorModule",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "hatsFractionTokenModule",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "splitCreator",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "thanksToken",
"type": "address"
}
],
"name": "Executed",
Expand Down Expand Up @@ -175,10 +211,10 @@
},
{
"inputs": [],
"name": "FractionToken",
"name": "Hats",
"outputs": [
{
"internalType": "address",
"internalType": "contract IHats",
"name": "",
"type": "address"
}
Expand All @@ -188,10 +224,10 @@
},
{
"inputs": [],
"name": "Hats",
"name": "HatsFractionTokenModule_IMPL",
"outputs": [
{
"internalType": "contract IHats",
"internalType": "address",
"name": "",
"type": "address"
}
Expand Down Expand Up @@ -264,6 +300,19 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ThanksTokenFactory",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "UPGRADE_INTERFACE_VERSION",
Expand Down Expand Up @@ -303,6 +352,16 @@
"internalType": "string",
"name": "_hatterHatImageURI",
"type": "string"
},
{
"internalType": "string",
"name": "_memberHatDetails",
"type": "string"
},
{
"internalType": "string",
"name": "_memberHatImageURI",
"type": "string"
}
],
"name": "bigbang",
Expand Down Expand Up @@ -343,6 +402,11 @@
"name": "_hatsHatCreatorModule_IMPL",
"type": "address"
},
{
"internalType": "address",
"name": "_hatsFractionTokenModule_IMPL",
"type": "address"
},
{
"internalType": "address",
"name": "_splitsCreatorFactory",
Expand All @@ -355,7 +419,7 @@
},
{
"internalType": "address",
"name": "_fractionToken",
"name": "_thanksTokenFactory",
"type": "address"
}
],
Expand Down Expand Up @@ -401,11 +465,11 @@
"inputs": [
{
"internalType": "address",
"name": "_fractionToken",
"name": "_hats",
"type": "address"
}
],
"name": "setFractionToken",
"name": "setHats",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
Expand All @@ -414,11 +478,11 @@
"inputs": [
{
"internalType": "address",
"name": "_hats",
"name": "_hatsFractionTokenModuleImpl",
"type": "address"
}
],
"name": "setHats",
"name": "setHatsFractionTokenModuleImpl",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
Expand Down Expand Up @@ -488,6 +552,19 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_thanksTokenFactory",
"type": "address"
}
],
"name": "setThanksTokenFactory",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down
Loading
Loading