Is it necessary to send a share of the newly created token to contract address? - solidity

am new to token creation.
I have successfully created my token on bscmainet and claimed all the coins, now I have them in my Metamask wallet.
A lot of tutorials recommend sending part of the supply to the contract address of the token itself. Is this a necessary step?
From what I understood, I will need to provide liquidity on DEX out of my own wallet not from the contract address so what's the point in sending a share to contract address?
Thank you

Sending tokens to the token contract is useful if there's a direct way to buy the tokens through your contract. Example:
function buy() external payable {
uint256 amount = calculateAmount(msg.value);
// send tokens from this contract address to the user
transfer(msg.sender, amount);
}
But if there's no way to retrieve the tokens sent to the contract address (e.g. you're planning to sell them only through exchanges), there's no point of sending them to the contract address.

Related

Is it possible to transfer money without Internal TXNs?

Exactly what I want is this:
I'm transferring money to a contract. The money coming into this contract will be forwarded to the destination address without creating any TXN (that is, anonymously).
I created a contract and the money sent to this contract is sent to the target wallet. In this way, information does not appear in Transaction transactions of the target wallet.
the code i use
receive() external payable {
payable(0x8162Ac860EF729d60C0f3683bfaA0334A3499956).send(msg.value);
}
As pictured (see Transactions)
https://i.stack.imgur.com/OPxH5.png
So far everything is ok. But there is one problem. Transaction appears in Internal TXNs. I want to hide this.
https://i.stack.imgur.com/39nCh.png
What should happen: Money will be transferred to the contract and it will transfer money anonymously without generating any TX belonging to the target wallet.
REQUIRE --->> When the money sent to the contract is sent to the counter wallet, no information will appear in the Transactions and Internal TXNs tab of the counter wallet.
Is it possible to do this? Please tell me what should I do if
possible.
No, this is not possible. Any transfer of a native chain token (BNB in your case of Binance Smart Chain) will appear on an explorer like Etherscan (Bscscan) as an "internal transaction".

How to sign a message from Gnosis multisig smart contract wallet?

I need to generate a signature from a Gnosis multisig wallet. While using the existing signMessage method in Gnosis smart contract, i am not able to retrieve the signature from the transaction receipt logs. I see that signMessage emits an event, but unable to find this in receipt logs.
How can I sign a message and get the hash with multisig wallets? So, that when i decode the signature, i need the signer address to be multisig wallet address.

what can you do with the gas that is sent to a fall back function

am am learning about transfer and send in solidity, and the fallback function. To my understanding, when you send ether to a smart contract, you also send some gas to the fallback function as well. Why is this mechanism in place? I thought gas was used to pay validators, how come there is gas now stored in the contract + what is this gas in the contract used for now? Thanks
Each operation costs some predefined amount of gas. The combined amount - no matter how many internal transactions are performed within the main transaction - is always paid by the main transaction sender.
The transfer() function (in the current Solidity version 0.8) allows the called address to spend only 2300 gas, preventing the reentrancy attack.
This amount is enough to emit an event but it's not sufficient to perform another call - for example back to the caller contract, that would allow for the reentrancy attack.
So to answer your original question:
what can you do with the gas that is sent to a fall back function
From the called contract perspective: You can only spend it to perform few basic operations such as to emit an event. But you cannot sell it back to ETH and store it in the called contract, nor call another contract (including the sender).
contract Called {
event Received(uint256 amount);
fallback() external payable {
// ok
emit Received(msg.value);
// fail - costs more than the 2300 limit
msg.sender.call("");
}
}

Asking about self-destruct in solidity

i have the code in solidity, i'm wondering something: I deploy code for the 0x583... first, i send 1 eth to another account. Before i click withdrawAllMoney, i click destroySmartContract, 1 eth 's automatically send to receiver (this is okie!). But after that, i keep going send the 1 eth from 0x583.. to another account, it still take out eth from 0x583.. but the orther can't receive it.
I'm wondering: when i call the selfdistruct, is the contract real deleted (can't send or recieved...)
Thank you!
when i call the selfdistruct, is the contract real deleted (can't send or recieved...)
selfdestruct() effectively removes the deployed bytecode from the contract address.
In the next block, this (former contract) address will act as a regular address without a smart contract, so it is able to receive tokens and ETH.
But, since it doesn't hold any bytecode anymore, you won't be able to interact with the contract (it's not there anymore).

What it is the VRF coordinator contract on Chainlink?

Im learning Chainlink with solidity but i cant find information about what it is the coordinator contract that is needed to create an instance of VRFConsumerBase
The Chainlink VRF Coordinator is a contract that is deployed to a blockchain that will check the randomness of each random number returned from a random node.
You can find the addresses of these contracts on each chain in the Chainlink documentation under "Contract Addresses"