VIDT Datalink
ERC20
This contract is an ERC20 token.
Name
VIDT Datalink
Symbol
VIDT
Decimals
18
Total Supply
56,197,116 VIDT
About
link
description
VIDT Datalink (VIDT) is a cryptocurrency and operates on the Ethereum platform. VIDT Datalink has a current supply of 57,386,799 with 49,428,303.18412282 in circulation. The last known price of VIDT Datalink is 0.36423634 USD and is down -8.01 over the last 24 hours. It is currently trading on 14 active market(s) with $3,138,056.61 traded over the last 24 hours. More information can be found at https://www.vidt-datalink.com.
Stats
Public Functions
51
Event Types
10
Code Size
19,974 bytes
Library Use
Uses SafeMath for uint256.
Uses SafeERC20 for ERC20.
Events (10) keyboard_arrow_up
Constants (1) keyboard_arrow_up
State Variables (25) keyboard_arrow_up
Functions
owner keyboard_arrow_up
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
pause keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
whenNotPaused checks for the following:
Source Code
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
unpause keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
whenPaused checks for the following:
paused must be true
Source Code
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
getOwner keyboard_arrow_up
decimals keyboard_arrow_up
symbol keyboard_arrow_up
name keyboard_arrow_up
nameChange keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function nameChange(string memory newName) public onlyOwner {
_name = newName;
}
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
One or more of the following:
-
recipient
must be equal to
the result of calling owner
- ORfrozenAccounts for the sender's address must not be true
Source Code
function transfer(address recipient, uint256 amount)
external
override
whenNotPaused
returns (bool)
{
require(
!frozenAccounts[msg.sender] || recipient == owner(),
"T1 - The wallet of sender is frozen"
);
require(!frozenAccounts[recipient], "T2 - The wallet of recipient is frozen");
_transfer(_msgSender(), recipient, amount);
return true;
}
transferToken keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function transferToken(address tokenAddress, uint256 tokens)
external
onlyOwner
{
ERC20(tokenAddress).transfer(owner(), tokens);
}
allowance keyboard_arrow_up
approve keyboard_arrow_up
Requirements help
One or more of the following:
Source Code
function approve(address spender, uint256 amount)
external
override
whenNotPaused
returns (bool)
{
require(
(amount == 0) || (_allowances[msg.sender][spender] == 0),
"A1- Reset allowance to 0 first"
);
_approve(_msgSender(), spender, amount);
return true;
}
transferFrom keyboard_arrow_up
Requirements help
One or more of the following:
-
recipient
must be equal to
the result of calling owner
- ORfrozenAccounts for recipient must not be true
Source Code
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override whenNotPaused returns (bool) {
require(!frozenAccounts[sender], "TF1 - The wallet of sender is frozen");
require(
!frozenAccounts[recipient] || recipient == owner(),
"TF2 - The wallet of recipient is frozen"
);
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"TF1 - Transfer amount exceeds allowance"
)
);
return true;
}
increaseAllowance keyboard_arrow_up
Requirements help
Source Code
function increaseAllowance(address spender, uint256 addedValue)
public
whenNotPaused
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].add(addedValue)
);
return true;
}
increaseApproval keyboard_arrow_up
Requirements help
Source Code
function increaseApproval(address spender, uint256 addedValue)
public
override
whenNotPaused
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].add(addedValue)
);
return true;
}
decreaseAllowance keyboard_arrow_up
Requirements help
Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
public
whenNotPaused
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(
subtractedValue,
"DA1 - Decreased allowance below zero"
)
);
return true;
}
decreaseApproval keyboard_arrow_up
Requirements help
Source Code
function decreaseApproval(address spender, uint256 subtractedValue)
public
override
whenNotPaused
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].sub(
subtractedValue,
"DA1 - Decreased allowance below zero"
)
);
return true;
}
burn keyboard_arrow_up
freeze keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function freeze(address _address, bool _state) public onlyOwner returns (bool) {
frozenAccounts[_address] = _state;
emit Freeze(_address, _state);
return true;
}
burnFrom keyboard_arrow_up
Requirements help
Source Code
function burnFrom(address account, uint256 amount) public {
uint256 decreasedAllowance = _allowances[account][_msgSender()].sub(
amount,
"BF1 - Burn amount exceeds allowance"
);
_approve(account, _msgSender(), decreasedAllowance);
_burn(account, amount);
}
transferByOwner keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function transferByOwner(address _to, uint256 _value)
public
onlyOwner
returns (bool success)
{
_balances[msg.sender] = _balances[msg.sender].sub(_value);
_balances[_to] = _balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
batchTransferByOwner keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Requirements help
Source Code
function batchTransferByOwner(
address[] memory _addresses,
uint256[] memory _amounts
) public onlyOwner returns (bool success) {
require(
_addresses.length == _amounts.length,
"BT1 - Addresses length must be equal to amounts length"
);
uint256 i = 0;
for (i = 0; i < _addresses.length; i++) {
_balances[msg.sender] = _balances[msg.sender].sub(_amounts[i]);
_balances[_addresses[i]] = _balances[_addresses[i]].add(_amounts[i]);
emit Transfer(msg.sender, _addresses[i], _amounts[i]);
}
return true;
}
validatePublisher keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function validatePublisher(
address Address,
bool State,
string memory Publisher
) public onlyOwner returns (bool) {
verifiedPublishers[Address] = State;
emit ValidatePublisher(Address, State, Publisher);
return true;
}
validateWallet keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function validateWallet(
address Address,
bool State,
string memory Wallet
) public onlyOwner returns (bool) {
verifiedWallets[Address] = State;
emit ValidateWallet(Address, State, Wallet);
return true;
}
validateFile keyboard_arrow_up
Parameters help
Requirements help
One or more of the following:
-
_validationFee
must be less than or equal to
msg.value
- OR
Payment
must be greater than or equal to
_validationPrice
Source Code
function validateFile(
address To,
uint256 Payment,
bytes calldata Data,
bool cStore,
bool eLog,
bool NFT
) external payable returns (bool) {
require(
Payment >= _validationPrice || msg.value >= _validationFee,
"V1 - Insufficient payment provided"
);
require(verifiedPublishers[msg.sender], "V2 - Unverified publisher address");
require(Data.length == 64, "V3 - Invalid hash provided");
if (!verifiedWallets[To]) {
To = _validationWallet;
}
uint256 index = 0;
string memory fileHash = string(Data);
if (cStore) {
if (fileIndex.length > 0) {
require(
fileHashes[fileHash].index == 0,
"V4 - This hash was previously validated"
);
}
fileIndex.push(fileHash);
fileHashes[fileHash].index = fileIndex.length - 1;
index = fileHashes[fileHash].index;
}
bool nft_created = false;
uint256 nftID = 0;
if (NFT) {
bytes memory nft_data = "";
require(fileHashes[fileHash].nft == 0, "V5 - NFT exists already");
(nft_created, nft_data) = _nftContract.delegatecall(
abi.encodeWithSignature("createNFT(bytes)", Data)
);
require(nft_created, "V6 - NFT contract call failed");
nftID = uint256(bytesToBytes32(nft_data, 0));
verifiedNFTs[nftID] = fileHash;
fileHashes[fileHash].nft = nftID;
}
if (_allowances[To][msg.sender] >= Payment) {
_allowances[To][msg.sender] = _allowances[To][msg.sender].sub(Payment);
} else {
_balances[msg.sender] = _balances[msg.sender].sub(Payment);
_balances[To] = _balances[To].add(Payment);
}
if (eLog) {
emit ValidateFile(index, fileHash, nftID);
}
emit Transfer(msg.sender, To, Payment);
return true;
}
memoryValidateFile keyboard_arrow_up
Requirements help
One or more of the following:
-
_validationFee
must be less than or equal to
msg.value
- OR
Payment
must be greater than or equal to
_validationPrice
Source Code
function memoryValidateFile(uint256 Payment, bytes calldata Data)
external
payable
whenNotPaused
returns (bool)
{
require(
Payment >= _validationPrice || msg.value >= _validationFee,
"V1 - Insufficient payment provided"
);
require(verifiedPublishers[msg.sender], "V2 - Unverified publisher address");
require(Data.length == 64, "V3 - Invalid hash provided");
uint256 index = 0;
string memory fileHash = string(Data);
if (fileIndex.length > 0) {
require(
fileHashes[fileHash].index == 0,
"V4 - This hash was previously validated"
);
}
fileIndex.push(fileHash);
fileHashes[fileHash].index = fileIndex.length - 1;
index = fileHashes[fileHash].index;
_balances[msg.sender] = _balances[msg.sender].sub(Payment);
_balances[_validationWallet] = _balances[_validationWallet].add(Payment);
emit Transfer(msg.sender, _validationWallet, Payment);
return true;
}
validateNFT keyboard_arrow_up
Requirements help
One or more of the following:
-
_validationFee
must be less than or equal to
msg.value
- OR
Payment
must be greater than or equal to
_validationPrice
One or more of the following:
-publicNFT must be true
nft_created must be true
Source Code
function validateNFT(
uint256 Payment,
bytes calldata Data,
bool divisable
) external payable whenNotPaused returns (bool) {
require(
Payment >= _validationPrice || msg.value >= _validationFee,
"V1 - Insufficient payment provided"
);
require(
publicNFT || verifiedPublishers[msg.sender],
"V2 - Unverified publisher address"
);
require(Data.length == 64, "V3 - Invalid hash provided");
uint256 index = 0;
string memory fileHash = string(Data);
bool nft_created = false;
uint256 nftID = 0;
bytes memory nft_data = "";
require(fileHashes[fileHash].nft == 0, "V5 - NFT exists already");
if (divisable) {
(nft_created, nft_data) = _nftdContract.delegatecall(
abi.encodeWithSignature("createNFT(bytes)", Data)
);
} else {
(nft_created, nft_data) = _nftContract.delegatecall(
abi.encodeWithSignature("createNFT(bytes)", Data)
);
}
require(nft_created, "V6 - NFT contract call failed");
nftID = uint256(bytesToBytes32(nft_data, 0));
verifiedNFTs[nftID] = fileHash;
fileHashes[fileHash].nft = nftID;
_balances[msg.sender] = _balances[msg.sender].sub(Payment);
_balances[_validationWallet] = _balances[_validationWallet].add(Payment);
emit Transfer(msg.sender, _validationWallet, Payment);
emit ValidateFile(index, fileHash, nftID);
return true;
}
simpleValidateFile keyboard_arrow_up
Requirements help
One or more of the following:
-
_validationFee
must be less than or equal to
msg.value
- OR
Payment
must be greater than or equal to
_validationPrice
Source Code
function simpleValidateFile(uint256 Payment)
external
payable
whenNotPaused
returns (bool)
{
require(
Payment >= _validationPrice || msg.value >= _validationFee,
"V1 - Insufficient payment provided"
);
require(verifiedPublishers[msg.sender], "V2 - Unverified publisher address");
_balances[msg.sender] = _balances[msg.sender].sub(Payment);
_balances[_validationWallet] = _balances[_validationWallet].add(Payment);
emit Transfer(msg.sender, _validationWallet, Payment);
return true;
}
covertValidateFile keyboard_arrow_up
Requirements help
One or more of the following:
-
_validationFee
must be less than or equal to
msg.value
- OR
Payment
must be greater than or equal to
_validationPrice
Source Code
function covertValidateFile(uint256 Payment)
external
payable
whenNotPaused
returns (bool)
{
require(
Payment >= _validationPrice || msg.value >= _validationFee,
"V1 - Insufficient payment provided"
);
require(verifiedPublishers[msg.sender], "V2 - Unverified publisher address");
_balances[msg.sender] = _balances[msg.sender].sub(Payment);
_balances[_validationWallet] = _balances[_validationWallet].add(Payment);
return true;
}
verifyFile keyboard_arrow_up
Source Code
function verifyFile(string memory fileHash)
public
view
returns (bool verified)
{
verified = true;
if (fileIndex.length == 0) {
verified = false;
}
bytes memory a = bytes(fileIndex[fileHashes[fileHash].index]);
bytes memory b = bytes(fileHash);
if (a.length != b.length) {
verified = false;
}
if (verified) {
for (uint256 i = 0; i < a.length; i++) {
if (a[i] != b[i]) {
verified = false;
}
}
}
if (!verified) {
bool heritage_call = false;
bytes memory heritage_data = "";
(heritage_call, heritage_data) = oldContract.staticcall(
abi.encodeWithSignature("verifyFile(string)", fileHash)
);
require(heritage_call, "V0 - Old contract call failed");
assembly {
verified := mload(add(heritage_data, 32))
}
}
}
verifyPublisher keyboard_arrow_up
verifyWallet keyboard_arrow_up
frozenAccount keyboard_arrow_up
verify keyboard_arrow_up
Source Code
function verify(string memory fileHash) public view returns (bool) {
if (fileIndex.length == 0) {
return false;
}
bytes memory a = bytes(fileIndex[fileHashes[fileHash].index]);
bytes memory b = bytes(fileHash);
if (a.length != b.length) {
return false;
}
for (uint256 i = 0; i < a.length; i++) {
if (a[i] != b[i]) {
return false;
}
}
return true;
}
verifyFileNFT keyboard_arrow_up
Source Code
function verifyFileNFT(string memory fileHash) public view returns (uint256) {
if (fileIndex.length == 0) {
return 0;
}
bytes memory a = bytes(fileIndex[fileHashes[fileHash].index]);
bytes memory b = bytes(fileHash);
if (a.length != b.length) {
return 0;
}
for (uint256 i = 0; i < a.length; i++) {
if (a[i] != b[i]) {
return 0;
}
}
return fileHashes[fileHash].nft;
}
verifyNFT keyboard_arrow_up
setPrice keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function setPrice(uint256 newPrice) public onlyOwner {
_validationPrice = newPrice;
}
setFee keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function setFee(uint256 newFee) public onlyOwner {
_validationFee = newFee;
}
setWallet keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function setWallet(address newWallet) public onlyOwner {
_validationWallet = newWallet;
}
setContracts keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function setContracts(address nftContract, address nftdContract)
public
onlyOwner
{
_nftContract = nftContract;
_nftdContract = nftdContract;
}
setPublic keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function setPublic(bool _public) public onlyOwner {
publicNFT = _public;
}
listFiles keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Requirements help
Source Code
function listFiles(uint256 startAt, uint256 stopAt)
public
onlyOwner
returns (bool)
{
if (fileIndex.length == 0) {
return false;
}
require(startAt <= fileIndex.length - 1, "L1 - Please select a valid start");
if (stopAt > 0) {
require(
stopAt > startAt && stopAt <= fileIndex.length - 1,
"L2 - Please select a valid stop"
);
} else {
stopAt = fileIndex.length - 1;
}
for (uint256 i = startAt; i <= stopAt; i++) {
emit ListFile(i, fileIndex[i], fileHashes[fileIndex[i]].nft);
}
return true;
}
withdraw keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
mainWallet
must be equal to
the result of calling _msgSender
- OR
_owner
must be equal to
the result of calling _msgSender
Source Code
function withdraw(address payable _ownerAddress) external onlyOwner {
_ownerAddress.transfer(address(this).balance);
}
validationPrice keyboard_arrow_up
validationFee keyboard_arrow_up
validationWallet keyboard_arrow_up
nftContract keyboard_arrow_up
Internal Functions
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.
internal VIDT._transfer keyboard_arrow_up
Requirements help
Source Code
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(sender != address(0), "T1 - Transfer from the zero address");
require(
recipient != address(0) || frozenAccounts[sender],
"T3 - Transfer to the zero address"
);
_balances[sender] = _balances[sender].sub(
amount,
"T4 - Transfer amount exceeds balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
internal VIDT._burn keyboard_arrow_up
Requirements help
Source Code
function _burn(address account, uint256 amount) internal {
require(account != address(0), "B1 - Burn from the zero address");
_balances[account] = _balances[account].sub(
amount,
"B2 - Burn amount exceeds balance"
);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
internal VIDT._approve keyboard_arrow_up
Requirements help
Source Code
function _approve(
address owner,
address spender,
uint256 amount
) internal {
require(owner != address(0), "A1 - Approve from the zero address");
require(spender != address(0), "A2 - Approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
internal VIDT.bytesToBytes32 keyboard_arrow_up
Source Code
function bytesToBytes32(bytes memory b, uint256 offset)
private
pure
returns (bytes32)
{
bytes32 out;
for (uint256 i = 0; i < 32; i++) {
out |= bytes32(b[offset + i] & 0xFF) >> (i * 8);
}
return out;
}
internal Ownable.constructor keyboard_arrow_up
internal Ownable._transferOwnership keyboard_arrow_up
Source Code
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}