Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 10 2017 22:42
    @jpitts banned @etherchamp1_twitter
  • Jun 05 2016 10:33
    @chriseth banned @adamskee
SafeFantom
@SafeFantom_twitter
I don't know
It has a rebase function
do you have wechat
SafeFantom
@SafeFantom_twitter
i really need help, got 5 bnb stuck
SafeFantom
@SafeFantom_twitter
okay i kind of know the problem, there's a txlimit, but i dont know how to raise it
SafeFantom
@SafeFantom_twitter
i put in 5bnb as liquidity, but can only take out 2% at a time (or 0.1bnb for the first transaction)
Angela
@DuSKV9pLjlKENQH_twitter
我有WhatsApp
+16572251645
Marin Ivanov
@metala:matrix.org
[m]
Is there publicly deployed smart contracts, where I can eth_call a method and get the current block number? It's for testing an Ethereum client's historical state.
I don't trust that eth_blockNumber gives me the correct result and I want to access the current block number through eth_call.
Marin Ivanov
@metala:matrix.org
[m]
Nevermind. Luckily I have found that Compound Comptroller has getBlockNumber() method that it does exactly what I want.
ilijapet
@ilijapet
I have very strange behavior of Solidity. Here is simplified version of contract:

contract Coop {

IERC20 public token;    

struct Cooperant {
    uint256 feePayed;
    uint256 kg;
    uint256 received;         
} 

// map of cooperant addresses to structs
mapping (address => Cooperant) cooperants;  
address[] public cooperantAdresses;

constructor () public {
    //proveriti 
    token = new COOPToken("COOP token", "COOP", 18, 1_000_000_000_000_000_000);
}     

// fund COOP with yearly fee
function fundCoop() public payable returns (bool) {
    cooperants[msg.sender].feePayed += msg.value;
    cooperantAdresses.push(msg.sender);
    return true;
}


 function depositFruitsToCOOP(uint256 _kg) public returns (bool) {
    token.transfer(address(this), msg.sender, _kg);  
    cooperants[msg.sender].kg += _kg;
    cooperants[msg.sender].received += _kg;
    return true;  
 }       

function getCOOPBalance() public view returns (uint256, uint256) {
return (address(this).balance, token.balanceOf(address(this)));
}

function getUserAccountBalance() public view returns (uint256, uint256,uint256, uint256){
    return (cooperants[msg.sender].feePayed, cooperants[msg.sender].kg, cooperants[msg.sender].received, token.balanceOf(msg.sender));
}

function getUsersAddresses() public view returns (address[]memory) {
return cooperantAdresses;
}
}

Now funCoop() fun set msg.sender to right value. And getUserAccountBalance() function set msg.sender global var to 0x000000
Does someone have idea why this can be the case?
Ghost
@ghost~61130d956da037398482e4b1
image.png
Hi there.
Here is a function which get prime list.
when I try to get prime list with 90, the browser is stopped.
until 30, it's okay. Why? because of network speed?
Noah Wöhler
@nwoehler.usec:matrix.org
[m]
Hi, can I post a call for participants in an interview study on open source projects here? If any mod wants more details via DM first, then I'm happy to oblige 🙂
Lasha Markhvaidze
@LashaMarkhvaidze
What are ways to build my own coin/crypto except smart contract token
4 replies
Angela
@DuSKV9pLjlKENQH_twitter
Has nobody done the popular DeFi recently?
Lasha Markhvaidze
@LashaMarkhvaidze
Is it possible to manage Bitcoin Wallet with Ethereum Smart Contract?
KaiRo
@kairo:mozilla.org
[m]
if you convert all your BTC into WBTC, then for sure
Lasha Markhvaidze
@LashaMarkhvaidze
Thank you
李诗琪
@wennie151_twitter
Does anyone know what is meant by liquidity mining?
3 replies
李诗琪
@wennie151_twitter
Does anyone use coinbase for liquidity mining ETH like I do?
0xvariable
@0xvariable:matrix.org
[m]
What is the gas cost saving with immutable variables (? gas) vs SLOAD (800 gas)?
hrkrshnn
@hrkrshnn:matrix.org
[m]
0xvariable: At runtime, reading would be 3 gas, as opposed to 2100 or 100 for sload (after EIP-2929).
1 reply
hrkrshnn
@hrkrshnn:matrix.org
[m]
For completeness’s sake, the deploy time cost for immutable will typically be larger, push32 0x... as opposed to a typical push1 val; sload. So 33 bytes v/s 3---around 6000 gas. Also, the init code will be more complex for immutables.
kent7301
@kent7301
Hello everyone who can send ETH BTC
NEO
@ethwillupto10000
Any one have the hive os source code? The newest one.

Does anyone use coinbase for liquidity mining ETH like I do?

Me

