-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/lukso-network/lsp-smart-…
…contracts into foundry-optimisation
- Loading branch information
Showing
117 changed files
with
3,352 additions
and
531 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
47 changes: 47 additions & 0 deletions
47
contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.4; | ||
|
||
// modules | ||
import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol"; | ||
|
||
// constants | ||
import { | ||
_LSP4_TOKEN_NAME_KEY, | ||
_LSP4_TOKEN_SYMBOL_KEY, | ||
_LSP4_TOKEN_TYPE_KEY | ||
} from "./LSP4Constants.sol"; | ||
|
||
// errors | ||
import { | ||
LSP4TokenNameNotEditable, | ||
LSP4TokenSymbolNotEditable, | ||
LSP4TokenTypeNotEditable | ||
} from "./LSP4Errors.sol"; | ||
|
||
/** | ||
* @title Implementation of a LSP4DigitalAssetMetadata contract that stores the **Token-Metadata** (`LSP4TokenName` and `LSP4TokenSymbol`) in its ERC725Y data store. | ||
* @author Matthew Stevens | ||
* @dev Standard Implementation of the LSP4 standard. | ||
*/ | ||
abstract contract LSP4DigitalAssetMetadataCore is ERC725YCore { | ||
/** | ||
* @dev The ERC725Y data keys `LSP4TokenName` and `LSP4TokenSymbol` cannot be changed | ||
* via this function once the digital asset contract has been deployed. | ||
*/ | ||
function _setData( | ||
bytes32 dataKey, | ||
bytes memory dataValue | ||
) internal virtual override { | ||
if (dataKey == _LSP4_TOKEN_NAME_KEY) { | ||
revert LSP4TokenNameNotEditable(); | ||
} else if (dataKey == _LSP4_TOKEN_SYMBOL_KEY) { | ||
revert LSP4TokenSymbolNotEditable(); | ||
} else if (dataKey == _LSP4_TOKEN_TYPE_KEY) { | ||
revert LSP4TokenTypeNotEditable(); | ||
} else { | ||
_store[dataKey] = dataValue; | ||
|
||
emit DataChanged(dataKey, dataValue); | ||
} | ||
} | ||
} |
This file contains 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
Oops, something went wrong.