CryptoFly.us | CRYPTOCURRENCY BITCOIN SHIRTS CLOTHING APPAREL HATS

CRYPTO NEWS

How to modify or cancel a pending Ethereum transaction

A stuck or pending Ethereum transaction can be canceled or modified using two methods: in-application cancellation and setting a custom nonce.

Unable to return address array in solidity

I have the following code for a simple gambling game. The code works fine except for getPlayers function pragma solidity >=0.4.22 <0.6.0; contract Lottery { address payable public manager; address payable [] public players; constructor () public { manager = msg.sender; } function enter() public payable { require(msg.value > 0.01 ether); //condition players.push(msg.sender); } function::Listen

I have the following code for a simple gambling game. The code works fine except for getPlayers function

pragma solidity >=0.4.22 <0.6.0;  contract Lottery { address payable public manager; address payable [] public players;   constructor () public {     manager = msg.sender; } function enter() public payable {      require(msg.value > 0.01 ether); //condition     players.push(msg.sender); }  function random() private view returns(uint) {     return uint(keccak256(abi.encodePacked(block.difficulty, now,  players))); }  function pickWinner() public restricted{     uint index = random() % players.length;     players[index].transfer(address(this).balance);     players = new address payable[](0); // new dynamic array  }  modifier restricted() {     require(msg.sender == manager); // security     _; }  function getPlayers() public payable returns (address[] memory) {     return players;     // Error in the above line saying     // "Return argument type address payable[] storage ref is not implicitly convertible to expected type(type of first return variable)  address[] memory."  } } 

How to modify or cancel a pending Ethereum transaction

Shopping cart
There are no products in the cart!
Continue shopping
0