Zsolt Kacso
@kaolti
heya! I have a weird issue. Have a view call that works fine in remix, but reverts when called from golang. Other methods work fine.
Anyone ran into this before?
I use abigen to generate a go file from solidity
Zsolt Kacso
@kaolti
nvm I solved it :)
Options Eskimo
@optionseskimo
Hey, I'm working on top of some old 0x code, and I need to pull compiler binaries from the solc-bin repository (https://binaries.soliditylang.org/). I specifically needed version 0.5.17, but its binary is missing for the emscripten-wasm32 platform. The binary for that version can be found for different platforms, but I really needed it for emscripten-wasm32.
Could that missing binary be added to the solc-bin repo, by any chance? I tried opening an issue on GitHub, but I think that's blocked on that repo.
1 reply
Ronan Sandford
@wighawag
Hey, it seems that symlinked path are not automatically added to the allow-paths list
I am using pnpm package manager which symlink node_modules directory to a parent folder
the remapping is set to hardhat/=node_modules/hardhat/ but with symlink it is actually : hardhat/=../../node_modules/.pnpm/hardhat-deploy@0.9.3_hardhat@2.6.5/node_modules/hardhat-deploy which solc does not seem to be aware of as it complained about not found: File outside of allowed directories.
1 reply
qq5678
@qq5678
Hello . How can I send ether from smart contract to a person ? I have this line of code but is not working payable(address(this).balance).transfer(member1); it returns me this error TypeError: Explicit type conversion not allowed from "uint256" to "address payable"
贝克街的天才
@yuyenews
Your amount and address are reversed
qq5678
@qq5678
What do you mean
smrpn
@smrpn:matrix.org
[m]
Is it possible to convert solidity smart contracts to rust smart contracts for a solana dapp?
S0AndS0
@s0ands0:matrix.org
[m]

@qq5678: TLDR the syntax is __address_to__.transfer(__amount__) where __address_to__ is the address to send funds, and __amount__ is the amount in Wei to send.

Here's an example for demonstrating how to deposit and withdraw from a smart contract;

Account.sol

// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.7;

/// @title Example contract for holding and distributing funds
/// @author S0AndS0
contract Account {
    address payable public owner;
    uint256 public balance;

    ///
    constructor(address payable _owner) payable {
        owner = _owner;
        balance = msg.value;
    }

    ///
    function deposit() external payable {
        balance += msg.value;
    }

    ///
    function withdraw(uint256 _amount) external {
        require(msg.sender == owner, "Message sender not contract owner");
        require(_amount <= balance, "Insufficient funds for withdraw");
        owner.transfer(_amount);
        balance -= _amount;
    }
}

And for completeness here's an example of how to initialize, and pay, a smart contract from a separate factory contract... plus a few bonus features;

Bank.sol

// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.7;

/// @title Example factory for making new accounts and getting initialized accounts
/// @author S0AndS0
contract Bank {
    /* Account.owner to address(Account) */
    mapping(address => address) accounts;

    ///
    function initializeAccount(address payable _account_owner)
        external
        payable
        returns (Account)
    {
        require(
            accounts[_account_owner] == address(0x0),
            "Account already initalized"
        );

        Account _account = (new Account){ value: msg.value }(_account_owner);
        accounts[_account_owner] = address(_account);
        return _account;
    }

    ///
    function getAccount(address _account_owner)
        external
        view
        returns (Account)
    {
        address _account_reference = accounts[_account_owner];
        require(_account_reference != address(0x0), "Account not initalized");
        return Account(_account_reference);
    }
}
ETHERUEMconsultant2018
@ETHERUEMconsultant2018
Hello . How can I send ether from smart contract to a person ? I have this line of code but is not working payable(address(this).balance).transfer(member1); it returns me this error TypeError: Explicit type conversion not allowed from "uint256" to "address payable"Contact eth@consultant.com
jamesdabr
@jamesdabr
not sure what member1 is but I assume it is an address?
so maybe member1.transfer(address(this).balance) ?
femi omoshona
@femostic4j
Greating to everyone, pls guys, how can do i get a script with this similar interface like this https://candlegenie.io/prediction for my projects. Pls any hint or idea will go a long way. Thanks
femi omoshona
@femostic4j
I working on a project @ this point i need a landing page similar to this https://candlegenie.io/prediction for my projects. How do get similar script for my landing page. Pls any hint or idea will go a long way. Thanks
stardust
@stardusty:matrix.org
[m]
Is there anyway to prevent duplication of NFT tokens between L1 and L2? I'm having a situation where the minter could technically mint the same token ID on both L1 and L2. Since the token contract is deployed on both L1 and L2 with the mint function, the minter could really just mint the same token ID on both chains. There wouldn't be a way to recognise which token is the real one when this happens.
1 reply
Muhammad Zaryab Rafique
@Zaryab-Programmer
CompilerError: Stack too deep when compiling inline assembly: Variable dataEnd is 1 slot(s) too deep inside the stack.