Skip to content

Commit

Permalink
check contract lock in transfertFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjah committed Dec 10, 2024
1 parent 5985664 commit 46df192
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion smart-contract/assembly/contracts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import {
_constructor,
_ownerOf,
} from '@massalabs/sc-standards/assembly/contracts/MRC721/enumerable/MRC721Enumerable-internals';
// eslint-disable-next-line max-len
import { transferFrom as _transferFrom } from '@massalabs/sc-standards/assembly/contracts/MRC721/enumerable/MRC721Enumerable';

import {
_setOwner,
Expand Down Expand Up @@ -451,6 +453,11 @@ export function ownerOf(binaryArgs: StaticArray<u8>): StaticArray<u8> {
return stringToBytes(owner);
}

export function transferFrom(binaryArgs: StaticArray<u8>): void {
assert(!Storage.has(buildLockedKey()), 'Contract is locked');
_transferFrom(binaryArgs);
}

export {
setOwner,
ownerAddress,
Expand All @@ -461,8 +468,8 @@ export {
setApprovalForAll,
getApproved,
approve,
transferFrom,
balanceOf,
symbol,
name,
totalSupply,
} from '@massalabs/sc-standards/assembly/contracts/MRC721/enumerable/MRC721Enumerable';

0 comments on commit 46df192

Please sign in to comment.