Created
May 27, 2022 16:45
-
-
Save z0r0z/699c318b40f91ef348e5417da3d7b868 to your computer and use it in GitHub Desktop.
tokenizing agreement with hashes and payables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: AGPL-3.0-only | |
pragma solidity >=0.8.0; | |
import 'https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol'; | |
contract TokenWarrant is ERC1155 { | |
mapping(uint256 => string) public metas; | |
function uri(uint256 id) public override view returns (string memory) { | |
return metas[id]; | |
} | |
function createAgreement(address investor, uint256 id, string calldata agreement) external payable { | |
metas[id] = agreement; | |
_mint(investor, id, msg.value, ''); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment