Project ChainVote

Hello @dan-i, I need some guidance on a project I’m working on at school, we’re making a Dapp for a voting system on the blockchain. We have used the courses here to learn how to do everything, and we’re using the Proxy, Function, Storage setup. But when testing everything, I can’t seem to be able to get through the proxy contract, so when I’m deploying the contract in truffle, it does not deploy the proxy contract so I can interact through it. I also tried to use remix to test sending requests through Proxy to the function contract, but the only way is through the lower level interaction of Calldata and that should be hexadecimal.

How can we test that everything is working as it should when Proxy is not being deployed in truffle or ganache?

edit: the reason I ran into this problem, is that when I’m testing with Moralis to store users, I can’t get the address from Proxy to use in the main.js file

1 Like

I hope you don’t mind me replying as well. I just recently also developed a Voting DApp, therefore got curious.
Feel free to have a look at my solution, maybe it is helpful: Voting DApp Repo
Short Demo

hmm, you haven’t used the proxy/function/storage tho, but cool to see your code anyways :blush:

I figured it out! :smiley:

with the following; I got the proxy up and running, and I think there was a problem with it being called “Proxy”


module.exports = async function (deployer, network, accounts) {
  await deployer.deploy(CaseOne);
  let instanceCase = await CaseOne.deployed();

  await deployer.deploy(Proxey, instanceCase.address);
  await Proxey.deployed();


sync function login() {
  try {
    user = await Moralis.User.current();
    if (!user) {
      user = await Moralis.Web3.authenticate();

    alert("User logged in");
    document.getElementById("login_button").style.display = "none";
    document.getElementById("voting").style.display = "block";
  } catch (error) {

async function createUser(_region, _userType) {
  alert("Region: " + _region + "\nUserType: " + _userType);
  window.web3 = await Moralis.Web3.enable();
  let contractInstance = new web3.eth.Contract(window.abi, contractAddress);
    .createUser(_region, _userType)
    .send({ from: ethereum.selectedAddress })
    .on("receipt", function (receipt) {

document.getElementById("login_button").onclick = login;
document.getElementById("create_user").onclick = function () {