How to use gmm() from the R gmm package?

I'm trying to estimate an econometric model with the gmm package. I'm having a hard time understanding the syntax to build the matrix of moments. You can find the code here:

You can find the data here: , it's taken from the book "A guide to modern econometrics" by Verbeek. The way I understand I need to build the matrix:

First create an empty matrix and then fill it by columns. For the first column, fill it with the moment condition for the intercept, and for the rest of the columns, fill them one by one with each moment condition for each parameter theta.

Any comment or remark is appreciated.

P.S.: The goal is not the estimate this model per se. I'm working on a paper where I need to use gmm to estimate the parameters of an utility function, but I wanted to first know how to use it on a toy data set.

P.P.S.: I did of course the examples that come in the vignette of the package, but they are very simple and don't explain clearly what you ought to do when you try to estimate more parameters than just one or two.
Here is an example that works on simulated data:

x2 <- rnorm(400)
x3 <- rnorm(400)
x4 <- rnorm(400)
y2 <- 2 + 4*x2 + 8*x3 + 12*x4 + rnorm(400)

dat2 <- as.matrix(cbind(1,x2,x3,x4))

  m <- array(0,dim=c(400,4))
  for (i in 1:4){
    m[,i] <- dat[,i]*(y2-dat[,i]*theta[i])

I rewrote the example I put on pastebin like this, but it still doesn't work. I'm starting to think that there's an obscure issue with the data set.