Skip to content

Instantly share code, notes, and snippets.

@z0r0z
Created May 27, 2022 16:45
Show Gist options
  • Save z0r0z/699c318b40f91ef348e5417da3d7b868 to your computer and use it in GitHub Desktop.
Save z0r0z/699c318b40f91ef348e5417da3d7b868 to your computer and use it in GitHub Desktop.
tokenizing agreement with hashes and payables
// 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