From b61737021ad4c487eb04a4d91f474c763fb999c2 Mon Sep 17 00:00:00 2001 From: Yash Goyal Date: Sat, 30 Nov 2024 00:25:49 +0530 Subject: [PATCH] Made Governance Token soulbound --- src/governance/GovToken.sol | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/governance/GovToken.sol b/src/governance/GovToken.sol index a86c0a1..ccabef1 100644 --- a/src/governance/GovToken.sol +++ b/src/governance/GovToken.sol @@ -1,10 +1,12 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.26; +pragma solidity ^0.8.26; import {ERC20} from "solmate/src/tokens/ERC20.sol"; import {Owned} from "solmate/src/auth/Owned.sol"; contract GovToken is ERC20, Owned { + error Not_Allowed(); + constructor( string memory name, string memory symbol @@ -17,4 +19,26 @@ contract GovToken is ERC20, Owned { function burn(address from, uint256 amount) external onlyOwner { _burn(from, amount); } + + function approve( + address spender, + uint256 amount + ) public override returns (bool) { + revert Not_Allowed(); + } + + function transferFrom( + address from, + address to, + uint256 amount + ) public override returns (bool) { + revert Not_Allowed(); + } + + function transfer( + address to, + uint256 amount + ) public override returns (bool) { + revert Not_Allowed(); + } }